Update GRPC for consistency

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-06-20 17:47:59 -07:00
parent 13e7d3c393
commit 94eafaab60
56 changed files with 3941 additions and 2802 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,9 @@
syntax = "proto3";
package containerd.v1;
package containerd.services.images.v1;
import "gogoproto/gogo.proto";
import "google/protobuf/empty.proto";
import "github.com/containerd/containerd/api/types/mount/mount.proto";
import "github.com/containerd/containerd/api/types/descriptor/descriptor.proto";
// Images is a service that allows one to register images with containerd.
@@ -20,59 +19,49 @@ import "github.com/containerd/containerd/api/types/descriptor/descriptor.proto";
// As such, this can really be considered a "metadata service".
service Images {
// Get returns an image by name.
rpc Get(GetRequest) returns (GetResponse);
rpc Get(GetImageRequest) returns (GetImageResponse);
// List returns a list of all images known to containerd.
rpc List(ListRequest) returns (ListResponse);
rpc List(ListImagesRequest) returns (ListImagesResponse);
// Put assigns the name to a given target image based on the provided
// Update assigns the name to a given target image based on the provided
// image.
rpc Put(PutRequest) returns (google.protobuf.Empty);
rpc Update(UpdateImageRequest) returns (UpdateImageResponse);
// Delete deletes the image by name.
rpc Delete(DeleteRequest) returns (google.protobuf.Empty);
rpc Delete(DeleteImageRequest) returns (google.protobuf.Empty);
}
message Image {
string name = 1;
string labels = 2;
types.Descriptor target = 3 [(gogoproto.nullable) = false];
map<string, string> labels = 2;
containerd.v1.types.Descriptor target = 3 [(gogoproto.nullable) = false];
}
message GetRequest {
message GetImageRequest {
string name = 1;
// TODO(stevvooe): Consider that we may want to have multiple images under
// the same name or multiple names for the same image. This mapping could
// be truly many to many but we'll need a way to identify an entry.
//
// For now, we consider it unique but an intermediary index could be
// created to allow for a dispatch of images.
}
message GetResponse {
message GetImageResponse {
Image image = 1;
}
message PutRequest {
message UpdateImageRequest {
Image image = 1 [(gogoproto.nullable) = false];
}
message ListRequest {
// TODO(stevvooe): empty for now, need to ad filtration
// Some common use cases we might consider:
//
// 1. Select by multiple names.
// 2. Select by platform.
// 3. Select by annotations.
message UpdateImageResponse {
Image image = 1 [(gogoproto.nullable) = false];
}
message ListResponse {
message ListImagesRequest {
string filter = 1;
}
message ListImagesResponse {
repeated Image images = 1 [(gogoproto.nullable) = false];
// TODO(stevvooe): Add pagination.
}
message DeleteRequest {
message DeleteImageRequest {
string name = 1;
}