Class: Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb

Overview

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

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#instance_config_path, #instance_path, #interconnect_attachment_path, #location_path, #lun_path, #network_config_path, #network_path, #nfs_share_path, #provisioning_config_path, #server_network_template_path, #ssh_key_path, #volume_config_path, #volume_path, #volume_snapshot_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new BareMetalSolution REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Rest::Client.new

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

Yields:

  • (config)

    Configure the BareMetalSolution client.

Yield Parameters:



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 137

def initialize
  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @bare_metal_solution_stub = ::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

  @bare_metal_solution_stub.logger(stub: true)&.info do |entry|
    entry.set_system_name
    entry.set_service
    entry.message = "Created client for #{entry.service}"
    entry.set_credentials_fields credentials
    entry.set "customEndpoint", @config.endpoint if @config.endpoint
    entry.set "defaultTimeout", @config.timeout if @config.timeout
    entry.set "quotaProject", @quota_project_id if @quota_project_id
  end

  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @bare_metal_solution_stub.endpoint
    config.universe_domain = @bare_metal_solution_stub.universe_domain
    config.bindings_override = @config.bindings_override
    config.logger = @bare_metal_solution_stub.logger if config.respond_to? :logger=
  end

  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @bare_metal_solution_stub.endpoint
    config.universe_domain = @bare_metal_solution_stub.universe_domain
    config.logger = @bare_metal_solution_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

#iam_policy_clientGoogle::Iam::V1::IAMPolicy::Rest::Client (readonly)

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

Returns:

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


222
223
224
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 222

def iam_policy_client
  @iam_policy_client
end

#location_clientGoogle::Cloud::Location::Locations::Rest::Client (readonly)

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

Returns:

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


215
216
217
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 215

def location_client
  @location_client
end

#operations_client::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Rest::Operations (readonly)

Get the associated client for long-running operations.



208
209
210
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 208

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the BareMetalSolution Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all BareMetalSolution clients
::Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 73

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "BareMetalSolution", "V2"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.timeout = 60.0

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



107
108
109
110
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 107

def configure
  yield @config if block_given?
  @config
end

#create_nfs_share(request, options = nil) ⇒ ::Gapic::Operation #create_nfs_share(parent: nil, nfs_share: nil) ⇒ ::Gapic::Operation

Create an NFS share.

Examples:

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::Rest::Client.new

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

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

