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