Bare Metal Solution V2 API - Class Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client (v0.4.1)

Reference documentation and code samples for the Bare Metal Solution V2 API class Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.

Client for the BareMetalSolution service.

Performs management operations on Bare Metal Solution servers.

The baremetalsolution.googleapis.com service provides management capabilities for Bare Metal Solution servers. To access the API methods, you must assign Bare Metal Solution IAM roles containing the desired permissions to your staff in your Google Cloud project. You must also enable the Bare Metal Solution API. Once enabled, the methods act upon specific servers in your Bare Metal Solution environment.

Inherits

  • Object

Methods

.configure

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

Configure the BareMetalSolution 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 BareMetalSolution clients
::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the BareMetalSolution 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

#detach_lun

def detach_lun(request, options = nil) -> ::Gapic::Operation
def detach_lun(instance: nil, lun: nil) -> ::Gapic::Operation

Detach LUN from Instance.

Overloads
def detach_lun(request, options = nil) -> ::Gapic::Operation
Pass arguments to detach_lun via a request object, either of type DetachLunRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::DetachLunRequest, ::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 detach_lun(instance: nil, lun: nil) -> ::Gapic::Operation
Pass arguments to detach_lun 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
  • instance (::String) — Required. Name of the instance.
  • lun (::String) — Required. Name of the Lun to detach.
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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::DetachLunRequest.new

# Call the detach_lun method.
result = client.detach_lun 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_instance

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

Get details about a single server.

Overloads
def get_instance(request, options = nil) -> ::Google::Cloud::BareMetalSolution::V2::Instance
Pass arguments to get_instance via a request object, either of type GetInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::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::BareMetalSolution::V2::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. Name of the resource.
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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

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

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

# The returned object is of type Google::Cloud::BareMetalSolution::V2::Instance.
p result

#get_lun

def get_lun(request, options = nil) -> ::Google::Cloud::BareMetalSolution::V2::Lun
def get_lun(name: nil) -> ::Google::Cloud::BareMetalSolution::V2::Lun

Get details of a single storage logical unit number(LUN).

Overloads
def get_lun(request, options = nil) -> ::Google::Cloud::BareMetalSolution::V2::Lun
Pass arguments to get_lun via a request object, either of type GetLunRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::GetLunRequest, ::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_lun(name: nil) -> ::Google::Cloud::BareMetalSolution::V2::Lun
Pass arguments to get_lun 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. Name of the resource.
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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::GetLunRequest.new

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

# The returned object is of type Google::Cloud::BareMetalSolution::V2::Lun.
p result

#get_network

def get_network(request, options = nil) -> ::Google::Cloud::BareMetalSolution::V2::Network
def get_network(name: nil) -> ::Google::Cloud::BareMetalSolution::V2::Network

Get details of a single network.

Overloads
def get_network(request, options = nil) -> ::Google::Cloud::BareMetalSolution::V2::Network
Pass arguments to get_network via a request object, either of type GetNetworkRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::GetNetworkRequest, ::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_network(name: nil) -> ::Google::Cloud::BareMetalSolution::V2::Network
Pass arguments to get_network 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. Name of the resource.
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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::GetNetworkRequest.new

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

# The returned object is of type Google::Cloud::BareMetalSolution::V2::Network.
p result

#get_nfs_share

def get_nfs_share(request, options = nil) -> ::Google::Cloud::BareMetalSolution::V2::NfsShare
def get_nfs_share(name: nil) -> ::Google::Cloud::BareMetalSolution::V2::NfsShare

Get details of a single NFS share.

Overloads
def get_nfs_share(request, options = nil) -> ::Google::Cloud::BareMetalSolution::V2::NfsShare
Pass arguments to get_nfs_share via a request object, either of type GetNfsShareRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::GetNfsShareRequest, ::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_nfs_share(name: nil) -> ::Google::Cloud::BareMetalSolution::V2::NfsShare
Pass arguments to get_nfs_share 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. Name of the resource.
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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::GetNfsShareRequest.new

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

# The returned object is of type Google::Cloud::BareMetalSolution::V2::NfsShare.
p result

#get_volume

def get_volume(request, options = nil) -> ::Google::Cloud::BareMetalSolution::V2::Volume
def get_volume(name: nil) -> ::Google::Cloud::BareMetalSolution::V2::Volume

Get details of a single storage volume.

Overloads
def get_volume(request, options = nil) -> ::Google::Cloud::BareMetalSolution::V2::Volume
Pass arguments to get_volume via a request object, either of type GetVolumeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::GetVolumeRequest, ::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_volume(name: nil) -> ::Google::Cloud::BareMetalSolution::V2::Volume
Pass arguments to get_volume 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. Name of the resource.
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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::GetVolumeRequest.new

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

