api: introduce api/{types,services} for deduplication of API definition

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda 2017-02-09 07:31:26 +00:00
parent 6527a57d7b
commit bf8abef70f
37 changed files with 2179 additions and 1753 deletions

6
api/services/shim/gen.go Normal file
View file

@ -0,0 +1,6 @@
// Code generated by tools/gen-gen-go.sh
// DO NOT EDIT!
package shim
//go:generate protoc -I.:/home/suda/gopath/src/github.com/docker/containerd/vendor:/home/suda/gopath/src/github.com/docker/containerd/vendor/github.com/gogo/protobuf:/home/suda/gopath/src/github.com/docker/containerd/../../..:/usr/local/include --gogoctrd_out=plugins=grpc,import_path=github.com/docker/containerd/api/services/shim,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:. shim.proto

3730
api/services/shim/shim.pb.go Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,113 @@
syntax = "proto3";
package containerd.v1.services;
import "google/protobuf/empty.proto";
import "gogoproto/gogo.proto";
import "github.com/docker/containerd/api/types/process/process.proto";
import "github.com/docker/containerd/api/types/user/user.proto";
service Shim {
rpc Create(CreateRequest) returns (CreateResponse);
rpc Start(StartRequest) returns (google.protobuf.Empty);
rpc Delete(DeleteRequest) returns (DeleteResponse);
rpc Exec(ExecRequest) returns (ExecResponse);
rpc Pty(PtyRequest) returns (google.protobuf.Empty);
rpc Events(EventsRequest) returns (stream Event);
rpc State(StateRequest) returns (StateResponse);
rpc Pause(PauseRequest) returns (google.protobuf.Empty);
rpc Resume(ResumeRequest) returns (google.protobuf.Empty);
}
message CreateRequest {
string id = 1 [(gogoproto.customname) = "ID"];
string bundle = 2;
string runtime = 3;
bool no_pivot = 4;
bool terminal = 5;
string stdin = 6;
string stdout = 7;
string stderr = 8;
}
message CreateResponse {
uint32 pid = 1;
}
message StartRequest {
}
message DeleteRequest {
uint32 pid = 1;
}
message DeleteResponse {
uint32 exit_status = 1;
}
message ExecRequest {
bool terminal = 1;
string stdin = 2;
string stdout = 3;
string stderr = 4;
string selinux_label = 5;
types.User user = 6;
repeated string args = 7;
repeated string env = 8;
string cwd = 9;
repeated string capabilities = 10;
repeated Rlimit rlimits = 11;
bool no_new_privileges = 12;
string apparmor_profile = 13;
}
message Rlimit {
string type = 1;
uint64 hard = 2;
uint64 soft = 3;
}
message ExecResponse {
uint32 pid = 1;
}
message PtyRequest {
uint32 pid = 1;
uint32 width = 2;
uint32 height = 3;
}
message EventsRequest {
}
enum EventType {
EXIT = 0;
OOM = 1;
CREATE = 2;
START = 3;
EXEC_ADDED = 4;
}
// should be moved to api/types/event maybe
message Event {
string id = 1 [(gogoproto.customname) = "ID"];
EventType type = 2;
uint32 pid = 3;
uint32 exit_status = 4;
}
message StateRequest {
}
message StateResponse {
string id = 1 [(gogoproto.customname) = "ID"];
string bundle = 2;
uint32 initPid = 3;
repeated types.Process processes = 4;
}
message PauseRequest {
}
message ResumeRequest {
}