feat: filestore public protos

Committer: @vchudnov-g
PiperOrigin-RevId: 381148500
pull/662/head
Google APIs 4 years ago committed by Copybara-Service
parent 5d301f95d1
commit 4c8d14a45f
  1. 350
      google/cloud/filestore/v1/BUILD.bazel
  2. 719
      google/cloud/filestore/v1/cloud_filestore_service.proto
  3. 43
      google/cloud/filestore/v1/file_grpc_service_config.json
  4. 64
      google/cloud/filestore/v1/file_v1.yaml
  5. 350
      google/cloud/filestore/v1beta1/BUILD.bazel
  6. 732
      google/cloud/filestore/v1beta1/cloud_filestore_service.proto
  7. 48
      google/cloud/filestore/v1beta1/file_grpc_service_config.json
  8. 64
      google/cloud/filestore/v1beta1/file_v1beta1.yaml

@ -0,0 +1,350 @@
# This file was automatically generated by BuildFileGenerator
# https://github.com/googleapis/rules_gapic/tree/master/bazel
# Most of the manual changes to this file will be overwritten.
# It's **only** allowed to change the following rule attribute values:
# - names of *_gapic_assembly_* rules
# - certain parameters of *_gapic_library rules, including but not limited to:
# * extra_protoc_parameters
# * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code.
# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])
##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
proto_library(
name = "filestore_proto",
srcs = [
"cloud_filestore_service.proto",
],
deps = [
"//google/api:annotations_proto",
"//google/api:client_proto",
"//google/api:field_behavior_proto",
"//google/api:resource_proto",
"//google/cloud/common:common_proto",
"//google/longrunning:operations_proto",
"@com_google_protobuf//:field_mask_proto",
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:wrappers_proto",
],
)
proto_library_with_info(
name = "filestore_proto_with_info",
deps = [
":filestore_proto",
"//google/cloud/common:common_proto",
"//google/cloud:common_resources_proto",
],
)
##############################################################################
# Java
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
"java_gapic_library",
"java_gapic_test",
"java_grpc_library",
"java_proto_library",
)
java_proto_library(
name = "filestore_java_proto",
deps = [
":filestore_proto",
"//google/cloud/common:common_proto",
],
)
java_grpc_library(
name = "filestore_java_grpc",
srcs = [":filestore_proto"],
deps = [":filestore_java_proto"],
)
java_gapic_library(
name = "filestore_java_gapic",
srcs = [":filestore_proto_with_info"],
grpc_service_config = "file_grpc_service_config.json",
test_deps = [
":filestore_java_grpc",
],
deps = [
":filestore_java_proto",
"//google/cloud/common:common_proto",
],
)
java_gapic_test(
name = "filestore_java_gapic_test_suite",
test_classes = [
"com.google.cloud.filestore.v1.CloudFilestoreManagerClientTest",
],
runtime_deps = [":filestore_java_gapic_test"],
)
# Open Source Packages
java_gapic_assembly_gradle_pkg(
name = "google-cloud-filestore-v1-java",
deps = [
":filestore_java_gapic",
":filestore_java_grpc",
":filestore_java_proto",
":filestore_proto",
],
)
##############################################################################
# Go
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_gapic_assembly_pkg",
"go_gapic_library",
"go_proto_library",
"go_test",
)
go_proto_library(
name = "filestore_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "google.golang.org/genproto/googleapis/cloud/filestore/v1",
protos = [":filestore_proto"],
deps = [
"//google/api:annotations_go_proto",
"//google/cloud/common:common_go_proto",
"//google/longrunning:longrunning_go_proto",
],
)
go_gapic_library(
name = "filestore_go_gapic",
srcs = [":filestore_proto_with_info"],
grpc_service_config = "file_grpc_service_config.json",
importpath = "cloud.google.com/go/filestore/apiv1;filestore",
metadata = True,
service_yaml = "file_v1.yaml",
deps = [
":filestore_go_proto",
"//google/cloud/common:common_go_proto",
"//google/longrunning:longrunning_go_proto",
"@com_google_cloud_go//longrunning:go_default_library",
"@com_google_cloud_go//longrunning/autogen:go_default_library",
],
)
go_test(
name = "filestore_go_gapic_test",
srcs = [":filestore_go_gapic_srcjar_test"],
embed = [":filestore_go_gapic"],
importpath = "cloud.google.com/go/filestore/apiv1",
)
# Open Source Packages
go_gapic_assembly_pkg(
name = "gapi-cloud-filestore-v1-go",
deps = [
":filestore_go_gapic",
":filestore_go_gapic_srcjar-metadata.srcjar",
":filestore_go_gapic_srcjar-test.srcjar",
":filestore_go_proto",
],
)
##############################################################################
# Python
##############################################################################
#
# Commented out: Python generator cannot accept LRO metadata from a different
# proto namespace.
#
# load(
# "@com_google_googleapis_imports//:imports.bzl",
# "py_gapic_assembly_pkg",
# "py_gapic_library",
# )
# py_gapic_library(
# name = "filestore_py_gapic",
# srcs = [":filestore_proto_with_info"],
# grpc_service_config = "file_grpc_service_config.json",
# )
# # Open Source Packages
# py_gapic_assembly_pkg(
# name = "filestore-v1-py",
# deps = [
# ":filestore_py_gapic",
# ],
# )
##############################################################################
# PHP
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
"php_gapic_library",
"php_grpc_library",
"php_proto_library",
)
php_proto_library(
name = "filestore_php_proto",
deps = [":filestore_proto"],
)
php_grpc_library(
name = "filestore_php_grpc",
srcs = [":filestore_proto"],
deps = [":filestore_php_proto"],
)
php_gapic_library(
name = "filestore_php_gapic",
srcs = [":filestore_proto_with_info"],
grpc_service_config = "file_grpc_service_config.json",
service_yaml = "file_v1.yaml",
deps = [
":filestore_php_grpc",
":filestore_php_proto",
],
)
# Open Source Packages
php_gapic_assembly_pkg(
name = "google-cloud-filestore-v1-php",
deps = [
":filestore_php_gapic",
":filestore_php_grpc",
":filestore_php_proto",
],
)
##############################################################################
# Node.js
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
"nodejs_gapic_library",
)
nodejs_gapic_library(
name = "filestore_nodejs_gapic",
package_name = "@google-cloud/filestore",
src = ":filestore_proto_with_info",
extra_protoc_parameters = ["metadata"],
grpc_service_config = "file_grpc_service_config.json",
package = "google.cloud.filestore.v1",
service_yaml = "file_v1.yaml",
deps = [],
)
nodejs_gapic_assembly_pkg(
name = "filestore-v1-nodejs",
deps = [
":filestore_nodejs_gapic",
":filestore_proto",
],
)
##############################################################################
# Ruby
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_cloud_gapic_library",
"ruby_gapic_assembly_pkg",
"ruby_grpc_library",
"ruby_proto_library",
)
ruby_proto_library(
name = "filestore_ruby_proto",
deps = [":filestore_proto"],
)
ruby_grpc_library(
name = "filestore_ruby_grpc",
srcs = [":filestore_proto"],
deps = [":filestore_ruby_proto"],
)
ruby_cloud_gapic_library(
name = "filestore_ruby_gapic",
srcs = [":filestore_proto_with_info"],
extra_protoc_parameters = ["ruby-cloud-gem-name=google-cloud-filestore-v1"],
grpc_service_config = "file_grpc_service_config.json",
deps = [
":filestore_ruby_grpc",
":filestore_ruby_proto",
],
)
# Open Source Packages
ruby_gapic_assembly_pkg(
name = "google-cloud-filestore-v1-ruby",
deps = [
":filestore_ruby_gapic",
":filestore_ruby_grpc",
":filestore_ruby_proto",
],
)
##############################################################################
# C#
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_gapic_assembly_pkg",
"csharp_gapic_library",
"csharp_grpc_library",
"csharp_proto_library",
)
csharp_proto_library(
name = "filestore_csharp_proto",
deps = [":filestore_proto"],
)
csharp_grpc_library(
name = "filestore_csharp_grpc",
srcs = [":filestore_proto"],
deps = [":filestore_csharp_proto"],
)
csharp_gapic_library(
name = "filestore_csharp_gapic",
srcs = [":filestore_proto_with_info"],
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
grpc_service_config = "file_grpc_service_config.json",
deps = [
":filestore_csharp_grpc",
":filestore_csharp_proto",
],
)
# Open Source Packages
csharp_gapic_assembly_pkg(
name = "google-cloud-filestore-v1-csharp",
deps = [
":filestore_csharp_gapic",
":filestore_csharp_grpc",
":filestore_csharp_proto",
],
)
##############################################################################
# C++
##############################################################################
# Put your C++ rules here