# The returned object is of type Google::Cloud::BareMetalSolution::V2::Volume.
p result

#iam_policy_client

def iam_policy_client() -> Google::Iam::V1::IAMPolicy::Client

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

Returns
  • (Google::Iam::V1::IAMPolicy::Client)

#initialize

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

Create a new BareMetalSolution client object.

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

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

#list_instances

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

List servers in a given project and location.

Overloads
def list_instances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::Instance>
Pass arguments to list_instances via a request object, either of type ListInstancesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::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, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::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. Parent value for ListInstancesRequest.
  • page_size (::Integer) — Requested page size. Server may return fewer items than requested. If unspecified, the server will pick an appropriate default.
  • page_token (::String) — A token identifying a page of results from the server.
  • 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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::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::BareMetalSolution::V2::Instance.
  p item
end

#list_luns

def list_luns(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::Lun>
def list_luns(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::Lun>

List storage volume luns for given storage volume.

Overloads
def list_luns(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::Lun>
Pass arguments to list_luns via a request object, either of type ListLunsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::ListLunsRequest, ::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_luns(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::Lun>
Pass arguments to list_luns 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. Parent value for ListLunsRequest.
  • page_size (::Integer) — Requested page size. The server might return fewer items than requested. If unspecified, server will pick an appropriate default.
  • page_token (::String) — A token identifying a page of results from the server.
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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::ListLunsRequest.new

# Call the list_luns method.
result = client.list_luns 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::BareMetalSolution::V2::Lun.
  p item
end

#list_network_usage

def list_network_usage(request, options = nil) -> ::Google::Cloud::BareMetalSolution::V2::ListNetworkUsageResponse
def list_network_usage(location: nil) -> ::Google::Cloud::BareMetalSolution::V2::ListNetworkUsageResponse

List all Networks (and used IPs for each Network) in the vendor account associated with the specified project.

Overloads
def list_network_usage(request, options = nil) -> ::Google::Cloud::BareMetalSolution::V2::ListNetworkUsageResponse
Pass arguments to list_network_usage via a request object, either of type ListNetworkUsageRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::ListNetworkUsageRequest, ::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_network_usage(location: nil) -> ::Google::Cloud::BareMetalSolution::V2::ListNetworkUsageResponse
Pass arguments to list_network_usage 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
  • location (::String) — Required. Parent value (project and location).
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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::ListNetworkUsageRequest.new

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

# The returned object is of type Google::Cloud::BareMetalSolution::V2::ListNetworkUsageResponse.
p result

#list_networks

def list_networks(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::Network>
def list_networks(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::Network>

List network in a given project and location.

Overloads
def list_networks(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::Network>
Pass arguments to list_networks via a request object, either of type ListNetworksRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::ListNetworksRequest, ::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_networks(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::Network>
Pass arguments to list_networks 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. Parent value for ListNetworksRequest.
  • page_size (::Integer) — Requested page size. The server might return fewer items than requested. If unspecified, server will pick an appropriate default.
  • page_token (::String) — A token identifying a page of results from the server.
  • 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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::ListNetworksRequest.new

# Call the list_networks method.
result = client.list_networks 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::BareMetalSolution::V2::Network.
  p item
end

#list_nfs_shares

def list_nfs_shares(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::NfsShare>
def list_nfs_shares(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::NfsShare>

List NFS shares.

Overloads
def list_nfs_shares(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::NfsShare>
Pass arguments to list_nfs_shares via a request object, either of type ListNfsSharesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::ListNfsSharesRequest, ::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_nfs_shares(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::NfsShare>
Pass arguments to list_nfs_shares 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. Parent value for ListNfsSharesRequest.
  • page_size (::Integer) — Requested page size. The server might return fewer items than requested. If unspecified, server will pick an appropriate default.
  • page_token (::String) — A token identifying a page of results from the server.
  • 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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::ListNfsSharesRequest.new

# Call the list_nfs_shares method.
result = client.list_nfs_shares 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::BareMetalSolution::V2::NfsShare.
  p item
end

#list_volumes

def list_volumes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::Volume>
def list_volumes(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::Volume>

List storage volumes in a given project and location.

Overloads
def list_volumes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::Volume>
Pass arguments to list_volumes via a request object, either of type ListVolumesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::ListVolumesRequest, ::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_volumes(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::Volume>
Pass arguments to list_volumes 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. Parent value for ListVolumesRequest.
  • page_size (::Integer) — Requested page size. The server might return fewer items than requested. If unspecified, server will pick an appropriate default.
  • page_token (::String) — A token identifying a page of results from the server.
  • 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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::ListVolumesRequest.new

# Call the list_volumes method.
result = client.list_volumes 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::BareMetalSolution::V2::Volume.
  p item
end

#location_client

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

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

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

#operations_client

def operations_client() -> ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Operations

Get the associated client for long-running operations.

#reset_instance

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

Perform an ungraceful, hard reset on a server. Equivalent to shutting the power off and then turning it back on.

Overloads
def reset_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to reset_instance via a request object, either of type ResetInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::ResetInstanceRequest, ::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 reset_instance(name: nil) -> ::Gapic::Operation
Pass arguments to reset_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. Name of the 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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::ResetInstanceRequest.new

# Call the reset_instance method.
result = client.reset_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

#resize_volume

def resize_volume(request, options = nil) -> ::Gapic::Operation
def resize_volume(volume: nil, size_gib: nil) -> ::Gapic::Operation

Emergency Volume resize.

Overloads
def resize_volume(request, options = nil) -> ::Gapic::Operation
Pass arguments to resize_volume via a request object, either of type ResizeVolumeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::ResizeVolumeRequest, ::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 resize_volume(volume: nil, size_gib: nil) -> ::Gapic::Operation
Pass arguments to resize_volume 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
  • volume (::String) — Required. Volume to resize.
  • size_gib (::Integer) — New Volume size, in GiB.
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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::ResizeVolumeRequest.new

# Call the resize_volume method.
result = client.resize_volume 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

#start_instance

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

Starts a server that was shutdown.

Overloads
def start_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to start_instance via a request object, either of type StartInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::StartInstanceRequest, ::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 start_instance(name: nil) -> ::Gapic::Operation
Pass arguments to start_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. Name of the 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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::StartInstanceRequest.new

# Call the start_instance method.
result = client.start_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

#stop_instance

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

Stop a running server.

Overloads
def stop_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to stop_instance via a request object, either of type StopInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::StopInstanceRequest, ::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 stop_instance(name: nil) -> ::Gapic::Operation
Pass arguments to stop_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. Name of the 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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::StopInstanceRequest.new

# Call the stop_instance method.
result = client.stop_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_instance

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

Update details of a single server.

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::BareMetalSolution::V2::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(instance: nil, update_mask: 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
  • instance (::Google::Cloud::BareMetalSolution::V2::Instance, ::Hash) — Required. The server to update.

    The name field is used to identify the instance to update. Format: projects/{project}/locations/{location}/instances/{instance}

  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields to update. The currently supported fields are: labels hyperthreading_enabled os_image
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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::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_network

def update_network(request, options = nil) -> ::Gapic::Operation
def update_network(network: nil, update_mask: nil) -> ::Gapic::Operation

Update details of a single network.

Overloads
def update_network(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_network via a request object, either of type UpdateNetworkRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::UpdateNetworkRequest, ::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_network(network: nil, update_mask: nil) -> ::Gapic::Operation
Pass arguments to update_network 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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::UpdateNetworkRequest.new

# Call the update_network method.
result = client.update_network 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_nfs_share

def update_nfs_share(request, options = nil) -> ::Gapic::Operation
def update_nfs_share(nfs_share: nil, update_mask: nil) -> ::Gapic::Operation

Update details of a single NFS share.

Overloads
def update_nfs_share(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_nfs_share via a request object, either of type UpdateNfsShareRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::UpdateNfsShareRequest, ::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_nfs_share(nfs_share: nil, update_mask: nil) -> ::Gapic::Operation
Pass arguments to update_nfs_share 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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::UpdateNfsShareRequest.new

# Call the update_nfs_share method.
result = client.update_nfs_share 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_volume

def update_volume(request, options = nil) -> ::Gapic::Operation
def update_volume(volume: nil, update_mask: nil) -> ::Gapic::Operation

Update details of a single storage volume.

Overloads
def update_volume(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_volume via a request object, either of type UpdateVolumeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::BareMetalSolution::V2::UpdateVolumeRequest, ::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_volume(volume: nil, update_mask: nil) -> ::Gapic::Operation
Pass arguments to update_volume 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
  • volume (::Google::Cloud::BareMetalSolution::V2::Volume, ::Hash) — Required. The volume to update.

    The name field is used to identify the volume to update. Format: projects/{project}/locations/{location}/volumes/{volume}

  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields to update. The only currently supported fields are: snapshot_auto_delete_behavior snapshot_schedule_policy_name 'labels' 'snapshot_enabled' 'snapshot_reservation_detail.reserved_space_percent'
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/bare_metal_solution/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::BareMetalSolution::V2::UpdateVolumeRequest.new

# Call the update_volume method.
result = client.update_volume 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