Add protos for initial API
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
5f757c914c
commit
fc577a1cbb
2 changed files with 162 additions and 0 deletions
123
api/container/container.proto
Normal file
123
api/container/container.proto
Normal file
|
@ -0,0 +1,123 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package containerd.v1;
|
||||
|
||||
service Containers {
|
||||
// container level rpcs
|
||||
rpc Create(CreateRequest) returns (CreateResponse);
|
||||
rpc Start(StartRequest) returns (StartResponse);
|
||||
rpc Delete(DeleteRequest) returns (DeleteResponse);
|
||||
rpc State(StateRequest) returns (StateResponse);
|
||||
|
||||
// container level action rpcs
|
||||
rpc Update(UpdateRequest) returns (UpdateResponse);
|
||||
rpc Pause(PauseRequest) returns (PauseResponse);
|
||||
rpc Resume(ResumeRequest) returns (ResumeResponse);
|
||||
|
||||
// process level rpcs
|
||||
rpc CreateProcess(CreateProcessRequest) returns (CreateProcessResponse);
|
||||
rpc StartProcess(StartProcessRequest) returns (StartProcessResponse);
|
||||
rpc ProcessState(ProcessStateRequest) returns (ProcessStateResponse);
|
||||
rpc SignalProcess(SignalProcessRequest) returns (SignalProcessResponse);
|
||||
rpc DeleteProcess(DeleteProcessRequest) returns (DeleteProcessResponse);
|
||||
|
||||
// agg rpcs
|
||||
rpc List(ListRequest) returns (ListResponse);
|
||||
rpc ListProcesses(ListProcessesRequest) returns (ListProcessesResponse);
|
||||
rpc Events(EventsRequest) returns (stream EventsResponse);
|
||||
}
|
||||
|
||||
message Container {
|
||||
string id = 1;
|
||||
repeated Mount mounts = 2;
|
||||
Process process = 3;
|
||||
optional string config_path = 4;
|
||||
}
|
||||
|
||||
message Process {
|
||||
repeated string args = 1;
|
||||
repeated string env = 2;
|
||||
User user = 3;
|
||||
string cwd = 4;
|
||||
bool terminal = 5;
|
||||
string stdin = 6;
|
||||
string stdout = 7;
|
||||
string stderr = 8;
|
||||
}
|
||||
|
||||
message Mount {
|
||||
|
||||
}
|
||||
|
||||
message User {
|
||||
uint32 uid = 1;
|
||||
uint32 gid = 2;
|
||||
repeated uint32 additionalGids = 3;
|
||||
}
|
||||
|
||||
message CreateRequest {
|
||||
Container container = 1;
|
||||
}
|
||||
|
||||
message CreateResponse {
|
||||
}
|
||||
|
||||
message StartRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message StartResponse {
|
||||
|
||||
}
|
||||
|
||||
message StopRequest {
|
||||
string id = 1;
|
||||
uint32 signal = 2;
|
||||
uint32 timeout = 3;
|
||||
}
|
||||
|
||||
message StopResponse {
|
||||
|
||||
}
|
||||
|
||||
message DeleteRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message DeleteResponse {
|
||||
|
||||
}
|
||||
|
||||
message ListRequest {
|
||||
|
||||
}
|
||||
|
||||
message ListResponse {
|
||||
repeated Container containers = 1;
|
||||
}
|
||||
|
||||
message StateRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message StateResponse {
|
||||
Container container = 1;
|
||||
}
|
||||
|
||||
message ExecRequest {
|
||||
string container_id = 1;
|
||||
string id = 2;
|
||||
Process process = 3;
|
||||
}
|
||||
|
||||
message ExecResponse {
|
||||
|
||||
}
|
||||
|
||||
message UpdateRequest {
|
||||
string id = 1;
|
||||
}
|
||||
|
||||
message UpdateResponse {
|
||||
|
||||
}
|
39
api/registry/registry.proto
Normal file
39
api/registry/registry.proto
Normal file
|
@ -0,0 +1,39 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package containerd.v1;
|
||||
|
||||
service Registry {
|
||||
// Pull an image from a registry
|
||||
rpc Pull(PullRequest) returns (PullResponse);
|
||||
// Push pushes a new or existing image to a registry
|
||||
rpc Push(PushRequest) returns (PushResponse);
|
||||
// Delete deletes an image from the registry
|
||||
rpc Delete(DeleteRequest) returns (DeleteResponse);
|
||||
|
||||
// Status returns a progress stream of the push or pull operation
|
||||
rpc Status(StatusRequest) returns (stream StatusResponse);
|
||||
// Cancel cancels a push or pull operation
|
||||
rpc Cancel(CancelRequest) returns (CancelResponse);
|
||||
}
|
||||
|
||||
message PullRequest {
|
||||
string uri = 1;
|
||||
Authentication auth = 2;
|
||||
}
|
||||
|
||||
message PullResponse {
|
||||
string id = 1;
|
||||
repeated Layer layers = 2;
|
||||
}
|
||||
|
||||
message Layer {
|
||||
string id = 1;
|
||||
uint64 size = 2;
|
||||
}
|
||||
|
||||
// TODO: we have no clue what should go here, halp stevvooo
|
||||
message Authentication {
|
||||
string username = 1;
|
||||
string password = 2;
|
||||
}
|
||||
|
Loading…
Reference in a new issue