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

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

REST client for the CloudFilestoreManager service.

Configures and manages Filestore resources.

Filestore Manager v1.

The file.googleapis.com service implements the 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, 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 Google Cloud zone for instances, but a Google Cloud 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::Rest::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 Filestore, backup locations map to Google Cloud 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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::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 it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
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 Filestore, locations map to Google Cloud 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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::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 it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_snapshot

def create_snapshot(request, options = nil) -> ::Gapic::Operation
def create_snapshot(parent: nil, snapshot_id: nil, snapshot: nil) -> ::Gapic::Operation

Creates a snapshot.

Overloads
def create_snapshot(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_snapshot via a request object, either of type Google::Cloud::Filestore::V1::CreateSnapshotRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::CreateSnapshotRequest, ::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_snapshot(parent: nil, snapshot_id: nil, snapshot: nil) -> ::Gapic::Operation
Pass arguments to create_snapshot 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 Filestore Instance to create the snapshots of, in the format projects/{project_id}/locations/{location}/instances/{instance_id}
  • snapshot_id (::String) — Required. The ID to use for the snapshot. The ID must be unique within the specified instance.

    This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, or hyphens, and cannot end with a hyphen.

  • snapshot (::Google::Cloud::Filestore::V1::Snapshot, ::Hash) — Required. A snapshot resource.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::Client.new

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::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 it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_instance

def delete_instance(request, options = nil) -> ::Gapic::Operation
def delete_instance(name: nil, force: 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, force: 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).
Parameters
  • name (::String) — Required. The instance resource name, in the format projects/{project_id}/locations/{location}/instances/{instance_id}
  • force (::Boolean) — If set to true, all snapshots of the instance will also be deleted. (Otherwise, the request will only work if the instance has no snapshots.)
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::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 it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_snapshot

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

Deletes a snapshot.

Overloads
def delete_snapshot(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_snapshot via a request object, either of type DeleteSnapshotRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::DeleteSnapshotRequest, ::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_snapshot(name: nil) -> ::Gapic::Operation
Pass arguments to delete_snapshot 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 snapshot resource name, in the format projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::Client.new

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::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

#get_snapshot

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

Gets the details of a specific snapshot.

Overloads
def get_snapshot(request, options = nil) -> ::Google::Cloud::Filestore::V1::Snapshot
Pass arguments to get_snapshot via a request object, either of type GetSnapshotRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::GetSnapshotRequest, ::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_snapshot(name: nil) -> ::Google::Cloud::Filestore::V1::Snapshot
Pass arguments to get_snapshot 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 snapshot resource name, in the format projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::Client.new

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

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

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

#initialize

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

Create a new CloudFilestoreManager REST 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::Rest::Client.new

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

#list_backups

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

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

Overloads
def list_backups(request, options = nil) -> ::Google::Cloud::Filestore::V1::ListBackupsResponse
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) -> ::Google::Cloud::Filestore::V1::ListBackupsResponse
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 Filestore, backup locations map to Google Cloud 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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Filestore::V1::Backup.
  p item
end

#list_instances

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

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

Overloads
def list_instances(request, options = nil) -> ::Google::Cloud::Filestore::V1::ListInstancesResponse
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) -> ::Google::Cloud::Filestore::V1::ListInstancesResponse
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 Google Cloud 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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Filestore::V1::Instance.
  p item
end

#list_snapshots

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

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

Overloads
def list_snapshots(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Filestore::V1::Snapshot>
Pass arguments to list_snapshots via a request object, either of type ListSnapshotsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::ListSnapshotsRequest, ::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_snapshots(parent: nil, page_size: nil, page_token: nil, order_by: nil, filter: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Filestore::V1::Snapshot>
Pass arguments to list_snapshots 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 for which to retrieve snapshot information, in the format projects/{project_id}/locations/{location}/instances/{instance_id}.
  • 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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::Client.new

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

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Filestore::V1::Snapshot.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Rest::Client)

#operations_client

def operations_client() -> ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Rest::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 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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::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 it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#revert_instance

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

Revert an existing instance's file system to a specified snapshot.

Overloads
def revert_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to revert_instance via a request object, either of type RevertInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::RevertInstanceRequest, ::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 revert_instance(name: nil, target_snapshot_id: nil) -> ::Gapic::Operation
Pass arguments to revert_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. projects/{project_id}/locations/{location_id}/instances/{instance_id}. The resource name of the instance, in the format
  • target_snapshot_id (::String) — Required. The snapshot resource ID, in the format 'my-snapshot', where the specified ID is the {snapshot_id} of the fully qualified name like projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::Client.new

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

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

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

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::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 it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::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 it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#update_snapshot

def update_snapshot(request, options = nil) -> ::Gapic::Operation
def update_snapshot(update_mask: nil, snapshot: nil) -> ::Gapic::Operation

Updates the settings of a specific snapshot.

Overloads
def update_snapshot(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_snapshot via a request object, either of type UpdateSnapshotRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Filestore::V1::UpdateSnapshotRequest, ::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_snapshot(update_mask: nil, snapshot: nil) -> ::Gapic::Operation
Pass arguments to update_snapshot 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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call 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::Rest::Client.new

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

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

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