github.com/google/cadvisor@v0.49.1/third_party/containerd/api/services/containers/v1/containers.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.containers.v1;
    20  
    21  import weak "gogoproto/gogo.proto";
    22  import "google/protobuf/any.proto";
    23  import "google/protobuf/empty.proto";
    24  import "google/protobuf/field_mask.proto";
    25  import "google/protobuf/timestamp.proto";
    26  
    27  option go_package = "github.com/containerd/containerd/api/services/containers/v1;containers";
    28  
    29  // Containers provides metadata storage for containers used in the execution
    30  // service.
    31  //
    32  // The objects here provide an state-independent view of containers for use in
    33  // management and resource pinning. From that perspective, containers do not
    34  // have a "state" but rather this is the set of resources that will be
    35  // considered in use by the container.
    36  //
    37  // From the perspective of the execution service, these objects represent the
    38  // base parameters for creating a container process.
    39  //
    40  // In general, when looking to add fields for this type, first ask yourself
    41  // whether or not the function of the field has to do with runtime execution or
    42  // is invariant of the runtime state of the container. If it has to do with
    43  // runtime, or changes as the "container" is started and stops, it probably
    44  // doesn't belong on this object.
    45  service Containers {
    46  	rpc Get(GetContainerRequest) returns (GetContainerResponse);
    47  	rpc List(ListContainersRequest) returns (ListContainersResponse);
    48  	rpc ListStream(ListContainersRequest) returns (stream ListContainerMessage);
    49  	rpc Create(CreateContainerRequest) returns (CreateContainerResponse);
    50  	rpc Update(UpdateContainerRequest) returns (UpdateContainerResponse);
    51  	rpc Delete(DeleteContainerRequest) returns (google.protobuf.Empty);
    52  }
    53  
    54  message Container {
    55  	// ID is the user-specified identifier.
    56  	//
    57  	// This field may not be updated.
    58  	string id = 1;
    59  
    60  	// Labels provides an area to include arbitrary data on containers.
    61  	//
    62  	// The combined size of a key/value pair cannot exceed 4096 bytes.
    63  	//
    64  	// Note that to add a new value to this field, read the existing set and
    65  	// include the entire result in the update call.
    66  	map<string, string> labels  = 2;
    67  
    68  	// Image contains the reference of the image used to build the
    69  	// specification and snapshots for running this container.
    70  	//
    71  	// If this field is updated, the spec and rootfs needed to updated, as well.
    72  	string image = 3;
    73  
    74  	message Runtime {
    75  		// Name is the name of the runtime.
    76  		string name = 1;
    77  		// Options specify additional runtime initialization options.
    78  		google.protobuf.Any options = 2;
    79  	}
    80  	// Runtime specifies which runtime to use for executing this container.
    81  	Runtime runtime = 4;
    82  
    83  	// Spec to be used when creating the container. This is runtime specific.
    84  	google.protobuf.Any spec = 5;
    85  
    86  	// Snapshotter specifies the snapshotter name used for rootfs
    87  	string snapshotter = 6;
    88  
    89  	// SnapshotKey specifies the snapshot key to use for the container's root
    90  	// filesystem. When starting a task from this container, a caller should
    91  	// look up the mounts from the snapshot service and include those on the
    92  	// task create request.
    93  	//
    94  	// Snapshots referenced in this field will not be garbage collected.
    95  	//
    96  	// This field is set to empty when the rootfs is not a snapshot.
    97  	//
    98  	// This field may be updated.
    99  	string snapshot_key = 7;
   100  
   101  	// CreatedAt is the time the container was first created.
   102  	google.protobuf.Timestamp created_at = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
   103  
   104  	// UpdatedAt is the last time the container was mutated.
   105  	google.protobuf.Timestamp updated_at = 9 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
   106  
   107  	// Extensions allow clients to provide zero or more blobs that are directly
   108  	// associated with the container. One may provide protobuf, json, or other
   109  	// encoding formats. The primary use of this is to further decorate the
   110  	// container object with fields that may be specific to a client integration.
   111  	//
   112  	// The key portion of this map should identify a "name" for the extension
   113  	// that should be unique against other extensions. When updating extension
   114  	// data, one should only update the specified extension using field paths
   115  	// to select a specific map key.
   116  	map<string, google.protobuf.Any> extensions = 10 [(gogoproto.nullable) = false];
   117  }
   118  
   119  message GetContainerRequest {
   120  	string id = 1;
   121  }
   122  
   123  message GetContainerResponse {
   124  	Container container = 1 [(gogoproto.nullable) = false];
   125  }
   126  
   127  message ListContainersRequest {
   128  	// Filters contains one or more filters using the syntax defined in the
   129  	// containerd filter package.
   130  	//
   131  	// The returned result will be those that match any of the provided
   132  	// filters. Expanded, containers that match the following will be
   133  	// returned:
   134  	//
   135  	//   filters[0] or filters[1] or ... or filters[n-1] or filters[n]
   136  	//
   137  	// If filters is zero-length or nil, all items will be returned.
   138  	repeated string filters = 1;
   139  }
   140  
   141  message ListContainersResponse {
   142  	repeated Container containers = 1 [(gogoproto.nullable) = false];
   143  }
   144  
   145  message CreateContainerRequest {
   146  	Container container = 1 [(gogoproto.nullable) = false];
   147  }
   148  
   149  message CreateContainerResponse {
   150  	Container container = 1 [(gogoproto.nullable) = false];
   151  }
   152  
   153  // UpdateContainerRequest updates the metadata on one or more container.
   154  //
   155  // The operation should follow semantics described in
   156  // https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/field-mask,
   157  // unless otherwise qualified.
   158  message UpdateContainerRequest {
   159  	// Container provides the target values, as declared by the mask, for the update.
   160  	//
   161  	// The ID field must be set.
   162  	Container container = 1 [(gogoproto.nullable) = false];
   163  
   164  	// UpdateMask specifies which fields to perform the update on. If empty,
   165  	// the operation applies to all fields.
   166  	google.protobuf.FieldMask update_mask = 2;
   167  }
   168  
   169  message UpdateContainerResponse {
   170  	Container container = 1 [(gogoproto.nullable) = false];
   171  }
   172  
   173  message DeleteContainerRequest {
   174  	string id = 1;
   175  }
   176  
   177  message ListContainerMessage {
   178  	Container container = 1;
   179  }