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.netapp.v1; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/cloud/netapp/v1/common.proto"; 22import "google/protobuf/field_mask.proto"; 23import "google/protobuf/timestamp.proto"; 24 25option csharp_namespace = "Google.Cloud.NetApp.V1"; 26option go_package = "cloud.google.com/go/netapp/apiv1/netapppb;netapppb"; 27option java_multiple_files = true; 28option java_outer_classname = "VolumeProto"; 29option java_package = "com.google.cloud.netapp.v1"; 30option php_namespace = "Google\\Cloud\\NetApp\\V1"; 31option ruby_package = "Google::Cloud::NetApp::V1"; 32 33// Protocols is an enum of all the supported network protocols for a volume. 34enum Protocols { 35 // Unspecified protocol 36 PROTOCOLS_UNSPECIFIED = 0; 37 38 // NFS V3 protocol 39 NFSV3 = 1; 40 41 // NFS V4 protocol 42 NFSV4 = 2; 43 44 // SMB protocol 45 SMB = 3; 46} 47 48// AccessType is an enum of all the supported access types for a volume. 49enum AccessType { 50 // Unspecified Access Type 51 ACCESS_TYPE_UNSPECIFIED = 0; 52 53 // Read Only 54 READ_ONLY = 1; 55 56 // Read Write 57 READ_WRITE = 2; 58 59 // None 60 READ_NONE = 3; 61} 62 63// SMBSettings 64// Modifies the behaviour of a SMB volume. 65enum SMBSettings { 66 // Unspecified default option 67 SMB_SETTINGS_UNSPECIFIED = 0; 68 69 // SMB setting encrypt data 70 ENCRYPT_DATA = 1; 71 72 // SMB setting browsable 73 BROWSABLE = 2; 74 75 // SMB setting notify change 76 CHANGE_NOTIFY = 3; 77 78 // SMB setting not to notify change 79 NON_BROWSABLE = 4; 80 81 // SMB setting oplocks 82 OPLOCKS = 5; 83 84 // SMB setting to show snapshots 85 SHOW_SNAPSHOT = 6; 86 87 // SMB setting to show previous versions 88 SHOW_PREVIOUS_VERSIONS = 7; 89 90 // SMB setting to access volume based on enumerartion 91 ACCESS_BASED_ENUMERATION = 8; 92 93 // Continuously available enumeration 94 CONTINUOUSLY_AVAILABLE = 9; 95} 96 97// The security style of the volume, can be either UNIX or NTFS. 98enum SecurityStyle { 99 // SecurityStyle is unspecified 100 SECURITY_STYLE_UNSPECIFIED = 0; 101 102 // SecurityStyle uses NTFS 103 NTFS = 1; 104 105 // SecurityStyle uses UNIX 106 UNIX = 2; 107} 108 109// Actions to be restricted for a volume. 110enum RestrictedAction { 111 // Unspecified restricted action 112 RESTRICTED_ACTION_UNSPECIFIED = 0; 113 114 // Prevent volume from being deleted when mounted. 115 DELETE = 1; 116} 117 118// Message for requesting list of Volumes 119message ListVolumesRequest { 120 // Required. Parent value for ListVolumesRequest 121 string parent = 1 [ 122 (google.api.field_behavior) = REQUIRED, 123 (google.api.resource_reference) = { 124 child_type: "netapp.googleapis.com/Volume" 125 } 126 ]; 127 128 // Requested page size. Server may return fewer items than requested. 129 // If unspecified, the server will pick an appropriate default. 130 int32 page_size = 2; 131 132 // A token identifying a page of results the server should return. 133 string page_token = 3; 134 135 // Filtering results 136 string filter = 4; 137 138 // Hint for how to order the results 139 string order_by = 5; 140} 141 142// Message for response to listing Volumes 143message ListVolumesResponse { 144 // The list of Volume 145 repeated Volume volumes = 1; 146 147 // A token identifying a page of results the server should return. 148 string next_page_token = 2; 149 150 // Locations that could not be reached. 151 repeated string unreachable = 3; 152} 153 154// Message for getting a Volume 155message GetVolumeRequest { 156 // Required. Name of the volume 157 string name = 1 [ 158 (google.api.field_behavior) = REQUIRED, 159 (google.api.resource_reference) = { type: "netapp.googleapis.com/Volume" } 160 ]; 161} 162 163// Message for creating a Volume 164message CreateVolumeRequest { 165 // Required. Value for parent. 166 string parent = 1 [ 167 (google.api.field_behavior) = REQUIRED, 168 (google.api.resource_reference) = { 169 child_type: "netapp.googleapis.com/Volume" 170 } 171 ]; 172 173 // Required. Id of the requesting volume 174 // If auto-generating Id server-side, remove this field and 175 // Id from the method_signature of Create RPC 176 string volume_id = 2 [(google.api.field_behavior) = REQUIRED]; 177 178 // Required. The volume being created. 179 Volume volume = 3 [(google.api.field_behavior) = REQUIRED]; 180} 181 182// Message for updating a Volume 183message UpdateVolumeRequest { 184 // Required. Field mask is used to specify the fields to be overwritten in the 185 // Volume resource by the update. 186 // The fields specified in the update_mask are relative to the resource, not 187 // the full request. A field will be overwritten if it is in the mask. If the 188 // user does not provide a mask then all fields will be overwritten. 189 google.protobuf.FieldMask update_mask = 1 190 [(google.api.field_behavior) = REQUIRED]; 191 192 // Required. The volume being updated 193 Volume volume = 2 [(google.api.field_behavior) = REQUIRED]; 194} 195 196// Message for deleting a Volume 197message DeleteVolumeRequest { 198 // Required. Name of the volume 199 string name = 1 [ 200 (google.api.field_behavior) = REQUIRED, 201 (google.api.resource_reference) = { type: "netapp.googleapis.com/Volume" } 202 ]; 203 204 // If this field is set as true, CCFE will not block the volume resource 205 // deletion even if it has any snapshots resource. (Otherwise, the request 206 // will only work if the volume has no snapshots.) 207 bool force = 2; 208} 209 210// RevertVolumeRequest reverts the given volume to the specified snapshot. 211message RevertVolumeRequest { 212 // Required. The resource name of the volume, in the format of 213 // projects/{project_id}/locations/{location}/volumes/{volume_id}. 214 string name = 1 [ 215 (google.api.field_behavior) = REQUIRED, 216 (google.api.resource_reference) = { type: "netapp.googleapis.com/Volume" } 217 ]; 218 219 // Required. The snapshot resource ID, in the format 'my-snapshot', where the 220 // specified ID is the {snapshot_id} of the fully qualified name like 221 // projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id} 222 string snapshot_id = 2 [(google.api.field_behavior) = REQUIRED]; 223} 224 225// Volume provides a filesystem that you can mount. 226message Volume { 227 option (google.api.resource) = { 228 type: "netapp.googleapis.com/Volume" 229 pattern: "projects/{project}/locations/{location}/volumes/{volume}" 230 plural: "volumes" 231 singular: "volume" 232 }; 233 234 // The volume states 235 enum State { 236 // Unspecified Volume State 237 STATE_UNSPECIFIED = 0; 238 239 // Volume State is Ready 240 READY = 1; 241 242 // Volume State is Creating 243 CREATING = 2; 244 245 // Volume State is Deleting 246 DELETING = 3; 247 248 // Volume State is Updating 249 UPDATING = 4; 250 251 // Volume State is Restoring 252 RESTORING = 5; 253 254 // Volume State is Disabled 255 DISABLED = 6; 256 257 // Volume State is Error 258 ERROR = 7; 259 } 260 261 // Identifier. Name of the volume 262 string name = 1 [(google.api.field_behavior) = IDENTIFIER]; 263 264 // Output only. State of the volume 265 State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 266 267 // Output only. State details of the volume 268 string state_details = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 269 270 // Output only. Create time of the volume 271 google.protobuf.Timestamp create_time = 4 272 [(google.api.field_behavior) = OUTPUT_ONLY]; 273 274 // Required. Share name of the volume 275 string share_name = 5 [(google.api.field_behavior) = REQUIRED]; 276 277 // Output only. This field is not implemented. The values provided in this 278 // field are ignored. 279 string psa_range = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 280 281 // Required. StoragePool name of the volume 282 string storage_pool = 7 [ 283 (google.api.field_behavior) = REQUIRED, 284 (google.api.resource_reference) = { 285 type: "netapp.googleapis.com/StoragePool" 286 } 287 ]; 288 289 // Output only. VPC Network name. 290 // Format: projects/{project}/global/networks/{network} 291 string network = 8 [ 292 (google.api.field_behavior) = OUTPUT_ONLY, 293 (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } 294 ]; 295 296 // Output only. Service level of the volume 297 ServiceLevel service_level = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; 298 299 // Required. Capacity in GIB of the volume 300 int64 capacity_gib = 10 [(google.api.field_behavior) = REQUIRED]; 301 302 // Optional. Export policy of the volume 303 ExportPolicy export_policy = 11 [(google.api.field_behavior) = OPTIONAL]; 304 305 // Required. Protocols required for the volume 306 repeated Protocols protocols = 12 [(google.api.field_behavior) = REQUIRED]; 307 308 // Optional. SMB share settings for the volume. 309 repeated SMBSettings smb_settings = 13 310 [(google.api.field_behavior) = OPTIONAL]; 311 312 // Output only. Mount options of this volume 313 repeated MountOption mount_options = 14 314 [(google.api.field_behavior) = OUTPUT_ONLY]; 315 316 // Optional. Default unix style permission (e.g. 777) the mount point will be 317 // created with. Applicable for NFS protocol types only. 318 string unix_permissions = 15 [(google.api.field_behavior) = OPTIONAL]; 319 320 // Optional. Labels as key value pairs 321 map<string, string> labels = 16 [(google.api.field_behavior) = OPTIONAL]; 322 323 // Optional. Description of the volume 324 string description = 17 [(google.api.field_behavior) = OPTIONAL]; 325 326 // Optional. SnapshotPolicy for a volume. 327 SnapshotPolicy snapshot_policy = 18 [(google.api.field_behavior) = OPTIONAL]; 328 329 // Optional. Snap_reserve specifies percentage of volume storage reserved for 330 // snapshot storage. Default is 0 percent. 331 double snap_reserve = 19 [(google.api.field_behavior) = OPTIONAL]; 332 333 // Optional. Snapshot_directory if enabled (true) the volume will contain a 334 // read-only .snapshot directory which provides access to each of the volume's 335 // snapshots. 336 bool snapshot_directory = 20 [(google.api.field_behavior) = OPTIONAL]; 337 338 // Output only. Used capacity in GIB of the volume. This is computed 339 // periodically and it does not represent the realtime usage. 340 int64 used_gib = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; 341 342 // Optional. Security Style of the Volume 343 SecurityStyle security_style = 22 [(google.api.field_behavior) = OPTIONAL]; 344 345 // Optional. Flag indicating if the volume is a kerberos volume or not, export 346 // policy rules control kerberos security modes (krb5, krb5i, krb5p). 347 bool kerberos_enabled = 23 [(google.api.field_behavior) = OPTIONAL]; 348 349 // Output only. Flag indicating if the volume is NFS LDAP enabled or not. 350 bool ldap_enabled = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; 351 352 // Output only. Specifies the ActiveDirectory name of a SMB volume. 353 string active_directory = 25 [ 354 (google.api.field_behavior) = OUTPUT_ONLY, 355 (google.api.resource_reference) = { 356 type: "netapp.googleapis.com/ActiveDirectory" 357 } 358 ]; 359 360 // Optional. Specifies the source of the volume to be created from. 361 RestoreParameters restore_parameters = 26 362 [(google.api.field_behavior) = OPTIONAL]; 363 364 // Output only. Specifies the KMS config to be used for volume encryption. 365 string kms_config = 27 [ 366 (google.api.field_behavior) = OUTPUT_ONLY, 367 (google.api.resource_reference) = { 368 type: "netapp.googleapis.com/KmsConfig" 369 } 370 ]; 371 372 // Output only. Specified the current volume encryption key source. 373 EncryptionType encryption_type = 28 374 [(google.api.field_behavior) = OUTPUT_ONLY]; 375 376 // Output only. Indicates whether the volume is part of a replication 377 // relationship. 378 bool has_replication = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; 379 380 // BackupConfig of the volume. 381 optional BackupConfig backup_config = 30; 382 383 // Optional. List of actions that are restricted on this volume. 384 repeated RestrictedAction restricted_actions = 31 385 [(google.api.field_behavior) = OPTIONAL]; 386} 387 388// Defines the export policy for the volume. 389message ExportPolicy { 390 // Required. List of export policy rules 391 repeated SimpleExportPolicyRule rules = 1 392 [(google.api.field_behavior) = REQUIRED]; 393} 394 395// An export policy rule describing various export options. 396message SimpleExportPolicyRule { 397 // Comma separated list of allowed clients IP addresses 398 optional string allowed_clients = 1; 399 400 // Whether Unix root access will be granted. 401 optional string has_root_access = 2; 402 403 // Access type (ReadWrite, ReadOnly, None) 404 optional AccessType access_type = 3; 405 406 // NFS V3 protocol. 407 optional bool nfsv3 = 4; 408 409 // NFS V4 protocol. 410 optional bool nfsv4 = 5; 411 412 // If enabled (true) the rule defines a read only access for clients matching 413 // the 'allowedClients' specification. It enables nfs clients to mount using 414 // 'authentication' kerberos security mode. 415 optional bool kerberos_5_read_only = 6; 416 417 // If enabled (true) the rule defines read and write access for clients 418 // matching the 'allowedClients' specification. It enables nfs clients to 419 // mount using 'authentication' kerberos security mode. The 420 // 'kerberos5ReadOnly' value be ignored if this is enabled. 421 optional bool kerberos_5_read_write = 7; 422 423 // If enabled (true) the rule defines a read only access for clients matching 424 // the 'allowedClients' specification. It enables nfs clients to mount using 425 // 'integrity' kerberos security mode. 426 optional bool kerberos_5i_read_only = 8; 427 428 // If enabled (true) the rule defines read and write access for clients 429 // matching the 'allowedClients' specification. It enables nfs clients to 430 // mount using 'integrity' kerberos security mode. The 'kerberos5iReadOnly' 431 // value be ignored if this is enabled. 432 optional bool kerberos_5i_read_write = 9; 433 434 // If enabled (true) the rule defines a read only access for clients matching 435 // the 'allowedClients' specification. It enables nfs clients to mount using 436 // 'privacy' kerberos security mode. 437 optional bool kerberos_5p_read_only = 10; 438 439 // If enabled (true) the rule defines read and write access for clients 440 // matching the 'allowedClients' specification. It enables nfs clients to 441 // mount using 'privacy' kerberos security mode. The 'kerberos5pReadOnly' 442 // value be ignored if this is enabled. 443 optional bool kerberos_5p_read_write = 11; 444} 445 446// Snapshot Policy for a volume. 447message SnapshotPolicy { 448 // If enabled, make snapshots automatically according to the schedules. 449 // Default is false. 450 optional bool enabled = 1; 451 452 // Hourly schedule policy. 453 optional HourlySchedule hourly_schedule = 2; 454 455 // Daily schedule policy. 456 optional DailySchedule daily_schedule = 3; 457 458 // Weekly schedule policy. 459 optional WeeklySchedule weekly_schedule = 4; 460 461 // Monthly schedule policy. 462 optional MonthlySchedule monthly_schedule = 5; 463} 464 465// Make a snapshot every hour e.g. at 04:00, 05:00, 06:00. 466message HourlySchedule { 467 // The maximum number of Snapshots to keep for the hourly schedule 468 optional double snapshots_to_keep = 1; 469 470 // Set the minute of the hour to start the snapshot (0-59), defaults to the 471 // top of the hour (0). 472 optional double minute = 2; 473} 474 475// Make a snapshot every day e.g. at 04:00, 05:20, 23:50 476message DailySchedule { 477 // The maximum number of Snapshots to keep for the hourly schedule 478 optional double snapshots_to_keep = 1; 479 480 // Set the minute of the hour to start the snapshot (0-59), defaults to the 481 // top of the hour (0). 482 optional double minute = 2; 483 484 // Set the hour to start the snapshot (0-23), defaults to midnight (0). 485 optional double hour = 3; 486} 487 488// Make a snapshot every week e.g. at Monday 04:00, Wednesday 05:20, Sunday 489// 23:50 490message WeeklySchedule { 491 // The maximum number of Snapshots to keep for the hourly schedule 492 optional double snapshots_to_keep = 1; 493 494 // Set the minute of the hour to start the snapshot (0-59), defaults to the 495 // top of the hour (0). 496 optional double minute = 2; 497 498 // Set the hour to start the snapshot (0-23), defaults to midnight (0). 499 optional double hour = 3; 500 501 // Set the day or days of the week to make a snapshot. Accepts a comma 502 // separated days of the week. Defaults to 'Sunday'. 503 optional string day = 4; 504} 505 506// Make a snapshot once a month e.g. at 2nd 04:00, 7th 05:20, 24th 23:50 507message MonthlySchedule { 508 // The maximum number of Snapshots to keep for the hourly schedule 509 optional double snapshots_to_keep = 1; 510 511 // Set the minute of the hour to start the snapshot (0-59), defaults to the 512 // top of the hour (0). 513 optional double minute = 2; 514 515 // Set the hour to start the snapshot (0-23), defaults to midnight (0). 516 optional double hour = 3; 517 518 // Set the day or days of the month to make a snapshot (1-31). Accepts a 519 // comma separated number of days. Defaults to '1'. 520 optional string days_of_month = 4; 521} 522 523// View only mount options for a volume. 524message MountOption { 525 // Export string 526 string export = 1; 527 528 // Full export string 529 string export_full = 2; 530 531 // Protocol to mount with. 532 Protocols protocol = 3; 533 534 // Instructions for mounting 535 string instructions = 4; 536} 537 538// The RestoreParameters if volume is created from a snapshot or backup. 539message RestoreParameters { 540 // The source that the volume is created from. 541 oneof source { 542 // Full name of the snapshot resource. 543 // Format: 544 // projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot} 545 string source_snapshot = 1; 546 547 // Full name of the backup resource. 548 // Format: 549 // projects/{project}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id} 550 string source_backup = 2; 551 } 552} 553 554// BackupConfig contains backup related config on a volume. 555message BackupConfig { 556 // Optional. When specified, schedule backups will be created based on the 557 // policy configuration. 558 repeated string backup_policies = 1 [ 559 (google.api.field_behavior) = OPTIONAL, 560 (google.api.resource_reference) = { 561 type: "netapp.googleapis.com/BackupPolicy" 562 } 563 ]; 564 565 // Optional. Name of backup vault. 566 // Format: 567 // projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id} 568 string backup_vault = 2 [ 569 (google.api.field_behavior) = OPTIONAL, 570 (google.api.resource_reference) = { 571 type: "netapp.googleapis.com/BackupVault" 572 } 573 ]; 574 575 // Optional. When set to true, scheduled backup is enabled on the volume. 576 // This field should be nil when there's no backup policy attached. 577 optional bool scheduled_backup_enabled = 3 578 [(google.api.field_behavior) = OPTIONAL]; 579} 580