github.com/google/cadvisor@v0.49.1/third_party/containerd/api/services/images/v1/images.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.images.v1; 20 21 import weak "gogoproto/gogo.proto"; 22 import "google/protobuf/empty.proto"; 23 import "google/protobuf/field_mask.proto"; 24 import "google/protobuf/timestamp.proto"; 25 import "github.com/containerd/containerd/api/types/descriptor.proto"; 26 27 option go_package = "github.com/containerd/containerd/api/services/images/v1;images"; 28 29 // Images is a service that allows one to register images with containerd. 30 // 31 // In containerd, an image is merely the mapping of a name to a content root, 32 // described by a descriptor. The behavior and state of image is purely 33 // dictated by the type of the descriptor. 34 // 35 // From the perspective of this service, these references are mostly shallow, 36 // in that the existence of the required content won't be validated until 37 // required by consuming services. 38 // 39 // As such, this can really be considered a "metadata service". 40 service Images { 41 // Get returns an image by name. 42 rpc Get(GetImageRequest) returns (GetImageResponse); 43 44 // List returns a list of all images known to containerd. 45 rpc List(ListImagesRequest) returns (ListImagesResponse); 46 47 // Create an image record in the metadata store. 48 // 49 // The name of the image must be unique. 50 rpc Create(CreateImageRequest) returns (CreateImageResponse); 51 52 // Update assigns the name to a given target image based on the provided 53 // image. 54 rpc Update(UpdateImageRequest) returns (UpdateImageResponse); 55 56 // Delete deletes the image by name. 57 rpc Delete(DeleteImageRequest) returns (google.protobuf.Empty); 58 } 59 60 message Image { 61 // Name provides a unique name for the image. 62 // 63 // Containerd treats this as the primary identifier. 64 string name = 1; 65 66 // Labels provides free form labels for the image. These are runtime only 67 // and do not get inherited into the package image in any way. 68 // 69 // Labels may be updated using the field mask. 70 // The combined size of a key/value pair cannot exceed 4096 bytes. 71 map<string, string> labels = 2; 72 73 // Target describes the content entry point of the image. 74 containerd.types.Descriptor target = 3 [(gogoproto.nullable) = false]; 75 76 // CreatedAt is the time the image was first created. 77 google.protobuf.Timestamp created_at = 7 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; 78 79 // UpdatedAt is the last time the image was mutated. 80 google.protobuf.Timestamp updated_at = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; 81 } 82 83 message GetImageRequest { 84 string name = 1; 85 } 86 87 message GetImageResponse { 88 Image image = 1; 89 } 90 91 message CreateImageRequest { 92 Image image = 1 [(gogoproto.nullable) = false]; 93 } 94 95 message CreateImageResponse { 96 Image image = 1 [(gogoproto.nullable) = false]; 97 } 98 99 message UpdateImageRequest { 100 // Image provides a full or partial image for update. 101 // 102 // The name field must be set or an error will be returned. 103 Image image = 1 [(gogoproto.nullable) = false]; 104 105 // UpdateMask specifies which fields to perform the update on. If empty, 106 // the operation applies to all fields. 107 google.protobuf.FieldMask update_mask = 2; 108 } 109 110 message UpdateImageResponse { 111 Image image = 1 [(gogoproto.nullable) = false]; 112 } 113 114 message ListImagesRequest { 115 // Filters contains one or more filters using the syntax defined in the 116 // containerd filter package. 117 // 118 // The returned result will be those that match any of the provided 119 // filters. Expanded, images that match the following will be 120 // returned: 121 // 122 // filters[0] or filters[1] or ... or filters[n-1] or filters[n] 123 // 124 // If filters is zero-length or nil, all items will be returned. 125 repeated string filters = 1; 126 } 127 128 message ListImagesResponse { 129 repeated Image images = 1 [(gogoproto.nullable) = false]; 130 } 131 132 message DeleteImageRequest { 133 string name = 1; 134 135 // Sync indicates that the delete and cleanup should be done 136 // synchronously before returning to the caller 137 // 138 // Default is false 139 bool sync = 2; 140 }