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