github.com/docker/containerd@v0.2.9-0.20170509230648-8ef7df579710/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; // Working 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 uint32 systemPid = 1; 102 } 103 104 message CreateCheckpointRequest { 105 string id = 1; // ID of container 106 Checkpoint checkpoint = 2; // Checkpoint configuration 107 string checkpointDir = 3; // Directory where checkpoints are stored 108 } 109 110 message CreateCheckpointResponse { 111 } 112 113 message DeleteCheckpointRequest { 114 string id = 1; // ID of container 115 string name = 2; // Name of checkpoint 116 string checkpointDir = 3; // Directory where checkpoints are stored 117 } 118 119 message DeleteCheckpointResponse { 120 } 121 122 message ListCheckpointRequest { 123 string id = 1; // ID of container 124 string checkpointDir = 2; // Directory where checkpoints are stored 125 } 126 127 message Checkpoint { 128 string name = 1; // Name of checkpoint 129 bool exit = 2; // checkpoint configuration: should container exit on checkpoint or not 130 bool tcp = 3; // allow open tcp connections 131 bool unixSockets = 4; // allow external unix sockets 132 bool shell = 5; // allow shell-jobs 133 repeated string emptyNS = 6; 134 } 135 136 message ListCheckpointResponse { 137 repeated Checkpoint checkpoints = 1; // List of checkpoints 138 } 139 140 message StateRequest { 141 string id = 1; // container id for a single container 142 } 143 144 message ContainerState { 145 string status = 1; 146 } 147 148 message Process { 149 string pid = 1; 150 bool terminal = 2; // Use tty for container stdio 151 User user = 3; // User under which process will be run 152 repeated string args = 4; // Arguments for process, first is binary path itself 153 repeated string env = 5; // List of environment variables for process 154 string cwd = 6; // Working directory of process 155 uint32 systemPid = 7; 156 string stdin = 8; // path to the file where stdin will be read (optional) 157 string stdout = 9; // path to file where stdout will be written (optional) 158 string stderr = 10; // path to file where stderr will be written (optional) 159 repeated string capabilities = 11; 160 string apparmorProfile = 12; 161 string selinuxLabel = 13; 162 bool noNewPrivileges = 14; 163 repeated Rlimit rlimits = 15; 164 } 165 166 message Container { 167 string id = 1; // ID of container 168 string bundlePath = 2; // Path to OCI bundle 169 repeated Process processes = 3; // List of processes which run in container 170 string status = 4; // Container status ("running", "paused", etc.) 171 repeated string labels = 5; 172 repeated uint32 pids = 6; 173 string runtime = 7; // runtime used to execute the container 174 } 175 176 // Machine is information about machine on which containerd is run 177 message Machine { 178 uint32 cpus = 1; // number of cpus 179 uint64 memory = 2; // amount of memory 180 } 181 182 // StateResponse is information about containerd daemon 183 message StateResponse { 184 repeated Container containers = 1; 185 Machine machine = 2; 186 } 187 188 message UpdateContainerRequest { 189 string id = 1; // ID of container 190 string pid = 2; 191 string status = 3; // Status to which containerd will try to change 192 UpdateResource resources =4; 193 } 194 195 message UpdateResource { 196 uint64 blkioWeight = 1; 197 uint64 cpuShares = 2; 198 uint64 cpuPeriod = 3; 199 uint64 cpuQuota = 4; 200 string cpusetCpus = 5; 201 string cpusetMems = 6; 202 uint64 memoryLimit = 7; 203 uint64 memorySwap = 8; 204 uint64 memoryReservation = 9; 205 uint64 kernelMemoryLimit = 10; 206 uint64 kernelTCPMemoryLimit = 11; 207 uint64 blkioLeafWeight = 12; 208 repeated WeightDevice blkioWeightDevice = 13; 209 repeated ThrottleDevice blkioThrottleReadBpsDevice = 14; 210 repeated ThrottleDevice blkioThrottleWriteBpsDevice = 15; 211 repeated ThrottleDevice blkioThrottleReadIopsDevice = 16; 212 repeated ThrottleDevice blkioThrottleWriteIopsDevice = 17; 213 uint64 pidsLimit = 18; 214 } 215 216 message BlockIODevice { 217 int64 major = 1; 218 int64 minor = 2; 219 } 220 221 message WeightDevice { 222 BlockIODevice blkIODevice = 1; 223 uint32 weight = 2; 224 uint32 leafWeight = 3; 225 } 226 227 message ThrottleDevice { 228 BlockIODevice blkIODevice = 1; 229 uint64 rate = 2; 230 } 231 232 message UpdateContainerResponse { 233 } 234 235 message EventsRequest { 236 // Tag 1 is deprecated (old uint64 timestamp) 237 google.protobuf.Timestamp timestamp = 2; 238 bool storedOnly = 3; 239 string id = 4; 240 } 241 242 message Event { 243 string type = 1; 244 string id = 2; 245 uint32 status = 3; 246 string pid = 4; 247 // Tag 5 is deprecated (old uint64 timestamp) 248 google.protobuf.Timestamp timestamp = 6; 249 } 250 251 message NetworkStats { 252 string name = 1; // name of network interface 253 uint64 rx_bytes = 2; 254 uint64 rx_Packets = 3; 255 uint64 Rx_errors = 4; 256 uint64 Rx_dropped = 5; 257 uint64 Tx_bytes = 6; 258 uint64 Tx_packets = 7; 259 uint64 Tx_errors = 8; 260 uint64 Tx_dropped = 9; 261 } 262 263 message CpuUsage { 264 uint64 total_usage = 1; 265 repeated uint64 percpu_usage = 2; 266 uint64 usage_in_kernelmode = 3; 267 uint64 usage_in_usermode = 4; 268 } 269 270 message ThrottlingData { 271 uint64 periods = 1; 272 uint64 throttled_periods = 2; 273 uint64 throttled_time = 3; 274 } 275 276 message CpuStats { 277 CpuUsage cpu_usage = 1; 278 ThrottlingData throttling_data = 2; 279 uint64 system_usage = 3; 280 } 281 282 message PidsStats { 283 uint64 current = 1; 284 uint64 limit = 2; 285 } 286 287 message MemoryData { 288 uint64 usage = 1; 289 uint64 max_usage = 2; 290 uint64 failcnt = 3; 291 uint64 limit = 4; 292 } 293 294 message MemoryStats { 295 uint64 cache = 1; 296 MemoryData usage = 2; 297 MemoryData swap_usage = 3; 298 MemoryData kernel_usage = 4; 299 map<string, uint64> stats = 5; 300 } 301 302 message BlkioStatsEntry { 303 uint64 major = 1; 304 uint64 minor = 2; 305 string op = 3; 306 uint64 value = 4; 307 } 308 309 message BlkioStats { 310 repeated BlkioStatsEntry io_service_bytes_recursive = 1; // number of bytes transferred to and from the block device 311 repeated BlkioStatsEntry io_serviced_recursive = 2; 312 repeated BlkioStatsEntry io_queued_recursive = 3; 313 repeated BlkioStatsEntry io_service_time_recursive = 4; 314 repeated BlkioStatsEntry io_wait_time_recursive = 5; 315 repeated BlkioStatsEntry io_merged_recursive = 6; 316 repeated BlkioStatsEntry io_time_recursive = 7; 317 repeated BlkioStatsEntry sectors_recursive = 8; 318 } 319 320 message HugetlbStats { 321 uint64 usage = 1; 322 uint64 max_usage = 2; 323 uint64 failcnt = 3; 324 uint64 limit = 4; 325 } 326 327 message CgroupStats { 328 CpuStats cpu_stats = 1; 329 MemoryStats memory_stats = 2; 330 BlkioStats blkio_stats = 3; 331 map<string, HugetlbStats> hugetlb_stats = 4; // the map is in the format "size of hugepage: stats of the hugepage" 332 PidsStats pids_stats = 5; 333 } 334 335 message StatsResponse { 336 repeated NetworkStats network_stats = 1; 337 CgroupStats cgroup_stats = 2; 338 // Tag 3 is deprecated (old uint64 timestamp) 339 google.protobuf.Timestamp timestamp = 4; 340 }; 341 342 message StatsRequest { 343 string id = 1; 344 }