1syntax = "proto3"; 2 3package containerd.runtime.linux.shim.v1; 4 5import "google/protobuf/any.proto"; 6import "google/protobuf/empty.proto"; 7import weak "gogoproto/gogo.proto"; 8import "google/protobuf/timestamp.proto"; 9import "github.com/containerd/containerd/api/types/mount.proto"; 10import "github.com/containerd/containerd/api/types/task/task.proto"; 11 12option go_package = "github.com/containerd/containerd/runtime/v1/shim/v1;shim"; 13 14// Shim service is launched for each container and is responsible for owning the IO 15// for the container and its additional processes. The shim is also the parent of 16// each container and allows reattaching to the IO and receiving the exit status 17// for the container processes. 18service Shim { 19 // State returns shim and task state information. 20 rpc State(StateRequest) returns (StateResponse); 21 22 rpc Create(CreateTaskRequest) returns (CreateTaskResponse); 23 24 rpc Start(StartRequest) returns (StartResponse); 25 26 rpc Delete(google.protobuf.Empty) returns (DeleteResponse); 27 28 rpc DeleteProcess(DeleteProcessRequest) returns (DeleteResponse); 29 30 rpc ListPids(ListPidsRequest) returns (ListPidsResponse); 31 32 rpc Pause(google.protobuf.Empty) returns (google.protobuf.Empty); 33 34 rpc Resume(google.protobuf.Empty) returns (google.protobuf.Empty); 35 36 rpc Checkpoint(CheckpointTaskRequest) returns (google.protobuf.Empty); 37 38 rpc Kill(KillRequest) returns (google.protobuf.Empty); 39 40 rpc Exec(ExecProcessRequest) returns (google.protobuf.Empty); 41 42 rpc ResizePty(ResizePtyRequest) returns (google.protobuf.Empty); 43 44 rpc CloseIO(CloseIORequest) returns (google.protobuf.Empty); 45 46 // ShimInfo returns information about the shim. 47 rpc ShimInfo(google.protobuf.Empty) returns (ShimInfoResponse); 48 49 rpc Update(UpdateTaskRequest) returns (google.protobuf.Empty); 50 51 rpc Wait(WaitRequest) returns (WaitResponse); 52} 53 54message CreateTaskRequest { 55 string id = 1; 56 string bundle = 2; 57 string runtime = 3; 58 repeated containerd.types.Mount rootfs = 4; 59 bool terminal = 5; 60 string stdin = 6; 61 string stdout = 7; 62 string stderr = 8; 63 string checkpoint = 9; 64 string parent_checkpoint = 10; 65 google.protobuf.Any options = 11; 66} 67 68message CreateTaskResponse { 69 uint32 pid = 1; 70} 71 72message DeleteResponse { 73 uint32 pid = 1; 74 uint32 exit_status = 2; 75 google.protobuf.Timestamp exited_at = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; 76} 77 78message DeleteProcessRequest { 79 string id = 1; 80} 81 82message ExecProcessRequest { 83 string id = 1; 84 bool terminal = 2; 85 string stdin = 3; 86 string stdout = 4; 87 string stderr = 5; 88 google.protobuf.Any spec = 6; 89} 90 91message ExecProcessResponse { 92} 93 94message ResizePtyRequest { 95 string id = 1; 96 uint32 width = 2; 97 uint32 height = 3; 98} 99 100message StateRequest { 101 string id = 1; 102} 103 104message StateResponse { 105 string id = 1; 106 string bundle = 2; 107 uint32 pid = 3; 108 containerd.v1.types.Status status = 4; 109 string stdin = 5; 110 string stdout = 6; 111 string stderr = 7; 112 bool terminal = 8; 113 uint32 exit_status = 9; 114 google.protobuf.Timestamp exited_at = 10 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; 115} 116 117message KillRequest { 118 string id = 1; 119 uint32 signal = 2; 120 bool all = 3; 121} 122 123message CloseIORequest { 124 string id = 1; 125 bool stdin = 2; 126} 127 128message ListPidsRequest { 129 string id = 1; 130} 131 132message ListPidsResponse { 133 repeated containerd.v1.types.ProcessInfo processes = 1; 134} 135 136message CheckpointTaskRequest { 137 string path = 1; 138 google.protobuf.Any options = 2; 139} 140 141message ShimInfoResponse { 142 uint32 shim_pid = 1; 143} 144 145message UpdateTaskRequest { 146 google.protobuf.Any resources = 1; 147} 148 149message StartRequest { 150 string id = 1; 151} 152 153message StartResponse { 154 string id = 1; 155 uint32 pid = 2; 156} 157 158message WaitRequest { 159 string id = 1; 160} 161 162message WaitResponse { 163 uint32 exit_status = 1; 164 google.protobuf.Timestamp exited_at = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; 165} 166