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