1// Copyright 2022 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.filestore.v1beta1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/cloud/common/operation_metadata.proto";
24import "google/longrunning/operations.proto";
25import "google/protobuf/field_mask.proto";
26import "google/protobuf/timestamp.proto";
27import "google/protobuf/wrappers.proto";
28
29option csharp_namespace = "Google.Cloud.Filestore.V1Beta1";
30option go_package = "cloud.google.com/go/filestore/apiv1beta1/filestorepb;filestorepb";
31option java_multiple_files = true;
32option java_outer_classname = "CloudFilestoreServiceProto";
33option java_package = "com.google.cloud.filestore.v1beta1";
34option php_namespace = "Google\\Cloud\\Filestore\\V1beta1";
35
36// Configures and manages Filestore resources.
37//
38// Filestore Manager v1beta1.
39//
40// The `file.googleapis.com` service implements the Filestore API and
41// defines the following model for managing resources:
42// * The service works with a collection of cloud projects, named: `/projects/*`
43// * Each project has a collection of available locations, named: `/locations/*`
44// * Each location has a collection of instances and backups, named:
45// `/instances/*` and `/backups/*` respectively.
46// * As such, Filestore instances are resources of the form:
47//   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
48//   backups are resources of the form:
49//   `/projects/{project_id}/locations/{location_id}/backup/{backup_id}`
50//
51// Note that location_id can represent a GCP `zone` or `region` depending on the
52// resource.
53// for example:
54// A zonal Filestore instance:
55// * `projects/my-project/locations/us-central1-c/instances/my-basic-tier-filer`
56// A regional Filestore instance:
57// * `projects/my-project/locations/us-central1/instances/my-enterprise-filer`
58service CloudFilestoreManager {
59  option (google.api.default_host) = "file.googleapis.com";
60  option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
61
62  // Lists all instances in a project for either a specified location
63  // or for all locations.
64  rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) {
65    option (google.api.http) = {
66      get: "/v1beta1/{parent=projects/*/locations/*}/instances"
67    };
68    option (google.api.method_signature) = "parent";
69  }
70
71  // Gets the details of a specific instance.
72  rpc GetInstance(GetInstanceRequest) returns (Instance) {
73    option (google.api.http) = {
74      get: "/v1beta1/{name=projects/*/locations/*/instances/*}"
75    };
76    option (google.api.method_signature) = "name";
77  }
78
79  // Creates an instance.
80  // When creating from a backup, the capacity of the new instance needs to be
81  // equal to or larger than the capacity of the backup (and also equal to or
82  // larger than the minimum capacity of the tier).
83  rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) {
84    option (google.api.http) = {
85      post: "/v1beta1/{parent=projects/*/locations/*}/instances"
86      body: "instance"
87    };
88    option (google.api.method_signature) = "parent,instance,instance_id";
89    option (google.longrunning.operation_info) = {
90      response_type: "Instance"
91      metadata_type: "google.cloud.common.OperationMetadata"
92    };
93  }
94
95  // Updates the settings of a specific instance.
96  rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) {
97    option (google.api.http) = {
98      patch: "/v1beta1/{instance.name=projects/*/locations/*/instances/*}"
99      body: "instance"
100    };
101    option (google.api.method_signature) = "instance,update_mask";
102    option (google.longrunning.operation_info) = {
103      response_type: "Instance"
104      metadata_type: "google.cloud.common.OperationMetadata"
105    };
106  }
107
108  // Restores an existing instance's file share from a backup.
109  //
110  // The capacity of the instance needs to be equal to or larger than the
111  // capacity of the backup (and also equal to or larger than the minimum
112  // capacity of the tier).
113  rpc RestoreInstance(RestoreInstanceRequest) returns (google.longrunning.Operation) {
114    option (google.api.http) = {
115      post: "/v1beta1/{name=projects/*/locations/*/instances/*}:restore"
116      body: "*"
117    };
118    option (google.longrunning.operation_info) = {
119      response_type: "Instance"
120      metadata_type: "google.cloud.common.OperationMetadata"
121    };
122  }
123
124  // Revert an existing instance's file system to a specified snapshot.
125  rpc RevertInstance(RevertInstanceRequest) returns (google.longrunning.Operation) {
126    option (google.api.http) = {
127      post: "/v1beta1/{name=projects/*/locations/*/instances/*}:revert"
128      body: "*"
129    };
130    option (google.longrunning.operation_info) = {
131      response_type: "Instance"
132      metadata_type: "google.cloud.common.OperationMetadata"
133    };
134  }
135
136  // Deletes an instance.
137  rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) {
138    option (google.api.http) = {
139      delete: "/v1beta1/{name=projects/*/locations/*/instances/*}"
140    };
141    option (google.api.method_signature) = "name";
142    option (google.longrunning.operation_info) = {
143      response_type: "google.protobuf.Empty"
144      metadata_type: "google.cloud.common.OperationMetadata"
145    };
146  }
147
148  // Lists all snapshots in a project for either a specified location
149  // or for all locations.
150  rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) {
151    option (google.api.http) = {
152      get: "/v1beta1/{parent=projects/*/locations/*/instances/*}/snapshots"
153    };
154    option (google.api.method_signature) = "parent";
155  }
156
157  // Gets the details of a specific snapshot.
158  rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) {
159    option (google.api.http) = {
160      get: "/v1beta1/{name=projects/*/locations/*/instances/*/snapshots/*}"
161    };
162    option (google.api.method_signature) = "name";
163  }
164
165  // Creates a snapshot.
166  rpc CreateSnapshot(CreateSnapshotRequest) returns (google.longrunning.Operation) {
167    option (google.api.http) = {
168      post: "/v1beta1/{parent=projects/*/locations/*/instances/*}/snapshots"
169      body: "snapshot"
170    };
171    option (google.api.method_signature) = "parent,snapshot,snapshot_id";
172    option (google.longrunning.operation_info) = {
173      response_type: "Snapshot"
174      metadata_type: "google.cloud.common.OperationMetadata"
175    };
176  }
177
178  // Deletes a snapshot.
179  rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.longrunning.Operation) {
180    option (google.api.http) = {
181      delete: "/v1beta1/{name=projects/*/locations/*/instances/*/snapshots/*}"
182    };
183    option (google.api.method_signature) = "name";
184    option (google.longrunning.operation_info) = {
185      response_type: "google.protobuf.Empty"
186      metadata_type: "google.cloud.common.OperationMetadata"
187    };
188  }
189
190  // Updates the settings of a specific snapshot.
191  rpc UpdateSnapshot(UpdateSnapshotRequest) returns (google.longrunning.Operation) {
192    option (google.api.http) = {
193      patch: "/v1beta1/{snapshot.name=projects/*/locations/*/instances/*/snapshots/*}"
194      body: "snapshot"
195    };
196    option (google.api.method_signature) = "snapshot,update_mask";
197    option (google.longrunning.operation_info) = {
198      response_type: "Snapshot"
199      metadata_type: "google.cloud.common.OperationMetadata"
200    };
201  }
202
203  // Lists all backups in a project for either a specified location or for all
204  // locations.
205  rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) {
206    option (google.api.http) = {
207      get: "/v1beta1/{parent=projects/*/locations/*}/backups"
208    };
209    option (google.api.method_signature) = "parent";
210  }
211
212  // Gets the details of a specific backup.
213  rpc GetBackup(GetBackupRequest) returns (Backup) {
214    option (google.api.http) = {
215      get: "/v1beta1/{name=projects/*/locations/*/backups/*}"
216    };
217    option (google.api.method_signature) = "name";
218  }
219
220  // Creates a backup.
221  rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) {
222    option (google.api.http) = {
223      post: "/v1beta1/{parent=projects/*/locations/*}/backups"
224      body: "backup"
225    };
226    option (google.api.method_signature) = "parent,backup,backup_id";
227    option (google.longrunning.operation_info) = {
228      response_type: "Backup"
229      metadata_type: "google.cloud.common.OperationMetadata"
230    };
231  }
232
233  // Deletes a backup.
234  rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) {
235    option (google.api.http) = {
236      delete: "/v1beta1/{name=projects/*/locations/*/backups/*}"
237    };
238    option (google.api.method_signature) = "name";
239    option (google.longrunning.operation_info) = {
240      response_type: "google.protobuf.Empty"
241      metadata_type: "google.cloud.common.OperationMetadata"
242    };
243  }
244
245  // Updates the settings of a specific backup.
246  rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) {
247    option (google.api.http) = {
248      patch: "/v1beta1/{backup.name=projects/*/locations/*/backups/*}"
249      body: "backup"
250    };
251    option (google.api.method_signature) = "backup,update_mask";
252    option (google.longrunning.operation_info) = {
253      response_type: "Backup"
254      metadata_type: "google.cloud.common.OperationMetadata"
255    };
256  }
257
258  // Lists all shares for a specified instance.
259  rpc ListShares(ListSharesRequest) returns (ListSharesResponse) {
260    option (google.api.http) = {
261      get: "/v1beta1/{parent=projects/*/locations/*/instances/*}/shares"
262    };
263    option (google.api.method_signature) = "parent";
264  }
265
266  // Gets the details of a specific share.
267  rpc GetShare(GetShareRequest) returns (Share) {
268    option (google.api.http) = {
269      get: "/v1beta1/{name=projects/*/locations/*/instances/*/shares/*}"
270    };
271    option (google.api.method_signature) = "name";
272  }
273
274  // Creates a share.
275  rpc CreateShare(CreateShareRequest) returns (google.longrunning.Operation) {
276    option (google.api.http) = {
277      post: "/v1beta1/{parent=projects/*/locations/*/instances/*}/shares"
278      body: "share"
279    };
280    option (google.api.method_signature) = "parent,share,share_id";
281    option (google.longrunning.operation_info) = {
282      response_type: "Share"
283      metadata_type: "google.cloud.common.OperationMetadata"
284    };
285  }
286
287  // Deletes a share.
288  rpc DeleteShare(DeleteShareRequest) returns (google.longrunning.Operation) {
289    option (google.api.http) = {
290      delete: "/v1beta1/{name=projects/*/locations/*/instances/*/shares/*}"
291    };
292    option (google.api.method_signature) = "name";
293    option (google.longrunning.operation_info) = {
294      response_type: "google.protobuf.Empty"
295      metadata_type: "google.cloud.common.OperationMetadata"
296    };
297  }
298
299  // Updates the settings of a specific share.
300  rpc UpdateShare(UpdateShareRequest) returns (google.longrunning.Operation) {
301    option (google.api.http) = {
302      patch: "/v1beta1/{share.name=projects/*/locations/*/instances/*/shares/*}"
303      body: "share"
304    };
305    option (google.api.method_signature) = "share,update_mask";
306    option (google.longrunning.operation_info) = {
307      response_type: "Share"
308      metadata_type: "google.cloud.common.OperationMetadata"
309    };
310  }
311}
312
313// Network configuration for the instance.
314message NetworkConfig {
315  // Internet protocol versions supported by Filestore.
316  enum AddressMode {
317    // Internet protocol not set.
318    ADDRESS_MODE_UNSPECIFIED = 0;
319
320    // Use the IPv4 internet protocol.
321    MODE_IPV4 = 1;
322  }
323
324  // Available connection modes.
325  enum ConnectMode {
326    // ConnectMode not set.
327    CONNECT_MODE_UNSPECIFIED = 0;
328
329    // Connect via direct peering to the Filestore service.
330    DIRECT_PEERING = 1;
331
332    // Connect to your Filestore instance using Private Service
333    // Access. Private services access provides an IP address range for multiple
334    // Google Cloud services, including Filestore.
335    PRIVATE_SERVICE_ACCESS = 2;
336  }
337
338  // The name of the Google Compute Engine
339  // [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the
340  // instance is connected.
341  string network = 1;
342
343  // Internet protocol versions for which the instance has IP addresses
344  // assigned. For this version, only MODE_IPV4 is supported.
345  repeated AddressMode modes = 3;
346
347  // Optional, reserved_ip_range can have one of the following two types of
348  // values.
349  //
350  // * CIDR range value when using DIRECT_PEERING connect mode.
351  // * [Allocated IP address
352  // range](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address)
353  // when using PRIVATE_SERVICE_ACCESS connect mode.
354  //
355  // When the name of an allocated IP address range is specified, it must be one
356  // of the ranges associated with the private service access connection.
357  // When specified as a direct CIDR value, it must be a /29 CIDR block for
358  // Basic tier, a /24 CIDR block for High Scale tier, or a /26 CIDR block for
359  // Enterprise tier in one of the [internal IP address
360  // ranges](https://www.arin.net/reference/research/statistics/address_filters/)
361  // that identifies the range of IP addresses reserved for this instance. For
362  // example, 10.0.0.0/29, 192.168.0.0/24, or 192.168.0.0/26, respectively. The
363  // range you specify can't overlap with either existing subnets or assigned IP
364  // address ranges for other Filestore instances in the selected VPC
365  // network.
366  string reserved_ip_range = 4;
367
368  // Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or
369  // IPv6 addresses in the format
370  // `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
371  repeated string ip_addresses = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
372
373  // The network connect mode of the Filestore instance.
374  // If not provided, the connect mode defaults to DIRECT_PEERING.
375  ConnectMode connect_mode = 6;
376}
377
378// File share configuration for the instance.
379message FileShareConfig {
380  // The name of the file share (must be 32 characters or less for
381  // Enterprise and High Scale SSD tiers and 16 characters or less for all other
382  // tiers).
383  string name = 1;
384
385  // File share capacity in gigabytes (GB).
386  // Filestore defines 1 GB as 1024^3 bytes.
387  int64 capacity_gb = 2;
388
389  // The source that this file share has been restored from. Empty if the file
390  // share is created from scratch.
391  oneof source {
392    // The resource name of the backup, in the format
393    // `projects/{project_id}/locations/{location_id}/backups/{backup_id}`, that
394    // this file share has been restored from.
395    string source_backup = 9 [(google.api.resource_reference) = {
396                                type: "file.googleapis.com/Backup"
397                              }];
398  }
399
400  // Nfs Export Options.
401  // There is a limit of 10 export options per file share.
402  repeated NfsExportOptions nfs_export_options = 8;
403}
404
405// NFS export options specifications.
406message NfsExportOptions {
407  // The access mode.
408  enum AccessMode {
409    // AccessMode not set.
410    ACCESS_MODE_UNSPECIFIED = 0;
411
412    // The client can only read the file share.
413    READ_ONLY = 1;
414
415    // The client can read and write the file share (default).
416    READ_WRITE = 2;
417  }
418
419  // The squash mode.
420  enum SquashMode {
421    // SquashMode not set.
422    SQUASH_MODE_UNSPECIFIED = 0;
423
424    // The Root user has root access to the file share (default).
425    NO_ROOT_SQUASH = 1;
426
427    // The Root user has squashed access to the anonymous uid/gid.
428    ROOT_SQUASH = 2;
429  }
430
431  // List of either an IPv4 addresses in the format
432  // `{octet1}.{octet2}.{octet3}.{octet4}` or CIDR ranges in the format
433  // `{octet1}.{octet2}.{octet3}.{octet4}/{mask size}` which may mount the
434  // file share.
435  // Overlapping IP ranges are not allowed, both within and across
436  // NfsExportOptions. An error will be returned.
437  // The limit is 64 IP ranges/addresses for each FileShareConfig among all
438  // NfsExportOptions.
439  repeated string ip_ranges = 1;
440
441  // Either READ_ONLY, for allowing only read requests on the exported
442  // directory, or READ_WRITE, for allowing both read and write requests.
443  // The default is READ_WRITE.
444  AccessMode access_mode = 2;
445
446  // Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
447  // or ROOT_SQUASH, for not allowing root access. The default is
448  // NO_ROOT_SQUASH.
449  SquashMode squash_mode = 3;
450
451  // An integer representing the anonymous user id with a default value of
452  // 65534.
453  // Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
454  // returned if this field is specified for other squash_mode settings.
455  int64 anon_uid = 4;
456
457  // An integer representing the anonymous group id with a default value of
458  // 65534.
459  // Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
460  // returned if this field is specified for other squash_mode settings.
461  int64 anon_gid = 5;
462}
463
464// A Filestore instance.
465message Instance {
466  option (google.api.resource) = {
467    type: "file.googleapis.com/Instance"
468    pattern: "projects/{project}/locations/{location}/instances/{instance}"
469  };
470
471  // The instance state.
472  enum State {
473    // State not set.
474    STATE_UNSPECIFIED = 0;
475
476    // The instance is being created.
477    CREATING = 1;
478
479    // The instance is available for use.
480    READY = 2;
481
482    // Work is being done on the instance. You can get further details from the
483    // `statusMessage` field of the `Instance` resource.
484    REPAIRING = 3;
485
486    // The instance is shutting down.
487    DELETING = 4;
488
489    // The instance is experiencing an issue and might be unusable. You can get
490    // further details from the `statusMessage` field of the `Instance`
491    // resource.
492    ERROR = 6;
493
494    // The instance is restoring a snapshot or backup to an existing file share
495    // and may be unusable during this time.
496    RESTORING = 7;
497
498    // The instance is suspended. You can get further details from
499    // the `suspension_reasons` field of the `Instance` resource.
500    SUSPENDED = 8;
501
502    // The instance is reverting to a snapshot.
503    REVERTING = 9;
504
505    // The instance is in the process of becoming suspended.
506    SUSPENDING = 10;
507
508    // The instance is in the process of becoming active.
509    RESUMING = 11;
510  }
511
512  // Available service tiers.
513  enum Tier {
514    // Not set.
515    TIER_UNSPECIFIED = 0;
516
517    // STANDARD tier. BASIC_HDD is the preferred term for this tier.
518    STANDARD = 1;
519
520    // PREMIUM tier. BASIC_SSD is the preferred term for this tier.
521    PREMIUM = 2;
522
523    // BASIC instances offer a maximum capacity of 63.9 TB.
524    // BASIC_HDD is an alias for STANDARD Tier, offering economical
525    // performance backed by HDD.
526    BASIC_HDD = 3;
527
528    // BASIC instances offer a maximum capacity of 63.9 TB.
529    // BASIC_SSD is an alias for PREMIUM Tier, and offers improved
530    // performance backed by SSD.
531    BASIC_SSD = 4;
532
533    // HIGH_SCALE instances offer expanded capacity and performance scaling
534    // capabilities.
535    HIGH_SCALE_SSD = 6;
536
537    // ENTERPRISE instances offer the features and availability needed for
538    // mission-critical workloads.
539    ENTERPRISE = 7;
540  }
541
542  // SuspensionReason contains the possible reasons for a suspension.
543  enum SuspensionReason {
544    // Not set.
545    SUSPENSION_REASON_UNSPECIFIED = 0;
546
547    // The KMS key used by the instance is either revoked or denied access to.
548    KMS_KEY_ISSUE = 1;
549  }
550
551  // Output only. The resource name of the instance, in the format
552  // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.
553  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
554
555  // The description of the instance (2048 characters or less).
556  string description = 2;
557
558  // Output only. The instance state.
559  State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
560
561  // Output only. Additional information about the instance state, if available.
562  string status_message = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
563
564  // Output only. The time when the instance was created.
565  google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
566
567  // The service tier of the instance.
568  Tier tier = 8;
569
570  // Resource labels to represent user provided metadata.
571  map<string, string> labels = 9;
572
573  // File system shares on the instance.
574  // For this version, only a single file share is supported.
575  repeated FileShareConfig file_shares = 10;
576
577  // VPC networks to which the instance is connected.
578  // For this version, only a single network is supported.
579  repeated NetworkConfig networks = 11;
580
581  // Server-specified ETag for the instance resource to prevent simultaneous
582  // updates from overwriting each other.
583  string etag = 12;
584
585  // Output only. Reserved for future use.
586  google.protobuf.BoolValue satisfies_pzs = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
587
588  // KMS key name used for data encryption.
589  string kms_key_name = 14;
590
591  // Output only. Field indicates all the reasons the instance is in "SUSPENDED" state.
592  repeated SuspensionReason suspension_reasons = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
593
594  // Output only. The max capacity of the instance.
595  int64 max_capacity_gb = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
596
597  // Output only. The increase/decrease capacity step size.
598  int64 capacity_step_size_gb = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
599
600  // Output only. The max number of shares allowed.
601  int64 max_share_count = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
602
603  // The storage capacity of the instance in gigabytes (GB = 1024^3 bytes).
604  // This capacity can be increased up to `max_capacity_gb` GB in multipliers
605  // of `capacity_step_size_gb` GB.
606  int64 capacity_gb = 19;
607
608  // Indicates whether this instance uses a multi-share configuration with which
609  // it can have more than one file-share or none at all. File-shares are added,
610  // updated and removed through the separate file-share APIs.
611  bool multi_share_enabled = 20;
612}
613
614// CreateInstanceRequest creates an instance.
615message CreateInstanceRequest {
616  // Required. The instance's project and location, in the format
617  // `projects/{project_id}/locations/{location}`. In Filestore,
618  // locations map to GCP zones, for example **us-west1-b**.
619  string parent = 1 [
620    (google.api.field_behavior) = REQUIRED,
621    (google.api.resource_reference) = {
622      type: "locations.googleapis.com/Location"
623    }
624  ];
625
626  // Required. The ID of the instance to create.
627  // The ID must be unique within the specified project and location.
628  //
629  // This value must start with a lowercase letter followed by up to 62
630  // lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
631  string instance_id = 2 [(google.api.field_behavior) = REQUIRED];
632
633  // Required. An [instance resource][google.cloud.filestore.v1beta1.Instance]
634  Instance instance = 3 [(google.api.field_behavior) = REQUIRED];
635}
636
637// GetInstanceRequest gets the state of an instance.
638message GetInstanceRequest {
639  // Required. The instance resource name, in the format
640  // `projects/{project_id}/locations/{location}/instances/{instance_id}`.
641  string name = 1 [
642    (google.api.field_behavior) = REQUIRED,
643    (google.api.resource_reference) = {
644      type: "file.googleapis.com/Instance"
645    }
646  ];
647}
648
649// UpdateInstanceRequest updates the settings of an instance.
650message UpdateInstanceRequest {
651  // Required. Mask of fields to update.  At least one path must be supplied in this
652  // field.  The elements of the repeated paths field may only include these
653  // fields:
654  //
655  // * "description"
656  // * "file_shares"
657  // * "labels"
658  google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED];
659
660  // Required. Only fields specified in update_mask are updated.
661  Instance instance = 2 [(google.api.field_behavior) = REQUIRED];
662}
663
664// RestoreInstanceRequest restores an existing instance's file share from a
665// snapshot or backup.
666message RestoreInstanceRequest {
667  // Required. The resource name of the instance, in the format
668  // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.
669  string name = 1 [
670    (google.api.field_behavior) = REQUIRED,
671    (google.api.resource_reference) = {
672      type: "file.googleapis.com/Instance"
673    }
674  ];
675
676  // Required. Name of the file share in the Filestore instance that the snapshot
677  // is being restored to.
678  string file_share = 2 [(google.api.field_behavior) = REQUIRED];
679
680  oneof source {
681    // The resource name of the snapshot, in the format
682    // `projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}`.
683    string source_snapshot = 3 [(google.api.resource_reference) = {
684                                  type: "file.googleapis.com/Snapshot"
685                                }];
686
687    // The resource name of the backup, in the format
688    // `projects/{project_id}/locations/{location_id}/backups/{backup_id}`.
689    string source_backup = 4 [(google.api.resource_reference) = {
690                                type: "file.googleapis.com/Backup"
691                              }];
692  }
693}
694
695// RevertInstanceRequest reverts the given instance's file share to the
696// specified snapshot.
697message RevertInstanceRequest {
698  // Required. projects/{project_id}/locations/{location_id}/instances/{instance_id}.
699  // The resource name of the instance, in the format
700  string name = 1 [
701    (google.api.field_behavior) = REQUIRED,
702    (google.api.resource_reference) = {
703      type: "file.googleapis.com/Instance"
704    }
705  ];
706
707  // Required. The snapshot resource ID, in the format 'my-snapshot', where the specified
708  // ID is the {snapshot_id} of the fully qualified name like
709  // projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}
710  string target_snapshot_id = 2 [(google.api.field_behavior) = REQUIRED];
711}
712
713// DeleteInstanceRequest deletes an instance.
714message DeleteInstanceRequest {
715  // Required. The instance resource name, in the format
716  // `projects/{project_id}/locations/{location}/instances/{instance_id}`
717  string name = 1 [
718    (google.api.field_behavior) = REQUIRED,
719    (google.api.resource_reference) = {
720      type: "file.googleapis.com/Instance"
721    }
722  ];
723
724  // If set to true, any snapshots of the instance will also be deleted.
725  // (Otherwise, the request will only work if the instance has no snapshots.)
726  bool force = 2;
727}
728
729// ListInstancesRequest lists instances.
730message ListInstancesRequest {
731  // Required. The project and location for which to retrieve instance information,
732  // in the format `projects/{project_id}/locations/{location}`. In Cloud
733  // Filestore, locations map to GCP zones, for example **us-west1-b**. To
734  // retrieve instance information for all locations, use "-" for the
735  // `{location}` value.
736  string parent = 1 [
737    (google.api.field_behavior) = REQUIRED,
738    (google.api.resource_reference) = {
739      type: "locations.googleapis.com/Location"
740    }
741  ];
742
743  // The maximum number of items to return.
744  int32 page_size = 2;
745
746  // The next_page_token value to use if there are additional
747  // results to retrieve for this list request.
748  string page_token = 3;
749
750  // Sort results. Supported values are "name", "name desc" or "" (unsorted).
751  string order_by = 4;
752
753  // List filter.
754  string filter = 5;
755}
756
757// ListInstancesResponse is the result of ListInstancesRequest.
758message ListInstancesResponse {
759  // A list of instances in the project for the specified location.
760  //
761  // If the `{location}` value in the request is "-", the response contains a
762  // list of instances from all locations. If any location is unreachable, the
763  // response will only return instances in reachable locations and the
764  // "unreachable" field will be populated with a list of unreachable locations.
765  repeated Instance instances = 1;
766
767  // The token you can use to retrieve the next page of results. Not returned
768  // if there are no more results in the list.
769  string next_page_token = 2;
770
771  // Locations that could not be reached.
772  repeated string unreachable = 3;
773}
774
775// A Filestore snapshot.
776message Snapshot {
777  option (google.api.resource) = {
778    type: "file.googleapis.com/Snapshot"
779    pattern: "projects/{project}/locations/{location}/instances/{instance}/snapshots/{snapshot}"
780  };
781
782  // The snapshot state.
783  enum State {
784    // State not set.
785    STATE_UNSPECIFIED = 0;
786
787    // Snapshot is being created.
788    CREATING = 1;
789
790    // Snapshot is available for use.
791    READY = 3;
792
793    // Snapshot is being deleted.
794    DELETING = 4;
795  }
796
797  // Output only. The resource name of the snapshot, in the format
798  // `projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}`.
799  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
800
801  // A description of the snapshot with 2048 characters or less.
802  // Requests with longer descriptions will be rejected.
803  string description = 2;
804
805  // Output only. The snapshot state.
806  State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
807
808  // Output only. The time when the snapshot was created.
809  google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
810
811  // Resource labels to represent user provided metadata.
812  map<string, string> labels = 5;
813
814  // Output only. The amount of bytes needed to allocate a full copy of the snapshot content
815  int64 filesystem_used_bytes = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
816}
817
818// CreateSnapshotRequest creates a snapshot.
819message CreateSnapshotRequest {
820  // Required. The Filestore Instance to create the snapshots of, in the format
821  // `projects/{project_id}/locations/{location}/instances/{instance_id}`
822  string parent = 1 [
823    (google.api.field_behavior) = REQUIRED,
824    (google.api.resource_reference) = {
825      type: "file.googleapis.com/Instance"
826    }
827  ];
828
829  // Required. The ID to use for the snapshot.
830  // The ID must be unique within the specified instance.
831  //
832  // This value must start with a lowercase letter followed by up to 62
833  // lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
834  string snapshot_id = 2 [(google.api.field_behavior) = REQUIRED];
835
836  // Required. A snapshot resource
837  Snapshot snapshot = 3 [(google.api.field_behavior) = REQUIRED];
838}
839
840// GetSnapshotRequest gets the state of a snapshot.
841message GetSnapshotRequest {
842  // Required. The snapshot resource name, in the format
843  // `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
844  string name = 1 [
845    (google.api.field_behavior) = REQUIRED,
846    (google.api.resource_reference) = {
847      type: "file.googleapis.com/Snapshot"
848    }
849  ];
850}
851
852// DeleteSnapshotRequest deletes a snapshot.
853message DeleteSnapshotRequest {
854  // Required. The snapshot resource name, in the format
855  // `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
856  string name = 1 [
857    (google.api.field_behavior) = REQUIRED,
858    (google.api.resource_reference) = {
859      type: "file.googleapis.com/Snapshot"
860    }
861  ];
862}
863
864// UpdateSnapshotRequest updates description and/or labels for a snapshot.
865message UpdateSnapshotRequest {
866  // Required. Mask of fields to update.  At least one path must be supplied in this
867  // field.
868  google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED];
869
870  // Required. A snapshot resource
871  Snapshot snapshot = 2 [(google.api.field_behavior) = REQUIRED];
872}
873
874// ListSnapshotsRequest lists snapshots.
875message ListSnapshotsRequest {
876  // Required. The instance for which to retrieve snapshot information,
877  // in the format
878  // `projects/{project_id}/locations/{location}/instances/{instance_id}`.
879  string parent = 1 [
880    (google.api.field_behavior) = REQUIRED,
881    (google.api.resource_reference) = {
882      type: "file.googleapis.com/Instance"
883    }
884  ];
885
886  // The maximum number of items to return.
887  int32 page_size = 2;
888
889  // The next_page_token value to use if there are additional
890  // results to retrieve for this list request.
891  string page_token = 3;
892
893  // Sort results. Supported values are "name", "name desc" or "" (unsorted).
894  string order_by = 4;
895
896  // List filter.
897  string filter = 5;
898}
899
900// ListSnapshotsResponse is the result of ListSnapshotsRequest.
901message ListSnapshotsResponse {
902  // A list of snapshots in the project for the specified instance.
903  repeated Snapshot snapshots = 1;
904
905  // The token you can use to retrieve the next page of results. Not returned
906  // if there are no more results in the list.
907  string next_page_token = 2;
908}
909
910// A Filestore backup.
911message Backup {
912  option (google.api.resource) = {
913    type: "file.googleapis.com/Backup"
914    pattern: "projects/{project}/locations/{location}/backups/{backup}"
915  };
916
917  // The backup state.
918  enum State {
919    // State not set.
920    STATE_UNSPECIFIED = 0;
921
922    // Backup is being created.
923    CREATING = 1;
924
925    // Backup has been taken and the operation is being finalized. At this
926    // point, changes to the file share will not be reflected in the backup.
927    FINALIZING = 2;
928
929    // Backup is available for use.
930    READY = 3;
931
932    // Backup is being deleted.
933    DELETING = 4;
934  }
935
936  // Output only. The resource name of the backup, in the format
937  // `projects/{project_id}/locations/{location_id}/backups/{backup_id}`.
938  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
939
940  // A description of the backup with 2048 characters or less.
941  // Requests with longer descriptions will be rejected.
942  string description = 2;
943
944  // Output only. The backup state.
945  State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
946
947  // Output only. The time when the backup was created.
948  google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
949
950  // Resource labels to represent user provided metadata.
951  map<string, string> labels = 5;
952
953  // Output only. Capacity of the source file share when the backup was created.
954  int64 capacity_gb = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
955
956  // Output only. The size of the storage used by the backup. As backups share storage,
957  // this number is expected to change with backup creation/deletion.
958  int64 storage_bytes = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
959
960  // The resource name of the source Filestore instance, in the format
961  // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`,
962  // used to create this backup.
963  string source_instance = 8 [(google.api.resource_reference) = {
964                                type: "file.googleapis.com/Instance"
965                              }];
966
967  // Name of the file share in the source Filestore instance that the
968  // backup is created from.
969  string source_file_share = 9;
970
971  // Output only. The service tier of the source Filestore instance that this backup
972  // is created from.
973  Instance.Tier source_instance_tier = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
974
975  // Output only. Amount of bytes that will be downloaded if the backup is restored
976  int64 download_bytes = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
977
978  // Output only. Reserved for future use.
979  google.protobuf.BoolValue satisfies_pzs = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
980
981  // Immutable. KMS key name used for data encryption.
982  string kms_key_name = 13 [(google.api.field_behavior) = IMMUTABLE];
983}
984
985// CreateBackupRequest creates a backup.
986message CreateBackupRequest {
987  // Required. The backup's project and location, in the format
988  // `projects/{project_id}/locations/{location}`. In Filestore,
989  // backup locations map to GCP regions, for example **us-west1**.
990  string parent = 1 [
991    (google.api.field_behavior) = REQUIRED,
992    (google.api.resource_reference) = {
993      type: "locations.googleapis.com/Location"
994    }
995  ];
996
997  // Required. A [backup resource][google.cloud.filestore.v1beta1.Backup]
998  Backup backup = 2 [(google.api.field_behavior) = REQUIRED];
999
1000  // Required. The ID to use for the backup.
1001  // The ID must be unique within the specified project and location.
1002  //
1003  // This value must start with a lowercase letter followed by up to 62
1004  // lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
1005  string backup_id = 3 [(google.api.field_behavior) = REQUIRED];
1006}
1007
1008// DeleteBackupRequest deletes a backup.
1009message DeleteBackupRequest {
1010  // Required. The backup resource name, in the format
1011  // `projects/{project_id}/locations/{location}/backups/{backup_id}`
1012  string name = 1 [
1013    (google.api.field_behavior) = REQUIRED,
1014    (google.api.resource_reference) = {
1015      type: "file.googleapis.com/Backup"
1016    }
1017  ];
1018}
1019
1020// UpdateBackupRequest updates description and/or labels for a backup.
1021message UpdateBackupRequest {
1022  // Required. A [backup resource][google.cloud.filestore.v1beta1.Backup]
1023  Backup backup = 1 [(google.api.field_behavior) = REQUIRED];
1024
1025  // Required. Mask of fields to update.  At least one path must be supplied in this
1026  // field.
1027  google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
1028}
1029
1030// GetBackupRequest gets the state of a backup.
1031message GetBackupRequest {
1032  // Required. The backup resource name, in the format
1033  // `projects/{project_id}/locations/{location}/backups/{backup_id}`.
1034  string name = 1 [
1035    (google.api.field_behavior) = REQUIRED,
1036    (google.api.resource_reference) = {
1037      type: "file.googleapis.com/Backup"
1038    }
1039  ];
1040}
1041
1042// ListBackupsRequest lists backups.
1043message ListBackupsRequest {
1044  // Required. The project and location for which to retrieve backup information,
1045  // in the format `projects/{project_id}/locations/{location}`.
1046  // In Filestore, backup locations map to GCP regions,
1047  // for example **us-west1**.
1048  // To retrieve backup information for all locations, use "-" for the
1049  // `{location}` value.
1050  string parent = 1 [
1051    (google.api.field_behavior) = REQUIRED,
1052    (google.api.resource_reference) = {
1053      type: "locations.googleapis.com/Location"
1054    }
1055  ];
1056
1057  // The maximum number of items to return.
1058  int32 page_size = 2;
1059
1060  // The next_page_token value to use if there are additional
1061  // results to retrieve for this list request.
1062  string page_token = 3;
1063
1064  // Sort results. Supported values are "name", "name desc" or "" (unsorted).
1065  string order_by = 4;
1066
1067  // List filter.
1068  string filter = 5;
1069}
1070
1071// ListBackupsResponse is the result of ListBackupsRequest.
1072message ListBackupsResponse {
1073  // A list of backups in the project for the specified location.
1074  //
1075  // If the `{location}` value in the request is "-", the response contains a
1076  // list of backups from all locations. If any location is unreachable, the
1077  // response will only return backups in reachable locations and the
1078  // "unreachable" field will be populated with a list of unreachable
1079  // locations.
1080  repeated Backup backups = 1;
1081
1082  // The token you can use to retrieve the next page of results. Not returned
1083  // if there are no more results in the list.
1084  string next_page_token = 2;
1085
1086  // Locations that could not be reached.
1087  repeated string unreachable = 3;
1088}
1089
1090// A Filestore share.
1091message Share {
1092  option (google.api.resource) = {
1093    type: "file.googleapis.com/Share"
1094    pattern: "projects/{project}/locations/{location}/instances/{instance}/shares/{share}"
1095  };
1096
1097  // The share state.
1098  enum State {
1099    // State not set.
1100    STATE_UNSPECIFIED = 0;
1101
1102    // Share is being created.
1103    CREATING = 1;
1104
1105    // Share is ready for use.
1106    READY = 3;
1107
1108    // Share is being deleted.
1109    DELETING = 4;
1110  }
1111
1112  // Output only. The resource name of the share, in the format
1113  // `projects/{project_id}/locations/{location_id}/instances/{instance_id}/shares/{share_id}`.
1114  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
1115
1116  // The mount name of the share. Must be 63 characters or less and consist of
1117  // uppercase or lowercase letters, numbers, and underscores.
1118  string mount_name = 2;
1119
1120  // A description of the share with 2048 characters or less. Requests with
1121  // longer descriptions will be rejected.
1122  string description = 3;
1123
1124  // File share capacity in gigabytes (GB). Filestore defines 1 GB as
1125  // 1024^3 bytes. Must be greater than 0.
1126  int64 capacity_gb = 4;
1127
1128  // Nfs Export Options.
1129  // There is a limit of 10 export options per file share.
1130  repeated NfsExportOptions nfs_export_options = 5;
1131
1132  // Output only. The share state.
1133  State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
1134
1135  // Output only. The time when the share was created.
1136  google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
1137
1138  // Resource labels to represent user provided metadata.
1139  map<string, string> labels = 8;
1140}
1141
1142// CreateShareRequest creates a share.
1143message CreateShareRequest {
1144  // Required. The Filestore Instance to create the share for, in the format
1145  // `projects/{project_id}/locations/{location}/instances/{instance_id}`
1146  string parent = 1 [
1147    (google.api.field_behavior) = REQUIRED,
1148    (google.api.resource_reference) = {
1149      type: "file.googleapis.com/Instance"
1150    }
1151  ];
1152
1153  // Required. The ID to use for the share.
1154  // The ID must be unique within the specified instance.
1155  //
1156  // This value must start with a lowercase letter followed by up to 62
1157  // lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
1158  string share_id = 2 [(google.api.field_behavior) = REQUIRED];
1159
1160  // Required. A share resource
1161  Share share = 3 [(google.api.field_behavior) = REQUIRED];
1162}
1163
1164// GetShareRequest gets the state of a share.
1165message GetShareRequest {
1166  // Required. The share resource name, in the format
1167  // `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}`
1168  string name = 1 [
1169    (google.api.field_behavior) = REQUIRED,
1170    (google.api.resource_reference) = {
1171      type: "file.googleapis.com/Share"
1172    }
1173  ];
1174}
1175
1176// DeleteShareRequest deletes a share.
1177message DeleteShareRequest {
1178  // Required. The share resource name, in the format
1179  // `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}`
1180  string name = 1 [
1181    (google.api.field_behavior) = REQUIRED,
1182    (google.api.resource_reference) = {
1183      type: "file.googleapis.com/Share"
1184    }
1185  ];
1186}
1187
1188// ListSharesRequest lists shares.
1189message ListSharesRequest {
1190  // Required. The instance for which to retrieve share information,
1191  // in the format
1192  // `projects/{project_id}/locations/{location}/instances/{instance_id}`.
1193  string parent = 1 [
1194    (google.api.field_behavior) = REQUIRED,
1195    (google.api.resource_reference) = {
1196      type: "file.googleapis.com/Instance"
1197    }
1198  ];
1199
1200  // The maximum number of items to return.
1201  int32 page_size = 2;
1202
1203  // The next_page_token value to use if there are additional
1204  // results to retrieve for this list request.
1205  string page_token = 3;
1206
1207  // Sort results. Supported values are "name", "name desc" or "" (unsorted).
1208  string order_by = 4;
1209
1210  // List filter.
1211  string filter = 5;
1212}
1213
1214// ListSharesResponse is the result of ListSharesRequest.
1215message ListSharesResponse {
1216  // A list of shares in the project for the specified instance.
1217  repeated Share shares = 1;
1218
1219  // The token you can use to retrieve the next page of results. Not returned
1220  // if there are no more results in the list.
1221  string next_page_token = 2;
1222
1223  // Locations that could not be reached.
1224  repeated string unreachable = 3;
1225}
1226
1227// UpdateShareRequest updates the settings of a share.
1228message UpdateShareRequest {
1229  // Required. A share resource.
1230  // Only fields specified in update_mask are updated.
1231  Share share = 1 [(google.api.field_behavior) = REQUIRED];
1232
1233  // Required. Mask of fields to update. At least one path must be supplied in this
1234  // field.
1235  // The elements of the repeated paths field may only include these fields:
1236  //
1237  // * "description"
1238  // * "capacity_gb"
1239  // * "labels"
1240  // * "nfs_export_options"
1241  google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
1242}
1243