@ -0,0 +1,719 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.filestore.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
option csharp_namespace = "Google.Cloud.Filestore.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/filestore/v1;filestore";
option java_multiple_files = true;
option java_outer_classname = "CloudFilestoreServiceProto";
option java_package = "com.google.cloud.filestore.v1";
option php_namespace = "Google\\Cloud\\Filestore\\V1";
// Configures and manages Cloud Filestore resources.
//
// Cloud Filestore Manager v1.
//
// The `file.googleapis.com` service implements the Cloud Filestore API and
// defines the following resource model for managing instances:
// * The service works with a collection of cloud projects, named: `/projects/*`
// * Each project has a collection of available locations, named: `/locations/*`
// * Each location has a collection of instances and backups, named:
// `/instances/*` and `/backups/*` respectively.
// * As such, Cloud Filestore instances are resources of the form:
// `/projects/{project_number}/locations/{location_id}/instances/{instance_id}`
// and backups are resources of the form:
// `/projects/{project_number}/locations/{location_id}/backup/{backup_id}`
//
// Note that location_id must be a GCP `zone` for instances and but to a GCP
// `region` for backups; for example:
// * `projects/12345/locations/us-central1-c/instances/my-filestore`
// * `projects/12345/locations/us-central1/backups/my-backup`
service CloudFilestoreManager {
option (google.api.default_host) = "file.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
// Lists all instances in a project for either a specified location
// or for all locations.
rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/instances"
};
option (google.api.method_signature) = "parent";
}
// Gets the details of a specific instance.
rpc GetInstance(GetInstanceRequest) returns (Instance) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/instances/*}"
};
option (google.api.method_signature) = "name";
}
// Creates an instance.
// When creating from a backup, the capacity of the new instance needs to be
// equal to or larger than the capacity of the backup (and also equal to or
// larger than the minimum capacity of the tier).
rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/instances"
body: "instance"
};
option (google.api.method_signature) = "parent,instance,instance_id";
option (google.longrunning.operation_info) = {
response_type: "Instance"
metadata_type: "google.cloud.common.OperationMetadata"
};
}
// Updates the settings of a specific instance.
rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1/{instance.name=projects/*/locations/*/instances/*}"
body: "instance"
};
option (google.api.method_signature) = "instance,update_mask";
option (google.longrunning.operation_info) = {
response_type: "Instance"
metadata_type: "google.cloud.common.OperationMetadata"
};
}
// Restores an existing instance's file share from a backup.
//
// The capacity of the instance needs to be equal to or larger than the
// capacity of the backup (and also equal to or larger than the minimum
// capacity of the tier).
rpc RestoreInstance(RestoreInstanceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/instances/*}:restore"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "Instance"
metadata_type: "google.cloud.common.OperationMetadata"
};
}
// Deletes an instance.
rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/instances/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.cloud.common.OperationMetadata"
};
}
// Lists all backups in a project for either a specified location or for all
// locations.
rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/backups"
};
option (google.api.method_signature) = "parent";
}
// Gets the details of a specific backup.
rpc GetBackup(GetBackupRequest) returns (Backup) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/backups/*}"
};
option (google.api.method_signature) = "name";
}
// Creates a backup.
rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/backups"
body: "backup"
};
option (google.api.method_signature) = "parent,backup,backup_id";
option (google.longrunning.operation_info) = {
response_type: "Backup"
metadata_type: "google.cloud.common.OperationMetadata"
};
}
// Deletes a backup.
rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/backups/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.cloud.common.OperationMetadata"
};
}
// Updates the settings of a specific backup.
rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1/{backup.name=projects/*/locations/*/backups/*}"
body: "backup"
};
option (google.api.method_signature) = "backup,update_mask";
option (google.longrunning.operation_info) = {
response_type: "Backup"
metadata_type: "google.cloud.common.OperationMetadata"
};
}
}
// Network configuration for the instance.
message NetworkConfig {
// Internet protocol versions supported by Cloud Filestore.
enum AddressMode {
// Internet protocol not set.
ADDRESS_MODE_UNSPECIFIED = 0;
// Use the IPv4 internet protocol.
MODE_IPV4 = 1;
}
// The name of the Google Compute Engine
// [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
// instance is connected.
string network = 1;
// Internet protocol versions for which the instance has IP addresses
// assigned. For this version, only MODE_IPV4 is supported.
repeated AddressMode modes = 3;
// A /29 CIDR block in one of the
// [internal IP address
// ranges](https://www.arin.net/knowledge/address_filters.html) that
// identifies the range of IP addresses reserved for this instance. For
// example, 10.0.0.0/29 or 192.168.0.0/29. The range you specify can't overlap
// with either existing subnets or assigned IP address ranges for other Cloud
// Filestore instances in the selected VPC network.
string reserved_ip_range = 4;
// Output only. IPv4 addresses in the format
// {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
// {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
// 7}:{block 8}.
repeated string ip_addresses = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// File share configuration for the instance.
message FileShareConfig {
// The name of the file share (must be 16 characters or less).
string name = 1;
// File share capacity in gigabytes (GB).
// Cloud Filestore defines 1 GB as 1024^3 bytes.
int64 capacity_gb = 2;
// The source that this file share has been restored from. Empty if the file
// share is created from scratch.
oneof source {
// The resource name of the backup, in the format
// projects/{project_number}/locations/{location_id}/backups/{backup_id},
// that this file share has been restored from.
string source_backup = 8 [(google.api.resource_reference) = {
type: "file.googleapis.com/Backup"
}];
}
// Nfs Export Options.
// There is a limit of 10 export options per file share.
repeated NfsExportOptions nfs_export_options = 7;
}
// NFS export options specifications.
message NfsExportOptions {
// The access mode.
enum AccessMode {
// AccessMode not set.
ACCESS_MODE_UNSPECIFIED = 0;
// The client can only read the file share.
READ_ONLY = 1;
// The client can read and write the file share (default).
READ_WRITE = 2;
}
// The squash mode.
enum SquashMode {
// SquashMode not set.
SQUASH_MODE_UNSPECIFIED = 0;
// The Root user has root access to the file share (default).
NO_ROOT_SQUASH = 1;
// The Root user has squashed access to the anonymous uid/gid.
ROOT_SQUASH = 2;
}
// List of either an IPv4 addresses in the format
// {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
// {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
// file share.
// Overlapping IP ranges are not allowed, both within and across
// NfsExportOptions. An error will be returned.
// The limit is 64 IP ranges/addresses for each FileShareConfig among all
// NfsExportOptions.
repeated string ip_ranges = 1;
// Either READ_ONLY, for allowing only read requests on the exported
// directory, or READ_WRITE, for allowing both read and write requests.
// The default is READ_WRITE.
AccessMode access_mode = 2;
// Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
// or ROOT_SQUASH, for not allowing root access. The default is
// NO_ROOT_SQUASH.
SquashMode squash_mode = 3;
// An integer representing the anonymous user id with a default value of
// 65534.
// Anon_uid may only be set with squash_mode of ROOT_SQUASH. An error will be
// returned if this field is specified for other squash_mode settings.
int64 anon_uid = 4;
// An integer representing the anonymous group id with a default value of
// 65534.
// Anon_gid may only be set with squash_mode of ROOT_SQUASH. An error will be
// returned if this field is specified for other squash_mode settings.
int64 anon_gid = 5;
}
// A Cloud Filestore instance.
message Instance {
option (google.api.resource) = {
type: "file.googleapis.com/Instance"
pattern: "projects/{project}/locations/{location}/instances/{instance}"
};
// The instance state.
enum State {
// State not set.
STATE_UNSPECIFIED = 0;
// The instance is being created.
CREATING = 1;
// The instance is available for use.
READY = 2;
// Work is being done on the instance. You can get further details from the
// `statusMessage` field of the `Instance` resource.
REPAIRING = 3;
// The instance is shutting down.
DELETING = 4;
// The instance is experiencing an issue and might be unusable. You can get
// further details from the `statusMessage` field of the `Instance`
// resource.
ERROR = 6;
// The instance is restoring a backup to an existing file share and may be
// unusable during this time.
RESTORING = 7;
}
// Available service tiers.
enum Tier {
// Not set.
TIER_UNSPECIFIED = 0;
// STANDARD tier.
STANDARD = 1;
// PREMIUM tier.
PREMIUM = 2;
// BASIC instances offer a maximum capacity of 63.9 TB.
// BASIC_HDD is an alias for STANDARD Tier, offering economical
// performance backed by HDD.
BASIC_HDD = 3;
// BASIC instances offer a maximum capacity of 63.9 TB.
// BASIC_SSD is an alias for PREMIUM Tier, and offers improved
// performance backed by SSD.
BASIC_SSD = 4;
// HIGH_SCALE instances offer expanded capacity and performance scaling
// capabilities.
HIGH_SCALE_SSD = 5;
}
// Output only. The resource name of the instance, in the format
// projects/{project}/locations/{location}/instances/{instance}.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// The description of the instance (2048 characters or less).
string description = 2;
// Output only. The instance state.
State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Additional information about the instance state, if available.
string status_message = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The time when the instance was created.
google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
// The service tier of the instance.
Tier tier = 8;
// Resource labels to represent user provided metadata.
map<string, string> labels = 9;
// File system shares on the instance.
// For this version, only a single file share is supported.
repeated FileShareConfig file_shares = 10;
// VPC networks to which the instance is connected.
// For this version, only a single network is supported.
repeated NetworkConfig networks = 11;
// Server-specified ETag for the instance resource to prevent simultaneous
// updates from overwriting each other.
string etag = 12;
// Output only. Reserved for future use.
google.protobuf.BoolValue satisfies_pzs = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// CreateInstanceRequest creates an instance.
message CreateInstanceRequest {
// Required. The instance's project and location, in the format
// projects/{project_id}/locations/{location}. In Cloud Filestore,
// locations map to GCP zones, for example **us-west1-b**.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
// Required. The name of the instance to create.
// The name must be unique for the specified project and location.
string instance_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. A [instance resource]
// (/cloud-filestore/reference/rest/v1/projects.locations.instances)
Instance instance = 3 [(google.api.field_behavior) = REQUIRED];
}
// GetInstanceRequest gets the state of an instance.
message GetInstanceRequest {
// Required. The instance resource name, in the format
// projects/{project_id}/locations/{location}/instances/{instance_id}.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "file.googleapis.com/Instance"
}
];
}
// UpdateInstanceRequest updates the settings of an instance.
message UpdateInstanceRequest {
// Mask of fields to update. At least one path must be supplied in this
// field. The elements of the repeated paths field may only include these
// fields:
//
// * "description"
// * "file_shares"
// * "labels"
google.protobuf.FieldMask update_mask = 1;
// Only fields specified in update_mask are updated.
Instance instance = 2;
}
// RestoreInstanceRequest restores an existing instances's file share from a
// backup.
message RestoreInstanceRequest {
// Required. The resource name of the instance, in the format
// projects/{project_number}/locations/{location_id}/instances/{instance_id}.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "file.googleapis.com/Instance"
}
];
// Required. Name of the file share in the Cloud Filestore instance that the backup
// is being restored to.
string file_share = 2 [(google.api.field_behavior) = REQUIRED];
oneof source {
// The resource name of the backup, in the format
// projects/{project_number}/locations/{location_id}/backups/{backup_id}.
string source_backup = 3 [(google.api.resource_reference) = {
type: "file.googleapis.com/Backup"
}];
}
}
// DeleteInstanceRequest deletes an instance.
message DeleteInstanceRequest {
// Required. The instance resource name, in the format
// projects/{project_id}/locations/{location}/instances/{instance_id}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "file.googleapis.com/Instance"
}
];
}
// ListInstancesRequest lists instances.
message ListInstancesRequest {
// Required. The project and location for which to retrieve instance information,
// in the format projects/{project_id}/locations/{location}. In Cloud
// Filestore, locations map to GCP zones, for example **us-west1-b**. To
// retrieve instance information for all locations, use "-" for the {location}
// value.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
// The maximum number of items to return.
int32 page_size = 2;
// The next_page_token value to use if there are additional
// results to retrieve for this list request.
string page_token = 3;
// Sort results. Supported values are "name", "name desc" or "" (unsorted).
string order_by = 4;
// List filter.
string filter = 5;
}
// ListInstancesResponse is the result of ListInstancesRequest.
message ListInstancesResponse {
// A list of instances in the project for the specified location.
//
// If the {location} value in the request is "-", the response contains a list
// of instances from all locations. If any location is unreachable, the
// response will only return instances in reachable locations and the
// "unreachable" field will be populated with a list of unreachable locations.
repeated Instance instances = 1;
// The token you can use to retrieve the next page of results. Not returned
// if there are no more results in the list.
string next_page_token = 2;
// Locations that could not be reached.
repeated string unreachable = 3;
}
// A Cloud Filestore backup.
message Backup {
option (google.api.resource) = {
type: "file.googleapis.com/Backup"
pattern: "projects/{project}/locations/{location}/backups/{backup}"
};
// The backup state.
enum State {
// State not set.
STATE_UNSPECIFIED = 0;
// Backup is being created.
CREATING = 1;
// Backup has been taken and the operation is being finalized. At this
// point, changes to the file share will not be reflected in the backup.
FINALIZING = 2;
// Backup is available for use.
READY = 3;
// Backup is being deleted.
DELETING = 4;
}
// Output only. The resource name of the backup, in the format
// projects/{project_number}/locations/{location_id}/backups/{backup_id}.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// A description of the backup with 2048 characters or less.
// Requests with longer descriptions will be rejected.
string description = 2;
// Output only. The backup state.
State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The time when the backup was created.
google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// Resource labels to represent user provided metadata.
map<string, string> labels = 5;
// Output only. Capacity of the source file share when the backup was created.
int64 capacity_gb = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The size of the storage used by the backup. As backups share storage,
// this number is expected to change with backup creation/deletion.
int64 storage_bytes = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
// The resource name of the source Cloud Filestore instance, in the format
// projects/{project_number}/locations/{location_id}/instances/{instance_id},
// used to create this backup.
string source_instance = 8 [(google.api.resource_reference) = {
type: "file.googleapis.com/Instance"
}];
// Name of the file share in the source Cloud Filestore instance that the
// backup is created from.
string source_file_share = 9;
// Output only. The service tier of the source Cloud Filestore instance that this backup
// is created from.
Instance.Tier source_instance_tier = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Amount of bytes that will be downloaded if the backup is restored. This
// may be different than storage bytes, since sequential backups of the same
// disk will share storage.
int64 download_bytes = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Reserved for future use.
google.protobuf.BoolValue satisfies_pzs = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// CreateBackupRequest creates a backup.
message CreateBackupRequest {
// Required. The backup's project and location, in the format
// projects/{project_number}/locations/{location}. In Cloud Filestore,
// backup locations map to GCP regions, for example **us-west1**.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
// Required. A [backup resource]
// (/cloud-filestore/reference/rest/v1/projects.locations.backups)
Backup backup = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The ID to use for the backup.
// The ID must be unique within the specified project and location.
//
// This value must start with a lowercase letter followed by up to 62
// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
// Values that do not match this pattern will trigger an INVALID_ARGUMENT
// error.
string backup_id = 3 [(google.api.field_behavior) = REQUIRED];
}
// DeleteBackupRequest deletes a backup.
message DeleteBackupRequest {
// Required. The backup resource name, in the format
// projects/{project_number}/locations/{location}/backups/{backup_id}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "file.googleapis.com/Backup"
}
];
}
// UpdateBackupRequest updates description and/or labels for a backup.
message UpdateBackupRequest {
// Required. A [backup resource]
// (/cloud-filestore/reference/rest/v1/projects.locations.backups)
Backup backup = 1 [(google.api.field_behavior) = REQUIRED];
// Required. Mask of fields to update. At least one path must be supplied in this
// field.
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
}
// GetBackupRequest gets the state of a backup.
message GetBackupRequest {
// Required. The backup resource name, in the format
// projects/{project_number}/locations/{location}/backups/{backup_id}.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "file.googleapis.com/Backup"
}
];
}
// ListBackupsRequest lists backups.
message ListBackupsRequest {
// Required. The project and location for which to retrieve backup information,
// in the format projects/{project_number}/locations/{location}.
// In Cloud Filestore, backup locations map to GCP regions,
// for example **us-west1**.
// To retrieve backup information for all locations, use "-" for the
// {location} value.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
// The maximum number of items to return.
int32 page_size = 2;
// The next_page_token value to use if there are additional
// results to retrieve for this list request.
string page_token = 3;
// Sort results. Supported values are "name", "name desc" or "" (unsorted).
string order_by = 4;
// List filter.
string filter = 5;
}
// ListBackupsResponse is the result of ListBackupsRequest.
message ListBackupsResponse {
// A list of backups in the project for the specified location.
//
// If the {location} value in the request is "-", the response contains a list
// of backups from all locations. If any location is unreachable, the
// response will only return backups in reachable locations and the
// "unreachable" field will be populated with a list of unreachable
// locations.
repeated Backup backups = 1;
// The token you can use to retrieve the next page of results. Not returned
// if there are no more results in the list.
string next_page_token = 2;
// Locations that could not be reached.
repeated string unreachable = 3;
}

@ -0,0 +1,43 @@
{
"methodConfig": [
{
"name": [
{ "service": "google.cloud.filestore.v1.CloudFilestoreManager", "method": "ListInstances" },
{ "service": "google.cloud.filestore.v1.CloudFilestoreManager", "method": "GetInstance" },
{ "service": "google.cloud.filestore.v1.CloudFilestoreManager", "method": "ListBackups" },
{ "service": "google.cloud.filestore.v1.CloudFilestoreManager", "method": "GetBackup" }
],
"timeout": "60s",
"retryPolicy": {
"initialBackoff": "0.250s",
"maxBackoff": "32s",
"backoffMultiplier": 1.3,
"retryableStatusCodes": [
"UNAVAILABLE"
]
}
},
{
"name": [
{ "service": "google.cloud.filestore.v1.CloudFilestoreManager", "method": "CreateInstance" },
{ "service": "google.cloud.filestore.v1.CloudFilestoreManager", "method": "RestoreInstance" },
{ "service": "google.cloud.filestore.v1.CloudFilestoreManager", "method": "CreateBackup" }
],
"timeout": "60000s"
},
{
"name": [
{ "service": "google.cloud.filestore.v1.CloudFilestoreManager", "method": "UpdateInstance" }
],
"timeout": "14400s"
},
{
"name": [
{ "service": "google.cloud.filestore.v1.CloudFilestoreManager", "method": "DeleteInstance" },
{ "service": "google.cloud.filestore.v1.CloudFilestoreManager", "method": "DeleteBackup" },
{ "service": "google.cloud.filestore.v1.CloudFilestoreManager", "method": "UpdateBackup" }
],
"timeout": "600s"
}
]
}

@ -0,0 +1,64 @@
type: google.api.Service
config_version: 3
name: file.googleapis.com
title: Cloud Filestore API
apis:
- name: google.cloud.filestore.v1.CloudFilestoreManager
documentation:
summary: |-
The Cloud Filestore API is used for creating and managing cloud file
servers.
rules:
- selector: google.cloud.location.Locations.GetLocation
description: Gets information about a location.
- selector: google.cloud.location.Locations.ListLocations
description: Lists information about the supported locations for this service.
backend:
rules:
- selector: 'google.cloud.filestore.v1.CloudFilestoreManager.*'
deadline: 60.0
- selector: google.cloud.location.Locations.GetLocation
deadline: 60.0
- selector: google.cloud.location.Locations.ListLocations
deadline: 60.0
- selector: 'google.longrunning.Operations.*'
deadline: 60.0
http:
rules:
- selector: google.cloud.location.Locations.GetLocation
get: '/v1/{name=projects/*/locations/*}'
- selector: google.cloud.location.Locations.ListLocations
get: '/v1/{name=projects/*}/locations'
- selector: google.longrunning.Operations.CancelOperation
post: '/v1/{name=projects/*/locations/*/operations/*}:cancel'
body: '*'
- selector: google.longrunning.Operations.DeleteOperation
delete: '/v1/{name=projects/*/locations/*/operations/*}'
- selector: google.longrunning.Operations.GetOperation
get: '/v1/{name=projects/*/locations/*/operations/*}'
- selector: google.longrunning.Operations.ListOperations
get: '/v1/{name=projects/*/locations/*}/operations'
authentication:
rules:
- selector: 'google.cloud.filestore.v1.CloudFilestoreManager.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.cloud.location.Locations.GetLocation
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.cloud.location.Locations.ListLocations
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.longrunning.Operations.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform

@ -0,0 +1,350 @@
# This file was automatically generated by BuildFileGenerator
# https://github.com/googleapis/rules_gapic/tree/master/bazel
# Most of the manual changes to this file will be overwritten.
# It's **only** allowed to change the following rule attribute values:
# - names of *_gapic_assembly_* rules
# - certain parameters of *_gapic_library rules, including but not limited to:
# * extra_protoc_parameters
# * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code.
# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])
##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
proto_library(
name = "filestore_proto",
srcs = [
"cloud_filestore_service.proto",
],
deps = [
"//google/api:annotations_proto",
"//google/api:client_proto",
"//google/api:field_behavior_proto",
"//google/api:resource_proto",
"//google/cloud/common:common_proto",
"//google/longrunning:operations_proto",
"@com_google_protobuf//:field_mask_proto",
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:wrappers_proto",
],
)
proto_library_with_info(
name = "filestore_proto_with_info",
deps = [
":filestore_proto",
"//google/cloud/common:common_proto",
"//google/cloud:common_resources_proto",
],
)
##############################################################################
# Java
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
"java_gapic_library",
"java_gapic_test",
"java_grpc_library",
"java_proto_library",
)
java_proto_library(
name = "filestore_java_proto",
deps = [
":filestore_proto",
"//google/cloud/common:common_proto",
],
)
java_grpc_library(
name = "filestore_java_grpc",
srcs = [":filestore_proto"],
deps = [":filestore_java_proto"],
)
java_gapic_library(
name = "filestore_java_gapic",
srcs = [":filestore_proto_with_info"],
grpc_service_config = "file_grpc_service_config.json",
test_deps = [
":filestore_java_grpc",
],
deps = [
":filestore_java_proto",
"//google/cloud/common:common_proto",
],
)
java_gapic_test(
name = "filestore_java_gapic_test_suite",
test_classes = [
"com.google.cloud.filestore.v1beta1.CloudFilestoreManagerClientTest",
],
runtime_deps = [":filestore_java_gapic_test"],
)
# Open Source Packages
java_gapic_assembly_gradle_pkg(
name = "google-cloud-filestore-v1beta1-java",
deps = [
":filestore_java_gapic",
":filestore_java_grpc",
":filestore_java_proto",
":filestore_proto",
],
)
##############################################################################
# Go
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_gapic_assembly_pkg",
"go_gapic_library",
"go_proto_library",
"go_test",
)
go_proto_library(
name = "filestore_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "google.golang.org/genproto/googleapis/cloud/filestore/v1beta1",
protos = [":filestore_proto"],
deps = [
"//google/api:annotations_go_proto",
"//google/cloud/common:common_go_proto",
"//google/longrunning:longrunning_go_proto",
],
)
go_gapic_library(
name = "filestore_go_gapic",
srcs = [":filestore_proto_with_info"],
grpc_service_config = "file_grpc_service_config.json",
importpath = "cloud.google.com/go/filestore/apiv1beta1;filestore",
metadata = True,
service_yaml = "file_v1beta1.yaml",
deps = [
":filestore_go_proto",
"//google/cloud/common:common_go_proto",
"//google/longrunning:longrunning_go_proto",
"@com_google_cloud_go//longrunning:go_default_library",
"@com_google_cloud_go//longrunning/autogen:go_default_library",
],
)
go_test(
name = "filestore_go_gapic_test",
srcs = [":filestore_go_gapic_srcjar_test"],
embed = [":filestore_go_gapic"],
importpath = "cloud.google.com/go/filestore/apiv1beta1",
)
# Open Source Packages
go_gapic_assembly_pkg(
name = "gapi-cloud-filestore-v1beta1-go",
deps = [
":filestore_go_gapic",
":filestore_go_gapic_srcjar-metadata.srcjar",
":filestore_go_gapic_srcjar-test.srcjar",
":filestore_go_proto",
],
)
##############################################################################
# Python
##############################################################################
#
# Commented out: Python generator cannot accept LRO metadata from a different
# proto namespace.
#
# load(
# "@com_google_googleapis_imports//:imports.bzl",
# "py_gapic_assembly_pkg",
# "py_gapic_library",
# )
# py_gapic_library(
# name = "filestore_py_gapic",
# srcs = [":filestore_proto_with_info"],
# grpc_service_config = "file_grpc_service_config.json",
# )
# # Open Source Packages
# py_gapic_assembly_pkg(
# name = "filestore-v1beta1-py",
# deps = [
# ":filestore_py_gapic",
# ],
# )
##############################################################################
# PHP
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
"php_gapic_library",
"php_grpc_library",
"php_proto_library",
)
php_proto_library(
name = "filestore_php_proto",
deps = [":filestore_proto"],
)
php_grpc_library(
name = "filestore_php_grpc",
srcs = [":filestore_proto"],
deps = [":filestore_php_proto"],
)
php_gapic_library(
name = "filestore_php_gapic",
srcs = [":filestore_proto_with_info"],
grpc_service_config = "file_grpc_service_config.json",
service_yaml = "file_v1beta1.yaml",
deps = [
":filestore_php_grpc",
":filestore_php_proto",
],
)
# Open Source Packages
php_gapic_assembly_pkg(
name = "google-cloud-filestore-v1beta1-php",
deps = [
":filestore_php_gapic",
":filestore_php_grpc",
":filestore_php_proto",
],
)
##############################################################################
# Node.js
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
"nodejs_gapic_library",
)
nodejs_gapic_library(
name = "filestore_nodejs_gapic",
package_name = "@google-cloud/filestore",
src = ":filestore_proto_with_info",
extra_protoc_parameters = ["metadata"],
grpc_service_config = "file_grpc_service_config.json",
package = "google.cloud.filestore.v1beta1",
service_yaml = "file_v1beta1.yaml",
deps = [],
)
nodejs_gapic_assembly_pkg(
name = "filestore-v1beta1-nodejs",
deps = [
":filestore_nodejs_gapic",
":filestore_proto",
],
)
##############################################################################
# Ruby
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_cloud_gapic_library",
"ruby_gapic_assembly_pkg",
"ruby_grpc_library",
"ruby_proto_library",
)
ruby_proto_library(
name = "filestore_ruby_proto",
deps = [":filestore_proto"],
)
ruby_grpc_library(
name = "filestore_ruby_grpc",
srcs = [":filestore_proto"],
deps = [":filestore_ruby_proto"],
)
ruby_cloud_gapic_library(
name = "filestore_ruby_gapic",
srcs = [":filestore_proto_with_info"],
extra_protoc_parameters = ["ruby-cloud-gem-name=google-cloud-filestore-v1beta1"],
grpc_service_config = "file_grpc_service_config.json",
deps = [
":filestore_ruby_grpc",
":filestore_ruby_proto",
],
)
# Open Source Packages
ruby_gapic_assembly_pkg(
name = "google-cloud-filestore-v1beta1-ruby",
deps = [
":filestore_ruby_gapic",
":filestore_ruby_grpc",
":filestore_ruby_proto",
],
)
##############################################################################
# C#
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_gapic_assembly_pkg",
"csharp_gapic_library",
"csharp_grpc_library",
"csharp_proto_library",
)
csharp_proto_library(
name = "filestore_csharp_proto",
deps = [":filestore_proto"],
)
csharp_grpc_library(
name = "filestore_csharp_grpc",
srcs = [":filestore_proto"],
deps = [":filestore_csharp_proto"],
)
csharp_gapic_library(
name = "filestore_csharp_gapic",
srcs = [":filestore_proto_with_info"],
common_resources_config = "@gax_dotnet//:Google.Api.Gax/ResourceNames/CommonResourcesConfig.json",
grpc_service_config = "file_grpc_service_config.json",
deps = [
":filestore_csharp_grpc",
":filestore_csharp_proto",
],
)
# Open Source Packages
csharp_gapic_assembly_pkg(
name = "google-cloud-filestore-v1beta1-csharp",
deps = [
":filestore_csharp_gapic",
":filestore_csharp_grpc",
":filestore_csharp_proto",
],
)
##############################################################################
# C++
##############################################################################
# Put your C++ rules here

@ -0,0 +1,732 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.filestore.v1beta1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
option csharp_namespace = "Google.Cloud.Filestore.V1Beta1";
option go_package = "google.golang.org/genproto/googleapis/cloud/filestore/v1beta1;filestore";
option java_multiple_files = true;
option java_outer_classname = "CloudFilestoreServiceProto";
option java_package = "com.google.cloud.filestore.v1beta1";
option php_namespace = "Google\\Cloud\\Filestore\\V1beta1";
option (google.api.resource_definition) = {
type: "file.googleapis.com/Snapshot"
pattern: "projects/{project}/locations/{location}/snapshots/{snapshot}"
};
// Configures and manages Cloud Filestore resources.
//
// Cloud Filestore Manager v1beta1.
//
// The `file.googleapis.com` service implements the Cloud Filestore API and
// defines the following model for managing resources:
// * The service works with a collection of cloud projects, named: `/projects/*`
// * Each project has a collection of available locations, named: `/locations/*`
// * Each location has a collection of instances and backups, named:
// `/instances/*` and `/backups/*` respectively.
// * As such, Cloud Filestore instances are resources of the form:
// `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
// backups are resources of the form:
// `/projects/{project_id}/locations/{location_id}/backup/{backup_id}`
//
// Note that location_id can represent a GCP `zone` or `region` depending on the
// resource.
// for example:
// A zonal Filestore instance:
// * `projects/my-project/locations/us-central1-c/instances/my-basic-tier-filer`
// A regional Filestore instance:
// * `projects/my-project/locations/us-central1/instances/my-enterprise-filer`
service CloudFilestoreManager {
option (google.api.default_host) = "file.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
// Lists all instances in a project for either a specified location
// or for all locations.
rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) {
option (google.api.http) = {
get: "/v1beta1/{parent=projects/*/locations/*}/instances"
};
option (google.api.method_signature) = "parent";
}
// Gets the details of a specific instance.
rpc GetInstance(GetInstanceRequest) returns (Instance) {
option (google.api.http) = {
get: "/v1beta1/{name=projects/*/locations/*/instances/*}"
};
option (google.api.method_signature) = "name";
}
// Creates an instance.
// When creating from a backup, the capacity of the new instance needs to be
// equal to or larger than the capacity of the backup (and also equal to or
// larger than the minimum capacity of the tier).
rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta1/{parent=projects/*/locations/*}/instances"
body: "instance"
};
option (google.api.method_signature) = "parent,instance,instance_id";
option (google.longrunning.operation_info) = {
response_type: "Instance"
metadata_type: "google.cloud.common.OperationMetadata"
};
}
// Updates the settings of a specific instance.
rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1beta1/{instance.name=projects/*/locations/*/instances/*}"
body: "instance"
};
option (google.api.method_signature) = "instance,update_mask";
option (google.longrunning.operation_info) = {
response_type: "Instance"
metadata_type: "google.cloud.common.OperationMetadata"
};
}
// Restores an existing instance's file share from a backup.
//
// The capacity of the instance needs to be equal to or larger than the
// capacity of the backup (and also equal to or larger than the minimum
// capacity of the tier).
rpc RestoreInstance(RestoreInstanceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta1/{name=projects/*/locations/*/instances/*}:restore"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "Instance"
metadata_type: "google.cloud.common.OperationMetadata"
};
}
// Deletes an instance.
rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1beta1/{name=projects/*/locations/*/instances/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.cloud.common.OperationMetadata"
};
}
// Lists all backups in a project for either a specified location or for all
// locations.
rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) {
option (google.api.http) = {
get: "/v1beta1/{parent=projects/*/locations/*}/backups"
};
option (google.api.method_signature) = "parent";
}
// Gets the details of a specific backup.
rpc GetBackup(GetBackupRequest) returns (Backup) {
option (google.api.http) = {
get: "/v1beta1/{name=projects/*/locations/*/backups/*}"
};
option (google.api.method_signature) = "name";
}
// Creates a backup.
rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta1/{parent=projects/*/locations/*}/backups"
body: "backup"
};
option (google.api.method_signature) = "parent,backup,backup_id";
option (google.longrunning.operation_info) = {
response_type: "Backup"
metadata_type: "google.cloud.common.OperationMetadata"
};
}
// Deletes a backup.
rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1beta1/{name=projects/*/locations/*/backups/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "google.cloud.common.OperationMetadata"
};
}
// Updates the settings of a specific backup.
rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1beta1/{backup.name=projects/*/locations/*/backups/*}"
body: "backup"
};
option (google.api.method_signature) = "backup,update_mask";
option (google.longrunning.operation_info) = {
response_type: "Backup"
metadata_type: "google.cloud.common.OperationMetadata"
};
}
}
// Network configuration for the instance.
message NetworkConfig {
// Internet protocol versions supported by Cloud Filestore.
enum AddressMode {
// Internet protocol not set.
ADDRESS_MODE_UNSPECIFIED = 0;
// Use the IPv4 internet protocol.
MODE_IPV4 = 1;
}
// The name of the Google Compute Engine
// [VPC network](/compute/docs/networks-and-firewalls#networks) to which the
// instance is connected.
string network = 1;
// Internet protocol versions for which the instance has IP addresses
// assigned. For this version, only MODE_IPV4 is supported.
repeated AddressMode modes = 3;
// A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the
// [internal IP address
// ranges](https://www.arin.net/knowledge/address_filters.html) that
// identifies the range of IP addresses reserved for this instance. For
// example, 10.0.0.0/29 or 192.168.0.0/23. The range you specify can't overlap
// with either existing subnets or assigned IP address ranges for other Cloud
// Filestore instances in the selected VPC network.
string reserved_ip_range = 4;
// Output only. IPv4 addresses in the format
// {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format
// {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block
// 7}:{block 8}.
repeated string ip_addresses = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// File share configuration for the instance.
message FileShareConfig {
// The name of the file share (must be 16 characters or less).
string name = 1;
// File share capacity in gigabytes (GB).
// Cloud Filestore defines 1 GB as 1024^3 bytes.
int64 capacity_gb = 2;
// The source that this file share has been restored from. Empty if the file
// share is created from scratch.
oneof source {
// The resource name of the backup, in the format
// projects/{project_id}/locations/{location_id}/backups/{backup_id}, that
// this file share has been restored from.
string source_backup = 9 [(google.api.resource_reference) = {
type: "file.googleapis.com/Backup"
}];
}
// Nfs Export Options.
// There is a limit of 10 export options per file share.
repeated NfsExportOptions nfs_export_options = 8;
}
// NFS export options specifications.
message NfsExportOptions {
// The access mode.
enum AccessMode {
// AccessMode not set.
ACCESS_MODE_UNSPECIFIED = 0;
// The client can only read the file share.
READ_ONLY = 1;
// The client can read and write the file share (default).
READ_WRITE = 2;
}
// The squash mode.
enum SquashMode {
// SquashMode not set.
SQUASH_MODE_UNSPECIFIED = 0;
// The Root user has root access to the file share (default).
NO_ROOT_SQUASH = 1;
// The Root user has squashed access to the anonymous uid/gid.
ROOT_SQUASH = 2;
}
// List of either an IPv4 addresses in the format
// {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format
// {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the
// file share.
// Overlapping IP ranges are not allowed, both within and across
// NfsExportOptions. An error will be returned.
// The limit is 64 IP ranges/addresses for each FileShareConfig among all
// NfsExportOptions.
repeated string ip_ranges = 1;
// Either READ_ONLY, for allowing only read requests on the exported
// directory, or READ_WRITE, for allowing both read and write requests.
// The default is READ_WRITE.
AccessMode access_mode = 2;
// Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
// or ROOT_SQUASH, for not allowing root access. The default is
// NO_ROOT_SQUASH.
SquashMode squash_mode = 3;
// An integer representing the anonymous user id with a default value of
// 65534.
// Anon_uid may only be set with squash_mode of ROOT_SQUASH. An error will be
// returned if this field is specified for other squash_mode settings.
int64 anon_uid = 4;
// An integer representing the anonymous group id with a default value of
// 65534.
// Anon_gid may only be set with squash_mode of ROOT_SQUASH. An error will be
// returned if this field is specified for other squash_mode settings.
int64 anon_gid = 5;
}
// A Cloud Filestore instance.
message Instance {
option (google.api.resource) = {
type: "file.googleapis.com/Instance"
pattern: "projects/{project}/locations/{location}/instances/{instance}"
};
// The instance state.
enum State {
// State not set.
STATE_UNSPECIFIED = 0;
// The instance is being created.
CREATING = 1;
// The instance is available for use.
READY = 2;
// Work is being done on the instance. You can get further details from the
// `statusMessage` field of the `Instance` resource.
REPAIRING = 3;
// The instance is shutting down.
DELETING = 4;
// The instance is experiencing an issue and might be unusable. You can get
// further details from the `statusMessage` field of the `Instance`
// resource.
ERROR = 6;
// The instance is restoring a snapshot or backup to an existing file share
// and may be unusable during this time.
RESTORING = 7;
}
// Available service tiers.
enum Tier {
// Not set.
TIER_UNSPECIFIED = 0;
// STANDARD tier. BASIC_HDD is the preferred term for this tier.
STANDARD = 1;
// PREMIUM tier. BASIC_SSD is the preferred term for this tier.
PREMIUM = 2;
// BASIC instances offer a maximum capacity of 63.9 TB.
// BASIC_HDD is an alias for STANDARD Tier, offering economical
// performance backed by HDD.
BASIC_HDD = 3;
// BASIC instances offer a maximum capacity of 63.9 TB.
// BASIC_SSD is an alias for PREMIUM Tier, and offers improved
// performance backed by SSD.
BASIC_SSD = 4;
// HIGH_SCALE instances offer expanded capacity and performance scaling
// capabilities.
HIGH_SCALE_SSD = 6;
}
// Output only. The resource name of the instance, in the format
// projects/{project_id}/locations/{location_id}/instances/{instance_id}.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// The description of the instance (2048 characters or less).
string description = 2;
// Output only. The instance state.
State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Additional information about the instance state, if available.
string status_message = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The time when the instance was created.
google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
// The service tier of the instance.
Tier tier = 8;
// Resource labels to represent user provided metadata.
map<string, string> labels = 9;
// File system shares on the instance.
// For this version, only a single file share is supported.
repeated FileShareConfig file_shares = 10;
// VPC networks to which the instance is connected.
// For this version, only a single network is supported.
repeated NetworkConfig networks = 11;
// Server-specified ETag for the instance resource to prevent simultaneous
// updates from overwriting each other.
string etag = 12;
// Output only. Reserved for future use.
google.protobuf.BoolValue satisfies_pzs = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// CreateInstanceRequest creates an instance.
message CreateInstanceRequest {
// Required. The instance's project and location, in the format
// projects/{project_id}/locations/{location}. In Cloud Filestore,
// locations map to GCP zones, for example **us-west1-b**.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
// Required. The ID of the instance to create.
// The ID must be unique within the specified project and location.
//
// This value must start with a lowercase letter followed by up to 62
// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
string instance_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. A [instance resource]
// (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances)
Instance instance = 3 [(google.api.field_behavior) = REQUIRED];
}
// GetInstanceRequest gets the state of an instance.
message GetInstanceRequest {
// Required. The instance resource name, in the format
// projects/{project_id}/locations/{location}/instances/{instance_id}.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "file.googleapis.com/Instance"
}
];
}
// UpdateInstanceRequest updates the settings of an instance.
message UpdateInstanceRequest {
// Required. Mask of fields to update. At least one path must be supplied in this
// field. The elements of the repeated paths field may only include these
// fields:
//
// * "description"
// * "file_shares"
// * "labels"
google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED];
// Required. Only fields specified in update_mask are updated.
Instance instance = 2 [(google.api.field_behavior) = REQUIRED];
}
// RestoreInstanceRequest restores an existing instances's file share from a
// snapshot or backup.
message RestoreInstanceRequest {
// Required. The resource name of the instance, in the format
// projects/{project_id}/locations/{location_id}/instances/{instance_id}.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "file.googleapis.com/Instance"
}
];
// Required. Name of the file share in the Cloud Filestore instance that the snapshot
// is being restored to.
string file_share = 2 [(google.api.field_behavior) = REQUIRED];
oneof source {
// The resource name of the snapshot, in the format
// projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}.
string source_snapshot = 3 [(google.api.resource_reference) = {
type: "file.googleapis.com/Snapshot"
}];
// The resource name of the backup, in the format
// projects/{project_id}/locations/{location_id}/backups/{backup_id}.
string source_backup = 4 [(google.api.resource_reference) = {
type: "file.googleapis.com/Backup"
}];
}
}
// DeleteInstanceRequest deletes an instance.
message DeleteInstanceRequest {
// Required. The instance resource name, in the format
// projects/{project_id}/locations/{location}/instances/{instance_id}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "file.googleapis.com/Instance"
}
];
}
// ListInstancesRequest lists instances.
message ListInstancesRequest {
// Required. The project and location for which to retrieve instance information,
// in the format projects/{project_id}/locations/{location}. In Cloud
// Filestore, locations map to GCP zones, for example **us-west1-b**. To
// retrieve instance information for all locations, use "-" for the {location}
// value.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
// The maximum number of items to return.
int32 page_size = 2;
// The next_page_token value to use if there are additional
// results to retrieve for this list request.
string page_token = 3;
// Sort results. Supported values are "name", "name desc" or "" (unsorted).
string order_by = 4;
// List filter.
string filter = 5;
}
// ListInstancesResponse is the result of ListInstancesRequest.
message ListInstancesResponse {
// A list of instances in the project for the specified location.
//
// If the {location} value in the request is "-", the response contains a list
// of instances from all locations. If any location is unreachable, the
// response will only return instances in reachable locations and the
// "unreachable" field will be populated with a list of unreachable locations.
repeated Instance instances = 1;
// The token you can use to retrieve the next page of results. Not returned
// if there are no more results in the list.
string next_page_token = 2;
// Locations that could not be reached.
repeated string unreachable = 3;
}
// A Cloud Filestore backup.
message Backup {
option (google.api.resource) = {
type: "file.googleapis.com/Backup"
pattern: "projects/{project}/locations/{location}/backups/{backup}"
};
// The backup state.
enum State {
// State not set.
STATE_UNSPECIFIED = 0;
// Backup is being created.
CREATING = 1;
// Backup has been taken and the operation is being finalized. At this
// point, changes to the file share will not be reflected in the backup.
FINALIZING = 2;
// Backup is available for use.
READY = 3;
// Backup is being deleted.
DELETING = 4;
}
// Output only. The resource name of the backup, in the format
// projects/{project_id}/locations/{location_id}/backups/{backup_id}.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// A description of the backup with 2048 characters or less.
// Requests with longer descriptions will be rejected.
string description = 2;
// Output only. The backup state.
State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The time when the backup was created.
google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
// Resource labels to represent user provided metadata.
map<string, string> labels = 5;
// Output only. Capacity of the source file share when the backup was created.
int64 capacity_gb = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The size of the storage used by the backup. As backups share storage,
// this number is expected to change with backup creation/deletion.
int64 storage_bytes = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
// The resource name of the source Cloud Filestore instance, in the format
// projects/{project_id}/locations/{location_id}/instances/{instance_id},
// used to create this backup.
string source_instance = 8 [(google.api.resource_reference) = {
type: "file.googleapis.com/Instance"
}];
// Name of the file share in the source Cloud Filestore instance that the
// backup is created from.
string source_file_share = 9;
// Output only. The service tier of the source Cloud Filestore instance that this backup
// is created from.
Instance.Tier source_instance_tier = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Amount of bytes that will be downloaded if the backup is restored
int64 download_bytes = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Reserved for future use.
google.protobuf.BoolValue satisfies_pzs = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// CreateBackupRequest creates a backup.
message CreateBackupRequest {
// Required. The backup's project and location, in the format
// projects/{project_id}/locations/{location}. In Cloud Filestore,
// backup locations map to GCP regions, for example **us-west1**.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
// Required. A [backup resource]
// (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
Backup backup = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The ID to use for the backup.
// The ID must be unique within the specified project and location.
//
// This value must start with a lowercase letter followed by up to 62
// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
string backup_id = 3 [(google.api.field_behavior) = REQUIRED];
}
// DeleteBackupRequest deletes a backup.
message DeleteBackupRequest {
// Required. The backup resource name, in the format
// projects/{project_id}/locations/{location}/backups/{backup_id}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "file.googleapis.com/Backup"
}
];
}
// UpdateBackupRequest updates description and/or labels for a backup.
message UpdateBackupRequest {
// Required. A [backup resource]
// (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups)
Backup backup = 1 [(google.api.field_behavior) = REQUIRED];
// Required. Mask of fields to update. At least one path must be supplied in this
// field.
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
}
// GetBackupRequest gets the state of a backup.
message GetBackupRequest {
// Required. The backup resource name, in the format
// projects/{project_id}/locations/{location}/backups/{backup_id}.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "file.googleapis.com/Backup"
}
];
}
// ListBackupsRequest lists backups.
message ListBackupsRequest {
// Required. The project and location for which to retrieve backup information,
// in the format projects/{project_id}/locations/{location}.
// In Cloud Filestore, backup locations map to GCP regions,
// for example **us-west1**.
// To retrieve backup information for all locations, use "-" for the
// {location} value.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
// The maximum number of items to return.
int32 page_size = 2;
// The next_page_token value to use if there are additional
// results to retrieve for this list request.
string page_token = 3;
// Sort results. Supported values are "name", "name desc" or "" (unsorted).
string order_by = 4;
// List filter.
string filter = 5;
}
// ListBackupsResponse is the result of ListBackupsRequest.
message ListBackupsResponse {
// A list of backups in the project for the specified location.
//
// If the {location} value in the request is "-", the response contains a list
// of backups from all locations. If any location is unreachable, the
// response will only return backups in reachable locations and the
// "unreachable" field will be populated with a list of unreachable
// locations.
repeated Backup backups = 1;
// The token you can use to retrieve the next page of results. Not returned
// if there are no more results in the list.
string next_page_token = 2;
// Locations that could not be reached.
repeated string unreachable = 3;
}

@ -0,0 +1,48 @@
{
"methodConfig": [
{
"name": [
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "ListInstances" },
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "GetInstance" },
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "ListBackups" },
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "GetBackup" },
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "ListSnapshots" },
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "GetSnapshots" }
],
"timeout": "60s",
"retryPolicy": {
"initialBackoff": "0.250s",
"maxBackoff": "32s",
"backoffMultiplier": 1.3,
"retryableStatusCodes": [
"UNAVAILABLE"
]
}
},
{
"name": [
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "CreateInstance" },
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "RestoreInstance" },
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "CreateBackup" }
],
"timeout": "60000s"
},
{
"name": [
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "UpdateInstance" }
],
"timeout": "14400s"
},
{
"name": [
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "DeleteInstance" },
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "DeleteBackup" },
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "UpdateBackup" },
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "CreateSnapshot" },
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "DeleteSnapshot" },
{ "service": "google.cloud.filestore.v1beta1.CloudFilestoreManager", "method": "UpdateSnapshot" }
],
"timeout": "600s"
}
]
}

@ -0,0 +1,64 @@
type: google.api.Service
config_version: 3
name: file.googleapis.com
title: Cloud Filestore API
apis:
- name: google.cloud.filestore.v1beta1.CloudFilestoreManager
documentation:
summary: |-
The Cloud Filestore API is used for creating and managing cloud file
servers.
rules:
- selector: google.cloud.location.Locations.GetLocation
description: Gets information about a location.
- selector: google.cloud.location.Locations.ListLocations
description: Lists information about the supported locations for this service.
backend:
rules:
- selector: 'google.cloud.filestore.v1beta1.CloudFilestoreManager.*'
deadline: 60.0
- selector: google.cloud.location.Locations.GetLocation
deadline: 60.0
- selector: google.cloud.location.Locations.ListLocations
deadline: 60.0
- selector: 'google.longrunning.Operations.*'
deadline: 60.0
http:
rules:
- selector: google.cloud.location.Locations.GetLocation
get: '/v1beta1/{name=projects/*/locations/*}'
- selector: google.cloud.location.Locations.ListLocations
get: '/v1beta1/{name=projects/*}/locations'
- selector: google.longrunning.Operations.CancelOperation
post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel'
body: '*'
- selector: google.longrunning.Operations.DeleteOperation
delete: '/v1beta1/{name=projects/*/locations/*/operations/*}'
- selector: google.longrunning.Operations.GetOperation
get: '/v1beta1/{name=projects/*/locations/*/operations/*}'
- selector: google.longrunning.Operations.ListOperations
get: '/v1beta1/{name=projects/*/locations/*}/operations'
authentication:
rules:
- selector: 'google.cloud.filestore.v1beta1.CloudFilestoreManager.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.cloud.location.Locations.GetLocation
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.cloud.location.Locations.ListLocations
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: 'google.longrunning.Operations.*'
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
Loading…
Cancel
Save