github.com/google/cadvisor@v0.49.1/third_party/containerd/api/services/tasks/v1/tasks.proto (about)

     1  /*
     2  	Copyright The containerd Authors.
     3  
     4  	Licensed under the Apache License, Version 2.0 (the "License");
     5  	you may not use this file except in compliance with the License.
     6  	You may obtain a copy of the License at
     7  
     8  		http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  	Unless required by applicable law or agreed to in writing, software
    11  	distributed under the License is distributed on an "AS IS" BASIS,
    12  	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  	See the License for the specific language governing permissions and
    14  	limitations under the License.
    15  */
    16  
    17  syntax = "proto3";
    18  
    19  package containerd.services.tasks.v1;
    20  
    21  import "google/protobuf/empty.proto";
    22  import "google/protobuf/any.proto";
    23  import weak "gogoproto/gogo.proto";
    24  import "github.com/containerd/containerd/api/types/mount.proto";
    25  import "github.com/containerd/containerd/api/types/metrics.proto";
    26  import "github.com/containerd/containerd/api/types/descriptor.proto";
    27  import "github.com/containerd/containerd/api/types/task/task.proto";
    28  import "google/protobuf/timestamp.proto";
    29  
    30  option go_package = "github.com/containerd/containerd/api/services/tasks/v1;tasks";
    31  
    32  service Tasks {
    33  	// Create a task.
    34  	rpc Create(CreateTaskRequest) returns (CreateTaskResponse);
    35  
    36  	// Start a process.
    37  	rpc Start(StartRequest) returns (StartResponse);
    38  
    39  	// Delete a task and on disk state.
    40  	rpc Delete(DeleteTaskRequest) returns (DeleteResponse);
    41  
    42  	rpc DeleteProcess(DeleteProcessRequest) returns (DeleteResponse);
    43  
    44  	rpc Get(GetRequest) returns (GetResponse);
    45  
    46  	rpc List(ListTasksRequest) returns (ListTasksResponse);
    47  
    48  	// Kill a task or process.
    49  	rpc Kill(KillRequest) returns (google.protobuf.Empty);
    50  
    51  	rpc Exec(ExecProcessRequest) returns (google.protobuf.Empty);
    52  
    53  	rpc ResizePty(ResizePtyRequest) returns (google.protobuf.Empty);
    54  
    55  	rpc CloseIO(CloseIORequest) returns (google.protobuf.Empty);
    56  
    57  	rpc Pause(PauseTaskRequest) returns (google.protobuf.Empty);
    58  
    59  	rpc Resume(ResumeTaskRequest) returns (google.protobuf.Empty);
    60  
    61  	rpc ListPids(ListPidsRequest) returns (ListPidsResponse);
    62  
    63  	rpc Checkpoint(CheckpointTaskRequest) returns (CheckpointTaskResponse);
    64  
    65  	rpc Update(UpdateTaskRequest) returns (google.protobuf.Empty);
    66  
    67  	rpc Metrics(MetricsRequest) returns (MetricsResponse);
    68  
    69  	rpc Wait(WaitRequest) returns (WaitResponse);
    70  }
    71  
    72  message CreateTaskRequest {
    73  	string container_id = 1;
    74  
    75  	// RootFS provides the pre-chroot mounts to perform in the shim before
    76  	// executing the container task.
    77  	//
    78  	// These are for mounts that cannot be performed in the user namespace.
    79  	// Typically, these mounts should be resolved from snapshots specified on
    80  	// the container object.
    81  	repeated containerd.types.Mount rootfs = 3;
    82  
    83  	string stdin = 4;
    84  	string stdout = 5;
    85  	string stderr = 6;
    86  	bool terminal = 7;
    87  
    88  	containerd.types.Descriptor checkpoint = 8;
    89  
    90  	google.protobuf.Any options = 9;
    91  
    92  	string runtime_path = 10;
    93  }
    94  
    95  message CreateTaskResponse {
    96  	string container_id = 1;
    97  	uint32 pid = 2;
    98  }
    99  
   100  message StartRequest {
   101  	string container_id = 1;
   102  	string exec_id = 2;
   103  }
   104  
   105  message StartResponse {
   106  	uint32 pid = 1;
   107  }
   108  
   109  message DeleteTaskRequest {
   110  	string container_id = 1;
   111  }
   112  
   113  message DeleteResponse {
   114  	string id = 1;
   115  	uint32 pid = 2;
   116  	uint32 exit_status = 3;
   117  	google.protobuf.Timestamp exited_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
   118  }
   119  
   120  message DeleteProcessRequest {
   121  	string container_id = 1;
   122  	string exec_id = 2;
   123  }
   124  
   125  message GetRequest {
   126  	string container_id = 1;
   127  	string exec_id = 2;
   128  }
   129  
   130  message GetResponse {
   131  	containerd.v1.types.Process process = 1;
   132  }
   133  
   134  message ListTasksRequest {
   135  	string filter = 1;
   136  }
   137  
   138  message ListTasksResponse {
   139  	repeated containerd.v1.types.Process tasks = 1;
   140  }
   141  
   142  message KillRequest {
   143  	string container_id = 1;
   144  	string exec_id = 2;
   145  	uint32 signal = 3;
   146  	bool all = 4;
   147  }
   148  
   149  message ExecProcessRequest {
   150  	string container_id = 1;
   151  	string stdin = 2;
   152  	string stdout = 3;
   153  	string stderr = 4;
   154  	bool terminal = 5;
   155  	// Spec for starting a process in the target container.
   156  	//
   157  	// For runc, this is a process spec, for example.
   158  	google.protobuf.Any spec = 6;
   159  	// id of the exec process
   160  	string exec_id = 7;
   161  }
   162  
   163  message ExecProcessResponse {
   164  }
   165  
   166  message ResizePtyRequest {
   167  	string container_id = 1;
   168  	string exec_id = 2;
   169  	uint32 width = 3;
   170  	uint32 height = 4;
   171  }
   172  
   173  message CloseIORequest {
   174  	string container_id = 1;
   175  	string exec_id = 2;
   176  	bool stdin = 3;
   177  }
   178  
   179  message PauseTaskRequest {
   180  	string container_id = 1;
   181  }
   182  
   183  message ResumeTaskRequest {
   184  	string container_id = 1;
   185  }
   186  
   187  message ListPidsRequest {
   188  	string container_id = 1;
   189  }
   190  
   191  message ListPidsResponse {
   192  	// Processes includes the process ID and additional process information
   193  	repeated containerd.v1.types.ProcessInfo processes = 1;
   194  }
   195  
   196  message CheckpointTaskRequest {
   197  	string container_id = 1;
   198  	string parent_checkpoint = 2 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
   199  	google.protobuf.Any options = 3;
   200  }
   201  
   202  message CheckpointTaskResponse {
   203  	repeated containerd.types.Descriptor descriptors = 1;
   204  }
   205  
   206  message UpdateTaskRequest {
   207  	string container_id = 1;
   208  	google.protobuf.Any resources = 2;
   209  	map<string, string> annotations = 3;
   210  }
   211  
   212  message MetricsRequest {
   213  	repeated string filters = 1;
   214  }
   215  
   216  message MetricsResponse {
   217  	repeated types.Metric metrics = 1;
   218  }
   219  
   220  message WaitRequest {
   221  	string container_id = 1;
   222  	string exec_id = 2;
   223  }
   224  
   225  message WaitResponse {
   226  	uint32 exit_status = 1;
   227  	google.protobuf.Timestamp exited_at = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
   228  }