github.com/runcom/containerd@v0.0.0-20160708090337-9bff9f934c0d/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 whcih 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 } 215 216 message Event { 217 string type = 1; 218 string id = 2; 219 uint32 status = 3; 220 string pid = 4; 221 // Tag 5 is deprecated (old uint64 timestamp) 222 google.protobuf.Timestamp timestamp = 6; 223 } 224 225 message NetworkStats { 226 string name = 1; // name of network interface 227 uint64 rx_bytes = 2; 228 uint64 rx_Packets = 3; 229 uint64 Rx_errors = 4; 230 uint64 Rx_dropped = 5; 231 uint64 Tx_bytes = 6; 232 uint64 Tx_packets = 7; 233 uint64 Tx_errors = 8; 234 uint64 Tx_dropped = 9; 235 } 236 237 message CpuUsage { 238 uint64 total_usage = 1; 239 repeated uint64 percpu_usage = 2; 240 uint64 usage_in_kernelmode = 3; 241 uint64 usage_in_usermode = 4; 242 } 243 244 message ThrottlingData { 245 uint64 periods = 1; 246 uint64 throttled_periods = 2; 247 uint64 throttled_time = 3; 248 } 249 250 message CpuStats { 251 CpuUsage cpu_usage = 1; 252 ThrottlingData throttling_data = 2; 253 uint64 system_usage = 3; 254 } 255 256 message PidsStats { 257 uint64 current = 1; 258 uint64 limit = 2; 259 } 260 261 message MemoryData { 262 uint64 usage = 1; 263 uint64 max_usage = 2; 264 uint64 failcnt = 3; 265 uint64 limit = 4; 266 } 267 268 message MemoryStats { 269 uint64 cache = 1; 270 MemoryData usage = 2; 271 MemoryData swap_usage = 3; 272 MemoryData kernel_usage = 4; 273 map<string, uint64> stats = 5; 274 } 275 276 message BlkioStatsEntry { 277 uint64 major = 1; 278 uint64 minor = 2; 279 string op = 3; 280 uint64 value = 4; 281 } 282 283 message BlkioStats { 284 repeated BlkioStatsEntry io_service_bytes_recursive = 1; // number of bytes tranferred to and from the block device 285 repeated BlkioStatsEntry io_serviced_recursive = 2; 286 repeated BlkioStatsEntry io_queued_recursive = 3; 287 repeated BlkioStatsEntry io_service_time_recursive = 4; 288 repeated BlkioStatsEntry io_wait_time_recursive = 5; 289 repeated BlkioStatsEntry io_merged_recursive = 6; 290 repeated BlkioStatsEntry io_time_recursive = 7; 291 repeated BlkioStatsEntry sectors_recursive = 8; 292 } 293 294 message HugetlbStats { 295 uint64 usage = 1; 296 uint64 max_usage = 2; 297 uint64 failcnt = 3; 298 uint64 limit = 4; 299 } 300 301 message CgroupStats { 302 CpuStats cpu_stats = 1; 303 MemoryStats memory_stats = 2; 304 BlkioStats blkio_stats = 3; 305 map<string, HugetlbStats> hugetlb_stats = 4; // the map is in the format "size of hugepage: stats of the hugepage" 306 PidsStats pids_stats = 5; 307 } 308 309 message StatsResponse { 310 repeated NetworkStats network_stats = 1; 311 CgroupStats cgroup_stats = 2; 312 // Tag 3 is deprecated (old uint64 timestamp) 313 google.protobuf.Timestamp timestamp = 4; 314 }; 315 316 message StatsRequest { 317 string id = 1; 318 }