Filestore V1 API - Class Google::Cloud::Filestore::V1::CloudFilestoreManager::Client (v0.1.3)

Reference documentation and code samples for the Filestore V1 API class Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.

Client for the CloudFilestoreManager service.

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

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the CloudFilestoreManager Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all CloudFilestoreManager clients
::Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the CloudFilestoreManager Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_backup

def create_backup(request, options = nil) -> ::Gapic::Operation
def create_backup(parent: nil, backup: nil, backup_id: nil) -> ::Gapic::Operation

Creates a backup.

Overloads
def create_backup(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_backup via a request object, either of type Google::Cloud::Filestore::V1::CreateBackupRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::CreateBackupRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_backup(parent: nil, backup: nil, backup_id: nil) -> ::Gapic::Operation
Pass arguments to create_backup via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — 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.
  • backup (::Google::Cloud::Filestore::V1::Backup, ::Hash) — Required. A backup resource
  • backup_id (::String) — 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.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/filestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Filestore::V1::CreateBackupRequest.new

# Call the create_backup method.
result = client.create_backup request

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end

#create_instance

def create_instance(request, options = nil) -> ::Gapic::Operation
def create_instance(parent: nil, instance_id: nil, instance: nil) -> ::Gapic::Operation

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).

Overloads
def create_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_instance via a request object, either of type Google::Cloud::Filestore::V1::CreateInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::CreateInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_instance(parent: nil, instance_id: nil, instance: nil) -> ::Gapic::Operation
Pass arguments to create_instance via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — 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.
  • instance_id (::String) — Required. The name of the instance to create. The name must be unique for the specified project and location.
  • instance (::Google::Cloud::Filestore::V1::Instance, ::Hash) — Required. An instance resource
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/filestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Filestore::V1::CreateInstanceRequest.new

# Call the create_instance method.
result = client.create_instance request

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end

#delete_backup

def delete_backup(request, options = nil) -> ::Gapic::Operation
def delete_backup(name: nil) -> ::Gapic::Operation

Deletes a backup.

