Skip to content

Commit 6fbe4bd

Browse files
authored
Merge pull request containerd#1040 from crosbymichael/api-review
Update GRPC APIs for consistency post review
2 parents 13e7d3c + 8b2cf6e commit 6fbe4bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+4091
-2754
lines changed

api/services/containers/containers.pb.go

Lines changed: 409 additions & 108 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/services/containers/containers.proto

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
syntax = "proto3";
22

3-
package containerd.v1;
3+
package containerd.services.containers.v1;
44

55
import "gogoproto/gogo.proto";
66
import "google/protobuf/any.proto";
@@ -51,11 +51,17 @@ message Container {
5151
// If this field is updated, the spec and rootfs needed to updated, as well.
5252
string image = 3;
5353

54+
message Runtime {
55+
// Name is the name of the runtime.
56+
string name = 1;
57+
// Options specify additional runtime initialization options.
58+
map<string, string> options = 2;
59+
}
5460
// Runtime specifies which runtime to use for executing this container.
55-
string runtime = 4;
61+
Runtime runtime = 4;
5662

5763
// Spec to be used when creating the container. This is runtime specific.
58-
google.protobuf.Any spec = 6;
64+
google.protobuf.Any spec = 5;
5965

6066
// RootFS specifies the snapshot key to use for the container's root
6167
// filesystem. When starting a task from this container, a caller should
@@ -65,10 +71,13 @@ message Container {
6571
// Snapshots referenced in this field will not be garbage collected.
6672
//
6773
// This field may be updated.
68-
string rootfs = 7 [(gogoproto.customname) = "RootFS"];
74+
string rootfs = 6 [(gogoproto.customname) = "RootFS"];
6975

70-
google.protobuf.Timestamp created_at = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
71-
google.protobuf.Timestamp updated_at = 9 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
76+
// CreatedAt is the time the container was first created.
77+
google.protobuf.Timestamp created_at = 7 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
78+
79+
// UpdatedAt is the last time the container was mutated.
80+
google.protobuf.Timestamp updated_at = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
7281
}
7382

7483
message GetContainerRequest {

api/services/content/content.pb.go

Lines changed: 293 additions & 292 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/services/content/content.proto

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
syntax = "proto3";
22

3-
package containerd.v1;
3+
package containerd.services.content.v1;
44

55
import "gogoproto/gogo.proto";
66
import "google/protobuf/timestamp.proto";
@@ -28,7 +28,7 @@ service Content {
2828
// Read allows one to read an object based on the offset into the content.
2929
//
3030
// The requested data may be returned in one or more messages.
31-
rpc Read(ReadRequest) returns (stream ReadResponse);
31+
rpc Read(ReadContentRequest) returns (stream ReadContentResponse);
3232

3333
// Status returns the status of ongoing object ingestions, started via
3434
// Write.
@@ -54,7 +54,7 @@ service Content {
5454
//
5555
// When completed, the commit flag should be set to true. If expected size
5656
// or digest is set, the content will be validated against those values.
57-
rpc Write(stream WriteRequest) returns (stream WriteResponse);
57+
rpc Write(stream WriteContentRequest) returns (stream WriteContentResponse);
5858

5959
// Abort cancels the ongoing write named in the request. Any resources
6060
// associated with the write will be collected.
@@ -91,9 +91,9 @@ message DeleteContentRequest {
9191
string digest = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
9292
}
9393

94-
// ReadRequest defines the fields that make up a request to read a portion of
94+
// ReadContentRequest defines the fields that make up a request to read a portion of
9595
// data from a stored object.
96-
message ReadRequest {
96+
message ReadContentRequest {
9797
// Digest is the hash identity to read.
9898
string digest = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
9999

@@ -107,16 +107,12 @@ message ReadRequest {
107107
int64 size = 3;
108108
}
109109

110-
// ReadResponse carries byte data for a read request.
111-
message ReadResponse {
110+
// ReadContentResponse carries byte data for a read request.
111+
message ReadContentResponse {
112112
int64 offset = 1; // offset of the returned data
113113
bytes data = 2; // actual data
114114
}
115115

116-
message StatusRequest {
117-
string regexp = 1;
118-
}
119-
120116
message Status {
121117
google.protobuf.Timestamp started_at = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
122118
google.protobuf.Timestamp updated_at = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
@@ -126,6 +122,10 @@ message Status {
126122
string expected = 6 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
127123
}
128124

125+
message StatusRequest {
126+
string filter = 1;
127+
}
128+
129129
message StatusResponse {
130130
repeated Status statuses = 1 [(gogoproto.nullable) = false];
131131
}
@@ -157,8 +157,8 @@ enum WriteAction {
157157
COMMIT = 2 [(gogoproto.enumvalue_customname) = "WriteActionCommit"];
158158
}
159159

160-
// WriteRequest writes data to the request ref at offset.
161-
message WriteRequest {
160+
// WriteContentRequest writes data to the request ref at offset.
161+
message WriteContentRequest {
162162
// Action sets the behavior of the write.
163163
//
164164
// When this is a write and the ref is not yet allocated, the ref will be
@@ -215,8 +215,8 @@ message WriteRequest {
215215
bytes data = 6;
216216
}
217217

218-
// WriteResponse is returned on the culmination of a write call.
219-
message WriteResponse {
218+
// WriteContentResponse is returned on the culmination of a write call.
219+
message WriteContentResponse {
220220
// Action contains the action for the final message of the stream. A writer
221221
// should confirm that they match the intended result.
222222
WriteAction action = 1;

api/services/diff/diff.pb.go

Lines changed: 37 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/services/diff/diff.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
syntax = "proto3";
22

3-
package containerd.v1;
3+
package containerd.services.diff.v1;
44

55
import "gogoproto/gogo.proto";
66
import "google/protobuf/empty.proto";

0 commit comments

Comments
 (0)