1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.baremetalsolution.v2; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/cloud/baremetalsolution/v2/common.proto"; 22import "google/protobuf/field_mask.proto"; 23import "google/protobuf/timestamp.proto"; 24 25option csharp_namespace = "Google.Cloud.BareMetalSolution.V2"; 26option go_package = "cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb;baremetalsolutionpb"; 27option java_multiple_files = true; 28option java_outer_classname = "VolumeProto"; 29option java_package = "com.google.cloud.baremetalsolution.v2"; 30option php_namespace = "Google\\Cloud\\BareMetalSolution\\V2"; 31option ruby_package = "Google::Cloud::BareMetalSolution::V2"; 32 33// A storage volume. 34message Volume { 35 option (google.api.resource) = { 36 type: "baremetalsolution.googleapis.com/Volume" 37 pattern: "projects/{project}/locations/{location}/volumes/{volume}" 38 }; 39 40 // The storage type for a volume. 41 enum StorageType { 42 // The storage type for this volume is unknown. 43 STORAGE_TYPE_UNSPECIFIED = 0; 44 45 // The storage type for this volume is SSD. 46 SSD = 1; 47 48 // This storage type for this volume is HDD. 49 HDD = 2; 50 } 51 52 // The possible states for a storage volume. 53 enum State { 54 // The storage volume is in an unknown state. 55 STATE_UNSPECIFIED = 0; 56 57 // The storage volume is being created. 58 CREATING = 1; 59 60 // The storage volume is ready for use. 61 READY = 2; 62 63 // The storage volume has been requested to be deleted. 64 DELETING = 3; 65 66 // The storage volume is being updated. 67 UPDATING = 4; 68 69 // The storage volume is in cool off state. It will be deleted after 70 // `expire_time`. 71 COOL_OFF = 5; 72 } 73 74 // Details about snapshot space reservation and usage on the storage volume. 75 message SnapshotReservationDetail { 76 // The space on this storage volume reserved for snapshots, shown in GiB. 77 int64 reserved_space_gib = 1; 78 79 // The percent of snapshot space on this storage volume actually being used 80 // by the snapshot copies. This value might be higher than 100% if the 81 // snapshot copies have overflowed into the data portion of the storage 82 // volume. 83 int32 reserved_space_used_percent = 2; 84 85 // The amount, in GiB, of available space in this storage volume's reserved 86 // snapshot space. 87 int64 reserved_space_remaining_gib = 3; 88 89 // Percent of the total Volume size reserved for snapshot copies. 90 // Enabling snapshots requires reserving 20% or more of 91 // the storage volume space for snapshots. Maximum reserved space for 92 // snapshots is 40%. 93 // Setting this field will effectively set snapshot_enabled to true. 94 int32 reserved_space_percent = 4; 95 } 96 97 // The kinds of auto delete behavior to use when snapshot reserved space is 98 // full. 99 enum SnapshotAutoDeleteBehavior { 100 // The unspecified behavior. 101 SNAPSHOT_AUTO_DELETE_BEHAVIOR_UNSPECIFIED = 0; 102 103 // Don't delete any snapshots. This disables new snapshot creation, as 104 // long as the snapshot reserved space is full. 105 DISABLED = 1; 106 107 // Delete the oldest snapshots first. 108 OLDEST_FIRST = 2; 109 110 // Delete the newest snapshots first. 111 NEWEST_FIRST = 3; 112 } 113 114 // Storage protocol. 115 enum Protocol { 116 // Value is not specified. 117 PROTOCOL_UNSPECIFIED = 0; 118 119 // Fibre Channel protocol. 120 FIBRE_CHANNEL = 1; 121 122 // NFS protocol means Volume is a NFS Share volume. 123 // Such volumes cannot be manipulated via Volumes API. 124 NFS = 2; 125 } 126 127 // The possible values for a workload profile. 128 enum WorkloadProfile { 129 // The workload profile is in an unknown state. 130 WORKLOAD_PROFILE_UNSPECIFIED = 0; 131 132 // The workload profile is generic. 133 GENERIC = 1; 134 135 // The workload profile is hana. 136 HANA = 2; 137 } 138 139 // Output only. The resource name of this `Volume`. 140 // Resource names are schemeless URIs that follow the conventions in 141 // https://cloud.google.com/apis/design/resource_names. 142 // Format: 143 // `projects/{project}/locations/{location}/volumes/{volume}` 144 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 145 146 // An identifier for the `Volume`, generated by the backend. 147 string id = 11; 148 149 // The storage type for this volume. 150 StorageType storage_type = 2; 151 152 // The state of this storage volume. 153 State state = 3; 154 155 // The requested size of this storage volume, in GiB. 156 int64 requested_size_gib = 4; 157 158 // Originally requested size, in GiB. 159 int64 originally_requested_size_gib = 16; 160 161 // The current size of this storage volume, in GiB, including space reserved 162 // for snapshots. This size might be different than the requested size if the 163 // storage volume has been configured with auto grow or auto shrink. 164 int64 current_size_gib = 5; 165 166 // Additional emergency size that was requested for this Volume, in GiB. 167 // current_size_gib includes this value. 168 int64 emergency_size_gib = 14; 169 170 // Maximum size volume can be expanded to in case of evergency, in GiB. 171 int64 max_size_gib = 17; 172 173 // The size, in GiB, that this storage volume has expanded as a result of an 174 // auto grow policy. In the absence of auto-grow, the value is 0. 175 int64 auto_grown_size_gib = 6; 176 177 // The space remaining in the storage volume for new LUNs, in GiB, excluding 178 // space reserved for snapshots. 179 int64 remaining_space_gib = 7; 180 181 // Details about snapshot space reservation and usage on the storage volume. 182 SnapshotReservationDetail snapshot_reservation_detail = 8; 183 184 // The behavior to use when snapshot reserved space is full. 185 SnapshotAutoDeleteBehavior snapshot_auto_delete_behavior = 9; 186 187 // Labels as key value pairs. 188 map<string, string> labels = 12; 189 190 // Whether snapshots are enabled. 191 bool snapshot_enabled = 13; 192 193 // Immutable. Pod name. 194 string pod = 15 [(google.api.field_behavior) = IMMUTABLE]; 195 196 // Output only. Storage protocol for the Volume. 197 Protocol protocol = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; 198 199 // Output only. Whether this volume is a boot volume. A boot volume is one 200 // which contains a boot LUN. 201 bool boot_volume = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; 202 203 // Immutable. Performance tier of the Volume. 204 // Default is SHARED. 205 VolumePerformanceTier performance_tier = 20 206 [(google.api.field_behavior) = IMMUTABLE]; 207 208 // Input only. User-specified notes for new Volume. 209 // Used to provision Volumes that require manual intervention. 210 string notes = 21 [(google.api.field_behavior) = INPUT_ONLY]; 211 212 // The workload profile for the volume. 213 WorkloadProfile workload_profile = 22; 214 215 // Output only. Time after which volume will be fully deleted. 216 // It is filled only for volumes in COOLOFF state. 217 google.protobuf.Timestamp expire_time = 24 218 [(google.api.field_behavior) = OUTPUT_ONLY]; 219 220 // Output only. Instances this Volume is attached to. 221 // This field is set only in Get requests. 222 repeated string instances = 25 [ 223 (google.api.field_behavior) = OUTPUT_ONLY, 224 (google.api.resource_reference) = { 225 type: "baremetalsolution.googleapis.com/Instance" 226 } 227 ]; 228 229 // Output only. Is the Volume attached at at least one instance. 230 // This field is a lightweight counterpart of `instances` field. 231 // It is filled in List responses as well. 232 bool attached = 26 [(google.api.field_behavior) = OUTPUT_ONLY]; 233} 234 235// Message for requesting storage volume information. 236message GetVolumeRequest { 237 // Required. Name of the resource. 238 string name = 1 [ 239 (google.api.field_behavior) = REQUIRED, 240 (google.api.resource_reference) = { 241 type: "baremetalsolution.googleapis.com/Volume" 242 } 243 ]; 244} 245 246// Message for requesting a list of storage volumes. 247message ListVolumesRequest { 248 // Required. Parent value for ListVolumesRequest. 249 string parent = 1 [ 250 (google.api.field_behavior) = REQUIRED, 251 (google.api.resource_reference) = { 252 type: "locations.googleapis.com/Location" 253 } 254 ]; 255 256 // Requested page size. The server might return fewer items than requested. 257 // If unspecified, server will pick an appropriate default. 258 int32 page_size = 2; 259 260 // A token identifying a page of results from the server. 261 string page_token = 3; 262 263 // List filter. 264 string filter = 4; 265} 266 267// Response message containing the list of storage volumes. 268message ListVolumesResponse { 269 // The list of storage volumes. 270 repeated Volume volumes = 1; 271 272 // A token identifying a page of results from the server. 273 string next_page_token = 2; 274 275 // Locations that could not be reached. 276 repeated string unreachable = 3; 277} 278 279// Message for updating a volume. 280message UpdateVolumeRequest { 281 // Required. The volume to update. 282 // 283 // The `name` field is used to identify the volume to update. 284 // Format: projects/{project}/locations/{location}/volumes/{volume} 285 Volume volume = 1 [(google.api.field_behavior) = REQUIRED]; 286 287 // The list of fields to update. 288 // The only currently supported fields are: 289 // 'labels' 290 google.protobuf.FieldMask update_mask = 2; 291} 292 293// Message requesting rename of a server. 294message RenameVolumeRequest { 295 // Required. The `name` field is used to identify the volume. 296 // Format: projects/{project}/locations/{location}/volumes/{volume} 297 string name = 1 [ 298 (google.api.field_behavior) = REQUIRED, 299 (google.api.resource_reference) = { 300 type: "baremetalsolution.googleapis.com/Volume" 301 } 302 ]; 303 304 // Required. The new `id` of the volume. 305 string new_volume_id = 2 [(google.api.field_behavior) = REQUIRED]; 306} 307 308// Request for skip volume cooloff and delete it. 309message EvictVolumeRequest { 310 // Required. The name of the Volume. 311 string name = 1 [ 312 (google.api.field_behavior) = REQUIRED, 313 (google.api.resource_reference) = { 314 type: "baremetalsolution.googleapis.com/Volume" 315 } 316 ]; 317} 318 319// Request for emergency resize Volume. 320message ResizeVolumeRequest { 321 // Required. Volume to resize. 322 string volume = 1 [ 323 (google.api.field_behavior) = REQUIRED, 324 (google.api.resource_reference) = { 325 type: "baremetalsolution.googleapis.com/Volume" 326 } 327 ]; 328 329 // New Volume size, in GiB. 330 int64 size_gib = 2; 331} 332