github.com/datawolf/containerd@v0.2.4/api/grpc/types/api.proto (about) 1 syntax = "proto3"; 2 3 package types; 4 5 import "google/protobuf/timestamp.proto"; 6 7 service API { 8 rpc GetServerVersion(GetServerVersionRequest) returns (GetServerVersionResponse) {} 9 rpc CreateContainer(CreateContainerRequest) returns (CreateContainerResponse) {} 10 rpc UpdateContainer(UpdateContainerRequest) returns (UpdateContainerResponse) {} 11 rpc Signal(SignalRequest) returns (SignalResponse) {} 12 rpc UpdateProcess(UpdateProcessRequest) returns (UpdateProcessResponse) {} 13 rpc AddProcess(AddProcessRequest) returns (AddProcessResponse) {} 14 rpc CreateCheckpoint(CreateCheckpointRequest) returns (CreateCheckpointResponse) {} 15 rpc DeleteCheckpoint(DeleteCheckpointRequest) returns (DeleteCheckpointResponse) {} 16 rpc ListCheckpoint(ListCheckpointRequest) returns (ListCheckpointResponse) {} 17 rpc State(StateRequest) returns (StateResponse) {} 18 rpc Events(EventsRequest) returns (stream Event) {} 19 rpc Stats(StatsRequest) returns (StatsResponse) {} 20 } 21 22 message GetServerVersionRequest { 23 } 24 25 message GetServerVersionResponse { 26 uint32 major = 1; 27 uint32 minor = 2; 28 uint32 patch = 3; 29 string revision = 4; 30 } 31 32 message UpdateProcessRequest { 33 string id = 1; 34 string pid = 2; 35 bool closeStdin = 3; // Close stdin of the container 36 uint32 width = 4; 37 uint32 height = 5; 38 } 39 40 message UpdateProcessResponse { 41 } 42 43 message CreateContainerRequest { 44 string id = 1; // ID of container 45 string bundlePath = 2; // path to OCI bundle 46 string checkpoint = 3; // checkpoint name if you want to create immediate checkpoint (optional) 47 string stdin = 4; // path to the file where stdin will be read (optional) 48 string stdout = 5; // path to file where stdout will be written (optional) 49 string stderr = 6; // path to file where stderr will be written (optional) 50 repeated string labels = 7; 51 bool noPivotRoot = 8; 52 string runtime = 9; 53 repeated string runtimeArgs = 10; 54 string checkpointDir = 11; // Directory where checkpoints are stored 55 } 56 57 message CreateContainerResponse { 58 Container container = 1; 59 } 60 61 message SignalRequest { 62 string id = 1; // ID of container 63 string pid = 2; // PID of process inside container 64 uint32 signal = 3; // Signal which will be sent, you can find value in "man 7 signal" 65 } 66 67 message SignalResponse { 68 } 69 70 message AddProcessRequest { 71 string id = 1; // ID of container 72 bool terminal = 2; // Use tty for container stdio 73 User user = 3; // User under which process will be run 74 repeated string args = 4; // Arguments for process, first is binary path itself 75 repeated string env = 5; // List of environment variables for process 76 string cwd = 6; // Workind directory of process 77 string pid = 7; // Process ID 78 string stdin = 8; // path to the file where stdin will be read (optional) 79 string stdout = 9; // path to file where stdout will be written (optional) 80 string stderr = 10; // path to file where stderr will be written (optional) 81 repeated string capabilities = 11; 82 string apparmorProfile = 12; 83 string selinuxLabel = 13; 84 bool noNewPrivileges = 14; 85 repeated Rlimit rlimits = 15; 86 } 87 88 message Rlimit { 89 string type = 1; 90 uint64 soft = 2; 91 uint64 hard = 3; 92 } 93 94 message User { 95 uint32 uid = 1; // UID of user 96 uint32 gid = 2; // GID of user 97 repeated uint32 additionalGids = 3; // Additional groups to which user will be added 98 } 99 100 message AddProcessResponse { 101 } 102 103 message CreateCheckpointRequest { 104 string id = 1; // ID of container 105 Checkpoint checkpoint = 2; // Checkpoint configuration 106 string checkpointDir = 3; // Directory where checkpoints are stored 107 } 108 109 message CreateCheckpointResponse { 110 } 111 112 message DeleteCheckpointRequest { 113 string id = 1; // ID of container 114 string name = 2; // Name of checkpoint 115 string checkpointDir = 3; // Directory where checkpoints are stored 116 } 117 118 message DeleteCheckpointResponse { 119 } 120 121 message ListCheckpointRequest { 122 string id = 1; // ID of container 123 string checkpointDir = 2; // Directory where checkpoints are stored 124 } 125 126 message Checkpoint { 127 string name = 1; // Name of checkpoint 128 bool exit = 2; // checkpoint configuration: should container exit on checkpoint or not 129 bool tcp = 3; // allow open tcp connections 130 bool unixSockets = 4; // allow external unix sockets 131 bool shell = 5; // allow shell-jobs 132 repeated string emptyNS = 6; 133 } 134 135 message ListCheckpointResponse { 136 repeated Checkpoint checkpoints = 1; // List of checkpoints 137 } 138 139 message StateRequest { 140 string id = 1; // container id for a single container 141 } 142 143 message ContainerState { 144 string status = 1; 145 } 146 147 message Process { 148 string pid = 1; 149 bool terminal = 2; // Use tty for container stdio 150 User user = 3; // User under which process will be run 151 repeated string args = 4; // Arguments for process, first is binary path itself 152 repeated string env = 5; // List of environment variables for process 153 string cwd = 6; // Workind directory of process 154 uint32 systemPid = 7; 155 string stdin = 8; // path to the file where stdin will be read (optional) 156 string stdout = 9; // path to file where stdout will be written (optional) 157 string stderr = 10; // path to file where stderr will be written (optional) 158 repeated string capabilities = 11; 159 string apparmorProfile = 12; 160 string selinuxLabel = 13; 161 bool noNewPrivileges = 14; 162 repeated Rlimit rlimits = 15; 163 } 164 165 message Container { 166 string id = 1; // ID of container 167 string bundlePath = 2; // Path to OCI bundle 168 repeated Process processes = 3; // List of processes which run in container 169 string status = 4; // Container status ("running", "paused", etc.) 170 repeated string labels = 5; 171 repeated uint32 pids = 6; 172 string runtime = 7; // runtime used to execute the container 173 } 174 175 // Machine is information about machine on which containerd is run 176 message Machine { 177 uint32 cpus = 1; // number of cpus 178 uint64 memory = 2; // amount of memory 179 } 180 181 // StateResponse is information about containerd daemon 182 message StateResponse { 183 repeated Container containers = 1; 184 Machine machine = 2; 185 } 186 187 message UpdateContainerRequest { 188 string id = 1; // ID of container 189 string pid = 2; 190 string status = 3; // Status to which containerd will try to change 191 UpdateResource resources =4; 192 } 193 194 message UpdateResource { 195 uint64 blkioWeight =1; 196 uint64 cpuShares = 2; 197 uint64 cpuPeriod = 3; 198 uint64 cpuQuota = 4; 199 string cpusetCpus = 5; 200 string cpusetMems = 6; 201 uint64 memoryLimit = 7; 202 uint64 memorySwap = 8; 203 uint64 memoryReservation = 9; 204 uint64 kernelMemoryLimit = 10; 205 uint64 kernelTCPMemoryLimit = 11; 206 } 207 208 message UpdateContainerResponse { 209 } 210 211 message EventsRequest { 212 // Tag 1 is deprecated (old uint64 timestamp) 213 google.protobuf.Timestamp timestamp = 2; 214 bool storedOnly = 3; 215 string id = 4; 216 } 217 218 message Event { 219 string type = 1; 220 string id = 2; 221 uint32 status = 3; 222 string pid = 4; 223 // Tag 5 is deprecated (old uint64 timestamp) 224 google.protobuf.Timestamp timestamp = 6; 225 } 226 227 message NetworkStats { 228 string name = 1; // name of network interface 229 uint64 rx_bytes = 2; 230 uint64 rx_Packets = 3; 231 uint64 Rx_errors = 4; 232 uint64 Rx_dropped = 5; 233 uint64 Tx_bytes = 6; 234 uint64 Tx_packets = 7; 235 uint64 Tx_errors = 8; 236 uint64 Tx_dropped = 9; 237 } 238 239 message CpuUsage { 240 uint64 total_usage = 1; 241 repeated uint64 percpu_usage = 2; 242 uint64 usage_in_kernelmode = 3; 243 uint64 usage_in_usermode = 4; 244 } 245 246 message ThrottlingData { 247 uint64 periods = 1; 248 uint64 throttled_periods = 2; 249 uint64 throttled_time = 3; 250 } 251 252 message CpuStats { 253 CpuUsage cpu_usage = 1; 254 ThrottlingData throttling_data = 2; 255 uint64 system_usage = 3; 256 } 257 258 message PidsStats { 259 uint64 current = 1; 260 uint64 limit = 2; 261 } 262 263 message MemoryData { 264 uint64 usage = 1; 265 uint64 max_usage = 2; 266 uint64 failcnt = 3; 267 uint64 limit = 4; 268 } 269 270 message MemoryStats { 271 uint64 cache = 1; 272 MemoryData usage = 2; 273 MemoryData swap_usage = 3; 274 MemoryData kernel_usage = 4; 275 map<string, uint64> stats = 5; 276 } 277 278 message BlkioStatsEntry { 279 uint64 major = 1; 280 uint64 minor = 2; 281 string op = 3; 282 uint64 value = 4; 283 } 284 285 message BlkioStats { 286 repeated BlkioStatsEntry io_service_bytes_recursive = 1; // number of bytes transferred to and from the block device 287 repeated BlkioStatsEntry io_serviced_recursive = 2; 288 repeated BlkioStatsEntry io_queued_recursive = 3; 289 repeated BlkioStatsEntry io_service_time_recursive = 4; 290 repeated BlkioStatsEntry io_wait_time_recursive = 5; 291 repeated BlkioStatsEntry io_merged_recursive = 6; 292 repeated BlkioStatsEntry io_time_recursive = 7; 293 repeated BlkioStatsEntry sectors_recursive = 8; 294 } 295 296 message HugetlbStats { 297 uint64 usage = 1; 298 uint64 max_usage = 2; 299 uint64 failcnt = 3; 300 uint64 limit = 4; 301 } 302 303 message CgroupStats { 304 CpuStats cpu_stats = 1; 305 MemoryStats memory_stats = 2; 306 BlkioStats blkio_stats = 3; 307 map<string, HugetlbStats> hugetlb_stats = 4; // the map is in the format "size of hugepage: stats of the hugepage" 308 PidsStats pids_stats = 5; 309 } 310 311 message StatsResponse { 312 repeated NetworkStats network_stats = 1; 313 CgroupStats cgroup_stats = 2; 314 // Tag 3 is deprecated (old uint64 timestamp) 315 google.protobuf.Timestamp timestamp = 4; 316 }; 317 318 message StatsRequest { 319 string id = 1; 320 }