Overloads
def delete_backup(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_backup via a request object, either of type DeleteBackupRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::DeleteBackupRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_backup(name: nil) -> ::Gapic::Operation
Pass arguments to delete_backup via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The backup resource name, in the format projects/{project_number}/locations/{location}/backups/{backup_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/filestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Filestore::V1::DeleteBackupRequest.new

# Call the delete_backup method.
result = client.delete_backup request

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end

#delete_instance

def delete_instance(request, options = nil) -> ::Gapic::Operation
def delete_instance(name: nil) -> ::Gapic::Operation

Deletes an instance.

Overloads
def delete_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_instance via a request object, either of type DeleteInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::DeleteInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_instance(name: nil) -> ::Gapic::Operation
Pass arguments to delete_instance via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The instance resource name, in the format projects/{project_id}/locations/{location}/instances/{instance_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/filestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Filestore::V1::DeleteInstanceRequest.new

# Call the delete_instance method.
result = client.delete_instance request

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end

#get_backup

def get_backup(request, options = nil) -> ::Google::Cloud::Filestore::V1::Backup
def get_backup(name: nil) -> ::Google::Cloud::Filestore::V1::Backup

Gets the details of a specific backup.

Overloads
def get_backup(request, options = nil) -> ::Google::Cloud::Filestore::V1::Backup
Pass arguments to get_backup via a request object, either of type GetBackupRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::GetBackupRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_backup(name: nil) -> ::Google::Cloud::Filestore::V1::Backup
Pass arguments to get_backup via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The backup resource name, in the format projects/{project_number}/locations/{location}/backups/{backup_id}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/filestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Filestore::V1::GetBackupRequest.new

# Call the get_backup method.
result = client.get_backup request

# The returned object is of type Google::Cloud::Filestore::V1::Backup.
p result

#get_instance

def get_instance(request, options = nil) -> ::Google::Cloud::Filestore::V1::Instance
def get_instance(name: nil) -> ::Google::Cloud::Filestore::V1::Instance

Gets the details of a specific instance.

Overloads
def get_instance(request, options = nil) -> ::Google::Cloud::Filestore::V1::Instance
Pass arguments to get_instance via a request object, either of type GetInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::GetInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_instance(name: nil) -> ::Google::Cloud::Filestore::V1::Instance
Pass arguments to get_instance via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The instance resource name, in the format projects/{project_id}/locations/{location}/instances/{instance_id}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/filestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Filestore::V1::GetInstanceRequest.new

# Call the get_instance method.
result = client.get_instance request

# The returned object is of type Google::Cloud::Filestore::V1::Instance.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new CloudFilestoreManager client object.

Yields
  • (config) — Configure the CloudFilestoreManager client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new do |config|
  config.timeout = 10.0
end

#list_backups

def list_backups(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Filestore::V1::Backup>
def list_backups(parent: nil, page_size: nil, page_token: nil, order_by: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Filestore::V1::Backup>

Lists all backups in a project for either a specified location or for all locations.

Overloads
def list_backups(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Filestore::V1::Backup>
Pass arguments to list_backups via a request object, either of type ListBackupsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::ListBackupsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_backups(parent: nil, page_size: nil, page_token: nil, order_by: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Filestore::V1::Backup>
Pass arguments to list_backups via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — 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.
  • page_size (::Integer) — The maximum number of items to return.
  • page_token (::String) — The next_page_token value to use if there are additional results to retrieve for this list request.
  • order_by (::String) — Sort results. Supported values are "name", "name desc" or "" (unsorted).
  • filter (::String) — List filter.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/filestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Filestore::V1::ListBackupsRequest.new

# Call the list_backups method.
result = client.list_backups request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Filestore::V1::Backup.
  p response
end

#list_instances

def list_instances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Filestore::V1::Instance>
def list_instances(parent: nil, page_size: nil, page_token: nil, order_by: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Filestore::V1::Instance>

Lists all instances in a project for either a specified location or for all locations.

Overloads
def list_instances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Filestore::V1::Instance>
Pass arguments to list_instances via a request object, either of type ListInstancesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::ListInstancesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_instances(parent: nil, page_size: nil, page_token: nil, order_by: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Filestore::V1::Instance>
Pass arguments to list_instances via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — 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.
  • page_size (::Integer) — The maximum number of items to return.
  • page_token (::String) — The next_page_token value to use if there are additional results to retrieve for this list request.
  • order_by (::String) — Sort results. Supported values are "name", "name desc" or "" (unsorted).
  • filter (::String) — List filter.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/filestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Filestore::V1::ListInstancesRequest.new

# Call the list_instances method.
result = client.list_instances request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Filestore::V1::Instance.
  p response
end

#operations_client

def operations_client() -> ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Operations

Get the associated client for long-running operations.

#restore_instance

def restore_instance(request, options = nil) -> ::Gapic::Operation
def restore_instance(name: nil, file_share: nil, source_backup: nil) -> ::Gapic::Operation

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).

Overloads
def restore_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to restore_instance via a request object, either of type RestoreInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::RestoreInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def restore_instance(name: nil, file_share: nil, source_backup: nil) -> ::Gapic::Operation
Pass arguments to restore_instance via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The resource name of the instance, in the format projects/{project_number}/locations/{location_id}/instances/{instance_id}.
  • file_share (::String) — Required. Name of the file share in the Cloud Filestore instance that the backup is being restored to.
  • source_backup (::String) — The resource name of the backup, in the format projects/{project_number}/locations/{location_id}/backups/{backup_id}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/filestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Filestore::V1::RestoreInstanceRequest.new

# Call the restore_instance method.
result = client.restore_instance request

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end

#update_backup

def update_backup(request, options = nil) -> ::Gapic::Operation
def update_backup(backup: nil, update_mask: nil) -> ::Gapic::Operation

Updates the settings of a specific backup.

Overloads
def update_backup(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_backup via a request object, either of type UpdateBackupRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::UpdateBackupRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_backup(backup: nil, update_mask: nil) -> ::Gapic::Operation
Pass arguments to update_backup via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/filestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Filestore::V1::UpdateBackupRequest.new

# Call the update_backup method.
result = client.update_backup request

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end

#update_instance

def update_instance(request, options = nil) -> ::Gapic::Operation
def update_instance(update_mask: nil, instance: nil) -> ::Gapic::Operation

Updates the settings of a specific instance.

Overloads
def update_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_instance via a request object, either of type UpdateInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::UpdateInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_instance(update_mask: nil, instance: nil) -> ::Gapic::Operation
Pass arguments to update_instance via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) —

    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"
  • instance (::Google::Cloud::Filestore::V1::Instance, ::Hash) — Only fields specified in update_mask are updated.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/filestore/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Filestore::V1::UpdateInstanceRequest.new

# Call the update_instance method.
result = client.update_instance request

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end