Skip to content

Commit

Permalink
v3: Move services to top of the file
Browse files Browse the repository at this point in the history
  • Loading branch information
KeyboardNerd committed Feb 22, 2019
1 parent 73bc2bc commit dd23976
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions api/v3/clairpb/clair.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,38 @@ package coreos.clair;
option go_package = "clairpb";
option java_package = "com.coreos.clair.pb";

service AncestryService {
// The RPC used to read the results of scanning for a particular ancestry.
rpc GetAncestry(GetAncestryRequest) returns (GetAncestryResponse) {
option (google.api.http) = { get: "/ancestry/{ancestry_name}" };
}
// The RPC used to create a new scan of an ancestry.
rpc PostAncestry(PostAncestryRequest) returns (PostAncestryResponse) {
option (google.api.http) = {
post: "/ancestry"
body: "*"
};
}
}

service StatusService {
// The RPC used to show the internal state of current Clair instance.
rpc GetStatus(GetStatusRequest) returns (GetStatusResponse) {
option (google.api.http) = { get: "/status" };
}
}

service NotificationService {
// The RPC used to get a particularly Notification.
rpc GetNotification(GetNotificationRequest) returns (GetNotificationResponse) {
option (google.api.http) = { get: "/notifications/{name}" };
}
// The RPC used to mark a Notification as read after it has been processed.
rpc MarkNotificationAsRead(MarkNotificationAsReadRequest) returns (MarkNotificationAsReadResponse) {
option (google.api.http) = { delete: "/notifications/{name}" };
}
}

message Vulnerability {
// The name of the vulnerability.
string name = 1;
Expand Down Expand Up @@ -90,20 +122,6 @@ message Layer {
string hash = 1;
}

service AncestryService {
// The RPC used to read the results of scanning for a particular ancestry.
rpc GetAncestry(GetAncestryRequest) returns (GetAncestryResponse) {
option (google.api.http) = { get: "/ancestry/{ancestry_name}" };
}
// The RPC used to create a new scan of an ancestry.
rpc PostAncestry(PostAncestryRequest) returns (PostAncestryResponse) {
option (google.api.http) = {
post: "/ancestry"
body: "*"
};
}
}

message ClairStatus {
// The implemented detectors in this Clair instance
repeated Detector detectors = 1;
Expand Down Expand Up @@ -142,7 +160,7 @@ message PostAncestryRequest {
message PostLayer {
// The hash of the layer.
string hash = 1;
// The location of the layer (URL or filepath).
// The location of the layer (URL or file path).
string path = 2;
// Any HTTP Headers that need to be used if requesting a layer over HTTP(S).
map<string, string> headers = 3;
Expand All @@ -162,17 +180,6 @@ message PostAncestryResponse {
ClairStatus status = 1;
}

service NotificationService {
// The RPC used to get a particularly Notification.
rpc GetNotification(GetNotificationRequest) returns (GetNotificationResponse) {
option (google.api.http) = { get: "/notifications/{name}" };
}
// The RPC used to mark a Notification as read after it has been processed.
rpc MarkNotificationAsRead(MarkNotificationAsReadRequest) returns (MarkNotificationAsReadResponse) {
option (google.api.http) = { delete: "/notifications/{name}" };
}
}

message GetNotificationRequest {
// The current page of previous vulnerabilities for the ancestry.
// This will be empty when it is the first page.
Expand Down Expand Up @@ -239,10 +246,3 @@ message GetStatusResponse {
// The status of the current Clair instance.
ClairStatus status = 1;
}

service StatusService {
// The RPC used to show the internal state of current Clair instance.
rpc GetStatus(GetStatusRequest) returns (GetStatusResponse) {
option (google.api.http) = { get: "/status" };
}
}

0 comments on commit dd23976

Please sign in to comment.