github.com/google/cadvisor@v0.49.1/third_party/containerd/api/services/snapshots/v1/snapshots.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.snapshots.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/mount.proto"; 26 27 option go_package = "github.com/containerd/containerd/api/services/snapshots/v1;snapshots"; 28 29 // Snapshot service manages snapshots 30 service Snapshots { 31 rpc Prepare(PrepareSnapshotRequest) returns (PrepareSnapshotResponse); 32 rpc View(ViewSnapshotRequest) returns (ViewSnapshotResponse); 33 rpc Mounts(MountsRequest) returns (MountsResponse); 34 rpc Commit(CommitSnapshotRequest) returns (google.protobuf.Empty); 35 rpc Remove(RemoveSnapshotRequest) returns (google.protobuf.Empty); 36 rpc Stat(StatSnapshotRequest) returns (StatSnapshotResponse); 37 rpc Update(UpdateSnapshotRequest) returns (UpdateSnapshotResponse); 38 rpc List(ListSnapshotsRequest) returns (stream ListSnapshotsResponse); 39 rpc Usage(UsageRequest) returns (UsageResponse); 40 rpc Cleanup(CleanupRequest) returns (google.protobuf.Empty); 41 } 42 43 message PrepareSnapshotRequest { 44 string snapshotter = 1; 45 string key = 2; 46 string parent = 3; 47 48 // Labels are arbitrary data on snapshots. 49 // 50 // The combined size of a key/value pair cannot exceed 4096 bytes. 51 map<string, string> labels = 4; 52 } 53 54 message PrepareSnapshotResponse { 55 repeated containerd.types.Mount mounts = 1; 56 } 57 58 message ViewSnapshotRequest { 59 string snapshotter = 1; 60 string key = 2; 61 string parent = 3; 62 63 // Labels are arbitrary data on snapshots. 64 // 65 // The combined size of a key/value pair cannot exceed 4096 bytes. 66 map<string, string> labels = 4; 67 } 68 69 message ViewSnapshotResponse { 70 repeated containerd.types.Mount mounts = 1; 71 } 72 73 message MountsRequest { 74 string snapshotter = 1; 75 string key = 2; 76 } 77 78 message MountsResponse { 79 repeated containerd.types.Mount mounts = 1; 80 } 81 82 message RemoveSnapshotRequest { 83 string snapshotter = 1; 84 string key = 2; 85 } 86 87 message CommitSnapshotRequest { 88 string snapshotter = 1; 89 string name = 2; 90 string key = 3; 91 92 // Labels are arbitrary data on snapshots. 93 // 94 // The combined size of a key/value pair cannot exceed 4096 bytes. 95 map<string, string> labels = 4; 96 } 97 98 message StatSnapshotRequest { 99 string snapshotter = 1; 100 string key = 2; 101 } 102 103 enum Kind { 104 option (gogoproto.goproto_enum_prefix) = false; 105 option (gogoproto.enum_customname) = "Kind"; 106 107 UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "KindUnknown"]; 108 VIEW = 1 [(gogoproto.enumvalue_customname) = "KindView"]; 109 ACTIVE = 2 [(gogoproto.enumvalue_customname) = "KindActive"]; 110 COMMITTED = 3 [(gogoproto.enumvalue_customname) = "KindCommitted"]; 111 } 112 113 message Info { 114 string name = 1; 115 string parent = 2; 116 Kind kind = 3; 117 118 // CreatedAt provides the time at which the snapshot was created. 119 google.protobuf.Timestamp created_at = 4 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; 120 121 // UpdatedAt provides the time the info was last updated. 122 google.protobuf.Timestamp updated_at = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; 123 124 // Labels are arbitrary data on snapshots. 125 // 126 // The combined size of a key/value pair cannot exceed 4096 bytes. 127 map<string, string> labels = 6; 128 } 129 130 message StatSnapshotResponse { 131 Info info = 1 [(gogoproto.nullable) = false]; 132 } 133 134 message UpdateSnapshotRequest { 135 string snapshotter = 1; 136 Info info = 2 [(gogoproto.nullable) = false]; 137 138 // UpdateMask specifies which fields to perform the update on. If empty, 139 // the operation applies to all fields. 140 // 141 // In info, Name, Parent, Kind, Created are immutable, 142 // other field may be updated using this mask. 143 // If no mask is provided, all mutable field are updated. 144 google.protobuf.FieldMask update_mask = 3; 145 } 146 147 message UpdateSnapshotResponse { 148 Info info = 1 [(gogoproto.nullable) = false]; 149 } 150 151 message ListSnapshotsRequest{ 152 string snapshotter = 1; 153 154 // Filters contains one or more filters using the syntax defined in the 155 // containerd filter package. 156 // 157 // The returned result will be those that match any of the provided 158 // filters. Expanded, images that match the following will be 159 // returned: 160 // 161 // filters[0] or filters[1] or ... or filters[n-1] or filters[n] 162 // 163 // If filters is zero-length or nil, all items will be returned. 164 repeated string filters = 2; 165 } 166 167 message ListSnapshotsResponse { 168 repeated Info info = 1 [(gogoproto.nullable) = false]; 169 } 170 171 message UsageRequest { 172 string snapshotter = 1; 173 string key = 2; 174 } 175 176 message UsageResponse { 177 int64 size = 1; 178 int64 inodes = 2; 179 } 180 181 message CleanupRequest { 182 string snapshotter = 1; 183 }