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