Overloads:

  • #create_nfs_share(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_nfs_share via a request object, either of type CreateNfsShareRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::CreateNfsShareRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_nfs_share(parent: nil, nfs_share: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_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:

  • (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.



3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 3219

def create_nfs_share request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::CreateNfsShareRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_nfs_share..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_nfs_share.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_nfs_share.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.create_nfs_share request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_provisioning_config(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::ProvisioningConfig #create_provisioning_config(parent: nil, provisioning_config: nil, email: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::ProvisioningConfig

Create new ProvisioningConfig.

Examples:

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::Rest::Client.new

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

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

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

Overloads:

  • #create_provisioning_config(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::ProvisioningConfig

    Pass arguments to create_provisioning_config via a request object, either of type CreateProvisioningConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::CreateProvisioningConfigRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_provisioning_config(parent: nil, provisioning_config: nil, email: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::ProvisioningConfig

    Pass arguments to create_provisioning_config 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) (defaults to: nil)

      Required. The parent project and location containing the ProvisioningConfig.

    • provisioning_config (::Google::Cloud::BareMetalSolution::V2::ProvisioningConfig, ::Hash) (defaults to: nil)

      Required. The ProvisioningConfig to create.

    • email (::String) (defaults to: nil)

      Optional. Email provided to send a confirmation with provisioning config to.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 3727

def create_provisioning_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::CreateProvisioningConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_provisioning_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_provisioning_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_provisioning_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.create_provisioning_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_ssh_key(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::SSHKey #create_ssh_key(parent: nil, ssh_key: nil, ssh_key_id: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::SSHKey

Register a public SSH key in the specified project for use with the interactive serial console feature.

Examples:

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::Rest::Client.new

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

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

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

Overloads:

  • #create_ssh_key(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::SSHKey

    Pass arguments to create_ssh_key via a request object, either of type CreateSSHKeyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::CreateSSHKeyRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_ssh_key(parent: nil, ssh_key: nil, ssh_key_id: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::SSHKey

    Pass arguments to create_ssh_key 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) (defaults to: nil)

      Required. The parent containing the SSH keys.

    • ssh_key (::Google::Cloud::BareMetalSolution::V2::SSHKey, ::Hash) (defaults to: nil)

      Required. The SSH key to register.

    • ssh_key_id (::String) (defaults to: nil)

      Required. The ID to use for the key, which will become the final component of the key's resource name.

      This value must match the regex: [a-zA-Z0-9@.-_]{1,64}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 1251

def create_ssh_key request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::CreateSSHKeyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_ssh_key..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_ssh_key.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_ssh_key.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.create_ssh_key request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_volume_snapshot(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::VolumeSnapshot #create_volume_snapshot(parent: nil, volume_snapshot: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::VolumeSnapshot

Takes a snapshot of a boot volume. Returns INVALID_ARGUMENT if called for a non-boot volume.

Examples:

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::Rest::Client.new

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

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

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

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 2275

def create_volume_snapshot request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::CreateVolumeSnapshotRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_volume_snapshot..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_volume_snapshot.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_volume_snapshot.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.create_volume_snapshot request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_nfs_share(request, options = nil) ⇒ ::Gapic::Operation #delete_nfs_share(name: nil) ⇒ ::Gapic::Operation

Delete an NFS share. The underlying volume is automatically deleted.

Examples:

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::Rest::Client.new

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

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

Overloads:

  • #delete_nfs_share(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_nfs_share via a request object, either of type DeleteNfsShareRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::DeleteNfsShareRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_nfs_share(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_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:

    • name (::String) (defaults to: nil)

      Required. The name of the NFS share to delete.

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.



3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 3388

def delete_nfs_share request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::DeleteNfsShareRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_nfs_share..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_nfs_share.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_nfs_share.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.delete_nfs_share request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_ssh_key(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_ssh_key(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes a public SSH key registered in the specified project.

Examples:

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::Rest::Client.new

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

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

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_ssh_key(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_ssh_key via a request object, either of type DeleteSSHKeyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::DeleteSSHKeyRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_ssh_key(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_ssh_key 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) (defaults to: nil)

      Required. The name of the SSH key to delete. Currently, the only valid value for the location is "global".

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 1330

def delete_ssh_key request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::DeleteSSHKeyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_ssh_key..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_ssh_key.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_ssh_key.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.delete_ssh_key request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_volume_snapshot(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_volume_snapshot(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes a volume snapshot. Returns INVALID_ARGUMENT if called for a non-boot volume.

Examples:

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::Rest::Client.new

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

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

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_volume_snapshot(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_volume_snapshot via a request object, either of type DeleteVolumeSnapshotRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::DeleteVolumeSnapshotRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_volume_snapshot(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_volume_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:

    • name (::String) (defaults to: nil)

      Required. The name of the snapshot to delete.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 2443

def delete_volume_snapshot request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::DeleteVolumeSnapshotRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_volume_snapshot..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_volume_snapshot.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_volume_snapshot.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.delete_volume_snapshot request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#detach_lun(request, options = nil) ⇒ ::Gapic::Operation #detach_lun(instance: nil, lun: nil, skip_reboot: nil) ⇒ ::Gapic::Operation

Detach LUN from Instance.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #detach_lun(instance: nil, lun: nil, skip_reboot: 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) (defaults to: nil)

      Required. Name of the instance.

    • lun (::String) (defaults to: nil)

      Required. Name of the Lun to detach.

    • skip_reboot (::Boolean) (defaults to: nil)

      If true, performs lun unmapping without instance reboot.

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.



1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 1072

def detach_lun request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::DetachLunRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.detach_lun..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.detach_lun.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.detach_lun.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.detach_lun request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#disable_interactive_serial_console(request, options = nil) ⇒ ::Gapic::Operation #disable_interactive_serial_console(name: nil) ⇒ ::Gapic::Operation

Disable the interactive serial console feature on an instance.

Examples:

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::Rest::Client.new

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

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

Overloads:

  • #disable_interactive_serial_console(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to disable_interactive_serial_console via a request object, either of type DisableInteractiveSerialConsoleRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::DisableInteractiveSerialConsoleRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #disable_interactive_serial_console(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to disable_interactive_serial_console 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) (defaults to: nil)

      Required. Name of the 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.



981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 981

def disable_interactive_serial_console request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::DisableInteractiveSerialConsoleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.disable_interactive_serial_console..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.disable_interactive_serial_console.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.disable_interactive_serial_console.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.disable_interactive_serial_console request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#enable_interactive_serial_console(request, options = nil) ⇒ ::Gapic::Operation #enable_interactive_serial_console(name: nil) ⇒ ::Gapic::Operation

Enable the interactive serial console feature on an instance.

Examples:

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::Rest::Client.new

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

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

Overloads:

  • #enable_interactive_serial_console(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to enable_interactive_serial_console via a request object, either of type EnableInteractiveSerialConsoleRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::EnableInteractiveSerialConsoleRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #enable_interactive_serial_console(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to enable_interactive_serial_console 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) (defaults to: nil)

      Required. Name of the 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.



894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 894

def enable_interactive_serial_console request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::EnableInteractiveSerialConsoleRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.enable_interactive_serial_console..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.enable_interactive_serial_console.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.enable_interactive_serial_console.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.enable_interactive_serial_console request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#evict_lun(request, options = nil) ⇒ ::Gapic::Operation #evict_lun(name: nil) ⇒ ::Gapic::Operation

Skips lun's cooloff and deletes it now. Lun must be in cooloff state.

Examples:

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::Rest::Client.new

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

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

Overloads:

  • #evict_lun(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to evict_lun via a request object, either of type EvictLunRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::EvictLunRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #evict_lun(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to evict_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:

    • name (::String) (defaults to: nil)

      Required. The name of the lun.

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.



2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 2866

def evict_lun request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::EvictLunRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.evict_lun..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.evict_lun.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.evict_lun.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.evict_lun request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#evict_volume(request, options = nil) ⇒ ::Gapic::Operation #evict_volume(name: nil) ⇒ ::Gapic::Operation

Skips volume's cooloff and deletes it now. Volume must be in cooloff state.

Examples:

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::Rest::Client.new

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

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

Overloads:

  • #evict_volume(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to evict_volume via a request object, either of type EvictVolumeRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::EvictVolumeRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #evict_volume(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to evict_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:

    • name (::String) (defaults to: nil)

      Required. The name of the Volume.

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.



1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 1761

def evict_volume request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::EvictVolumeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.evict_volume..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.evict_volume.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.evict_volume.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.evict_volume request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_instance(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Instance #get_instance(name: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Instance

Get details about a single server.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

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

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 369

def get_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::GetInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.get_instance request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_lun(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Lun #get_lun(name: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Lun

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

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

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

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 2691

def get_lun request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::GetLunRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_lun..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_lun.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_lun.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.get_lun request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_network(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Network #get_network(name: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Network

Get details of a single network.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

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

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 2100

def get_network request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::GetNetworkRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_network..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_network.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_network.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.get_network request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_nfs_share(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::NfsShare #get_nfs_share(name: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::NfsShare

Get details of a single NFS share.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

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

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 2946

def get_nfs_share request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::GetNfsShareRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_nfs_share..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_nfs_share.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_nfs_share.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.get_nfs_share request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_provisioning_config(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::ProvisioningConfig #get_provisioning_config(name: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::ProvisioningConfig

Get ProvisioningConfig by name.

Examples:

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::Rest::Client.new

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

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

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

Overloads:

  • #get_provisioning_config(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::ProvisioningConfig

    Pass arguments to get_provisioning_config via a request object, either of type GetProvisioningConfigRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::GetProvisioningConfigRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_provisioning_config(name: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::ProvisioningConfig

    Pass arguments to get_provisioning_config 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) (defaults to: nil)

      Required. Name of the ProvisioningConfig.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 3643

def get_provisioning_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::GetProvisioningConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_provisioning_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_provisioning_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_provisioning_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.get_provisioning_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_volume(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Volume #get_volume(name: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Volume

Get details of a single storage volume.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

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

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the resource.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 1499

def get_volume request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::GetVolumeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_volume..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_volume.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_volume.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.get_volume request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_volume_snapshot(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::VolumeSnapshot #get_volume_snapshot(name: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::VolumeSnapshot

Returns the specified snapshot resource. Returns INVALID_ARGUMENT if called for a non-boot volume.

Examples:

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::Rest::Client.new

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

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

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

Overloads:

  • #get_volume_snapshot(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::VolumeSnapshot

    Pass arguments to get_volume_snapshot via a request object, either of type GetVolumeSnapshotRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::GetVolumeSnapshotRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_volume_snapshot(name: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::VolumeSnapshot

    Pass arguments to get_volume_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:

    • name (::String) (defaults to: nil)

      Required. The name of the snapshot.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 2522

def get_volume_snapshot request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::GetVolumeSnapshotRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_volume_snapshot..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_volume_snapshot.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_volume_snapshot.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.get_volume_snapshot request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

List servers in a given project and location.

Examples:

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::Rest::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

Overloads:

  • #list_instances(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Required. Parent value for ListInstancesRequest.

    • page_size (::Integer) (defaults to: nil)

      Requested page size. Server may return fewer items than requested. If unspecified, the server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      A token identifying a page of results from the server.

    • filter (::String) (defaults to: nil)

      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.



289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 289

def list_instances request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::ListInstancesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_instances..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_instances.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_instances.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.list_instances request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @bare_metal_solution_stub, :list_instances, "instances", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

List storage volume luns for given storage volume.

Examples:

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::Rest::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

Overloads:

  • #list_luns(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_luns(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Required. Parent value for ListLunsRequest.

    • page_size (::Integer) (defaults to: nil)

      Requested page size. The server might return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      A token identifying a page of results from the server.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 2778

def list_luns request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::ListLunsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_luns..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_luns.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_luns.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.list_luns request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @bare_metal_solution_stub, :list_luns, "luns", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_network_usage(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::ListNetworkUsageResponse #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.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

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

    Parameters:

    • location (::String) (defaults to: nil)

      Required. Parent value (project and location).

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 2022

def list_network_usage request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::ListNetworkUsageRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_network_usage..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_network_usage.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_network_usage.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.list_network_usage request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

List network in a given project and location.

Examples:

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::Rest::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

Overloads:

  • #list_networks(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_networks(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Required. Parent value for ListNetworksRequest.

    • page_size (::Integer) (defaults to: nil)

      Requested page size. The server might return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      A token identifying a page of results from the server.

    • filter (::String) (defaults to: nil)

      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.



1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 1941

def list_networks request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::ListNetworksRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_networks..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_networks.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_networks.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.list_networks request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @bare_metal_solution_stub, :list_networks, "networks", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

List NFS shares.

Examples:

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::Rest::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

Overloads:

  • #list_nfs_shares(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_nfs_shares(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Required. Parent value for ListNfsSharesRequest.

    • page_size (::Integer) (defaults to: nil)

      Requested page size. The server might return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      A token identifying a page of results from the server.

    • filter (::String) (defaults to: nil)

      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.



3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 3035

def list_nfs_shares request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::ListNfsSharesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_nfs_shares..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_nfs_shares.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_nfs_shares.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.list_nfs_shares request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @bare_metal_solution_stub, :list_nfs_shares, "nfs_shares", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_os_images(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::OSImage> #list_os_images(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::OSImage>

Retrieves the list of OS images which are currently approved.

Examples:

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::Rest::Client.new

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

# Call the list_os_images method.
result = client.list_os_images 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::OSImage.
  p item
end

Overloads:

  • #list_os_images(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::OSImage>

    Pass arguments to list_os_images via a request object, either of type ListOSImagesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::ListOSImagesRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_os_images(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::OSImage>

    Pass arguments to list_os_images 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) (defaults to: nil)

      Required. Parent value for ListProvisioningQuotasRequest.

    • page_size (::Integer) (defaults to: nil)

      Requested page size. The server might return fewer items than requested. If unspecified, server will pick an appropriate default. Notice that page_size field is not supported and won't be respected in the API request for now, will be updated when pagination is supported.

    • page_token (::String) (defaults to: nil)

      A token identifying a page of results from the server.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 3981

def list_os_images request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::ListOSImagesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_os_images..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_os_images.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_os_images.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.list_os_images request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @bare_metal_solution_stub, :list_os_images, "os_images", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_provisioning_quotas(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::ProvisioningQuota> #list_provisioning_quotas(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::ProvisioningQuota>

List the budget details to provision resources on a given project.

Examples:

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::Rest::Client.new

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

# Call the list_provisioning_quotas method.
result = client.list_provisioning_quotas 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::ProvisioningQuota.
  p item
end

Overloads:

  • #list_provisioning_quotas(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::ProvisioningQuota>

    Pass arguments to list_provisioning_quotas via a request object, either of type ListProvisioningQuotasRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::ListProvisioningQuotasRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_provisioning_quotas(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::ProvisioningQuota>

    Pass arguments to list_provisioning_quotas 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) (defaults to: nil)

      Required. Parent value for ListProvisioningQuotasRequest.

    • page_size (::Integer) (defaults to: nil)

      Requested page size. The server might return fewer items than requested. If unspecified, server will pick an appropriate default. Notice that page_size field is not supported and won't be respected in the API request for now, will be updated when pagination is supported.

    • page_token (::String) (defaults to: nil)

      A token identifying a page of results from the server.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 3479

def list_provisioning_quotas request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::ListProvisioningQuotasRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_provisioning_quotas..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_provisioning_quotas.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_provisioning_quotas.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.list_provisioning_quotas request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @bare_metal_solution_stub, :list_provisioning_quotas, "provisioning_quotas", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_ssh_keys(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::SSHKey> #list_ssh_keys(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::SSHKey>

Lists the public SSH keys registered for the specified project. These SSH keys are used only for the interactive serial console feature.

Examples:

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::Rest::Client.new

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

# Call the list_ssh_keys method.
result = client.list_ssh_keys 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::SSHKey.
  p item
end

Overloads:

  • #list_ssh_keys(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::SSHKey>

    Pass arguments to list_ssh_keys via a request object, either of type ListSSHKeysRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::ListSSHKeysRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_ssh_keys(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::SSHKey>

    Pass arguments to list_ssh_keys 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) (defaults to: nil)

      Required. The parent containing the SSH keys. Currently, the only valid value for the location is "global".

    • page_size (::Integer) (defaults to: nil)

      The maximum number of items to return.

    • page_token (::String) (defaults to: nil)

      The next_page_token value returned from a previous List request, if any.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 1162

def list_ssh_keys request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::ListSSHKeysRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_ssh_keys..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_ssh_keys.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_ssh_keys.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.list_ssh_keys request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @bare_metal_solution_stub, :list_ssh_keys, "ssh_keys", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_volume_snapshots(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::VolumeSnapshot> #list_volume_snapshots(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::VolumeSnapshot>

Retrieves the list of snapshots for the specified volume. Returns a response with an empty list of snapshots if called for a non-boot volume.

Examples:

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::Rest::Client.new

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

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

Overloads:

  • #list_volume_snapshots(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::VolumeSnapshot>

    Pass arguments to list_volume_snapshots via a request object, either of type ListVolumeSnapshotsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::ListVolumeSnapshotsRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_volume_snapshots(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::BareMetalSolution::V2::VolumeSnapshot>

    Pass arguments to list_volume_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) (defaults to: nil)

      Required. Parent value for ListVolumesRequest.

    • page_size (::Integer) (defaults to: nil)

      Requested page size. The server might return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      A token identifying a page of results from the server.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 2611

def list_volume_snapshots request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::ListVolumeSnapshotsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_volume_snapshots..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_volume_snapshots.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_volume_snapshots.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.list_volume_snapshots request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @bare_metal_solution_stub, :list_volume_snapshots, "volume_snapshots", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

List storage volumes in a given project and location.

Examples:

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::Rest::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

Overloads:

  • #list_volumes(request, options = nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_volumes(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::Rest::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) (defaults to: nil)

      Required. Parent value for ListVolumesRequest.

    • page_size (::Integer) (defaults to: nil)

      Requested page size. The server might return fewer items than requested. If unspecified, server will pick an appropriate default.

    • page_token (::String) (defaults to: nil)

      A token identifying a page of results from the server.

    • filter (::String) (defaults to: nil)

      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.



1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 1419

def list_volumes request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::ListVolumesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_volumes..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_volumes.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_volumes.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.list_volumes request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @bare_metal_solution_stub, :list_volumes, "volumes", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


229
230
231
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 229

def logger
  @bare_metal_solution_stub.logger
end

#rename_instance(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Instance #rename_instance(name: nil, new_instance_id: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Instance

RenameInstance sets a new name for an instance. Use with caution, previous names become immediately invalidated.

Examples:

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::Rest::Client.new

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

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

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

Overloads:

  • #rename_instance(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Instance

    Pass arguments to rename_instance via a request object, either of type RenameInstanceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::RenameInstanceRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #rename_instance(name: nil, new_instance_id: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Instance

    Pass arguments to rename_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) (defaults to: nil)

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

    • new_instance_id (::String) (defaults to: nil)

      Required. The new id of the instance.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 547

def rename_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::RenameInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.rename_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.rename_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.rename_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.rename_instance request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#rename_network(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Network #rename_network(name: nil, new_network_id: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Network

RenameNetwork sets a new name for a network. Use with caution, previous names become immediately invalidated.

Examples:

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::Rest::Client.new

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

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

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

Overloads:

  • #rename_network(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Network

    Pass arguments to rename_network via a request object, either of type RenameNetworkRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::RenameNetworkRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #rename_network(name: nil, new_network_id: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Network

    Pass arguments to rename_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:

    • name (::String) (defaults to: nil)

      Required. The name field is used to identify the network. Format: projects/{project}/locations/{location}/networks/{network}

    • new_network_id (::String) (defaults to: nil)

      Required. The new id of the network.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 3892

def rename_network request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::RenameNetworkRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.rename_network..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.rename_network.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.rename_network.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.rename_network request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#rename_nfs_share(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::NfsShare #rename_nfs_share(name: nil, new_nfsshare_id: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::NfsShare

RenameNfsShare sets a new name for an nfsshare. Use with caution, previous names become immediately invalidated.

Examples:

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::Rest::Client.new

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

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

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

Overloads:

  • #rename_nfs_share(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::NfsShare

    Pass arguments to rename_nfs_share via a request object, either of type RenameNfsShareRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::RenameNfsShareRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #rename_nfs_share(name: nil, new_nfsshare_id: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::NfsShare

    Pass arguments to rename_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:

    • name (::String) (defaults to: nil)

      Required. The name field is used to identify the nfsshare. Format: projects/{project}/locations/{location}/nfsshares/{nfsshare}

    • new_nfsshare_id (::String) (defaults to: nil)

      Required. The new id of the nfsshare.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 3303

def rename_nfs_share request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::RenameNfsShareRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.rename_nfs_share..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.rename_nfs_share.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.rename_nfs_share.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.rename_nfs_share request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#rename_volume(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Volume #rename_volume(name: nil, new_volume_id: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Volume

RenameVolume sets a new name for a volume. Use with caution, previous names become immediately invalidated.

Examples:

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::Rest::Client.new

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

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

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

Overloads:

  • #rename_volume(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Volume

    Pass arguments to rename_volume via a request object, either of type RenameVolumeRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::RenameVolumeRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #rename_volume(name: nil, new_volume_id: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::Volume

    Pass arguments to rename_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:

    • name (::String) (defaults to: nil)

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

    • new_volume_id (::String) (defaults to: nil)

      Required. The new id of the volume.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 1675

def rename_volume request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::RenameVolumeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.rename_volume..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.rename_volume.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.rename_volume.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.rename_volume request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#reset_instance(request, options = nil) ⇒ ::Gapic::Operation #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.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

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

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the 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.



633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 633

def reset_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::ResetInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.reset_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.reset_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.reset_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.reset_instance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#resize_volume(request, options = nil) ⇒ ::Gapic::Operation #resize_volume(volume: nil, size_gib: nil) ⇒ ::Gapic::Operation

Emergency Volume resize.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      Required. Volume to resize.

    • size_gib (::Integer) (defaults to: nil)

      New Volume size, in GiB.

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.



1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 1850

def resize_volume request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::ResizeVolumeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.resize_volume..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.resize_volume.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.resize_volume.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.resize_volume request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#restore_volume_snapshot(request, options = nil) ⇒ ::Gapic::Operation #restore_volume_snapshot(volume_snapshot: nil) ⇒ ::Gapic::Operation

Uses the specified snapshot to restore its parent volume. Returns INVALID_ARGUMENT if called for a non-boot volume.

Examples:

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::Rest::Client.new

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

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

Overloads:

  • #restore_volume_snapshot(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to restore_volume_snapshot via a request object, either of type RestoreVolumeSnapshotRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::BareMetalSolution::V2::RestoreVolumeSnapshotRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #restore_volume_snapshot(volume_snapshot: nil) ⇒ ::Gapic::Operation

    Pass arguments to restore_volume_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:

    • volume_snapshot (::String) (defaults to: nil)

      Required. Name of the snapshot which will be used to restore its parent volume.

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.



2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 2362

def restore_volume_snapshot request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::RestoreVolumeSnapshotRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.restore_volume_snapshot..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.restore_volume_snapshot.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.restore_volume_snapshot.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.restore_volume_snapshot request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#start_instance(request, options = nil) ⇒ ::Gapic::Operation #start_instance(name: nil) ⇒ ::Gapic::Operation

Starts a server that was shutdown.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

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

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the 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.



720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 720

def start_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::StartInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.start_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.start_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.start_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.start_instance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#stop_instance(request, options = nil) ⇒ ::Gapic::Operation #stop_instance(name: nil) ⇒ ::Gapic::Operation

Stop a running server.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

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

    Parameters:

    • name (::String) (defaults to: nil)

      Required. Name of the 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.



807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 807

def stop_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::StopInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.stop_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.stop_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.stop_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.stop_instance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#submit_provisioning_config(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::SubmitProvisioningConfigResponse #submit_provisioning_config(parent: nil, provisioning_config: nil, email: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::SubmitProvisioningConfigResponse

Submit a provisiong configuration for a given project.

Examples:

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::Rest::Client.new

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

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

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

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 3565

def submit_provisioning_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::SubmitProvisioningConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.submit_provisioning_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.submit_provisioning_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.submit_provisioning_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.submit_provisioning_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


117
118
119
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 117

def universe_domain
  @bare_metal_solution_stub.universe_domain
end

#update_instance(request, options = nil) ⇒ ::Gapic::Operation #update_instance(instance: nil, update_mask: nil) ⇒ ::Gapic::Operation

Update details of a single server.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      The list of fields to update. The currently supported fields are: labels hyperthreading_enabled os_image

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.



463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 463

def update_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::UpdateInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.update_instance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_network(request, options = nil) ⇒ ::Gapic::Operation #update_network(network: nil, update_mask: nil) ⇒ ::Gapic::Operation

Update details of a single network.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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:

    • network (::Google::Cloud::BareMetalSolution::V2::Network, ::Hash) (defaults to: nil)

      Required. The network to update.

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

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      The list of fields to update. The only currently supported fields are: labels, reservations, vrf.vlan_attachments

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.



2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 2192

def update_network request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::UpdateNetworkRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_network..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_network.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_network.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.update_network request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_nfs_share(request, options = nil) ⇒ ::Gapic::Operation #update_nfs_share(nfs_share: nil, update_mask: nil) ⇒ ::Gapic::Operation

Update details of a single NFS share.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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:

    • nfs_share (::Google::Cloud::BareMetalSolution::V2::NfsShare, ::Hash) (defaults to: nil)

      Required. The NFS share to update.

      The name field is used to identify the NFS share to update. Format: projects/{project}/locations/{location}/nfsShares/{nfs_share}

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      The list of fields to update. The only currently supported fields are: labels allowed_clients

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.



3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 3130

def update_nfs_share request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::UpdateNfsShareRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_nfs_share..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_nfs_share.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_nfs_share.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.update_nfs_share request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_provisioning_config(request, options = nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::ProvisioningConfig #update_provisioning_config(provisioning_config: nil, update_mask: nil, email: nil) ⇒ ::Google::Cloud::BareMetalSolution::V2::ProvisioningConfig

Update existing ProvisioningConfig.

Examples:

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::Rest::Client.new

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

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

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

Overloads:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 3810

def update_provisioning_config request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::UpdateProvisioningConfigRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_provisioning_config..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_provisioning_config.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_provisioning_config.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.update_provisioning_config request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_volume(request, options = nil) ⇒ ::Gapic::Operation #update_volume(volume: nil, update_mask: nil) ⇒ ::Gapic::Operation

Update details of a single storage volume.

Examples:

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::Rest::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

Overloads:

  • #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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #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) (defaults to: nil)

      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) (defaults to: nil)

      The list of fields to update. The only currently supported fields are: 'labels'

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.



1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
# File 'lib/google/cloud/bare_metal_solution/v2/bare_metal_solution/rest/client.rb', line 1591

def update_volume request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::BareMetalSolution::V2::UpdateVolumeRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_volume..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::BareMetalSolution::V2::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_volume.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_volume.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @bare_metal_solution_stub.update_volume request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end