Google Cloud Compute V1 API - Class Google::Cloud::Compute::V1::InstanceSettingsService::Rest::Client (v2.12.0)

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

REST client for the InstanceSettingsService service.

The InstanceSettings API.

Inherits

  • Object

Methods

.configure

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

Configure the InstanceSettingsService Client class.

See Configuration for a description of the configuration fields.

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

#configure

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

Configure the InstanceSettingsService Client instance.

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

See Configuration for a description of the configuration fields.

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

#get

def get(request, options = nil) -> ::Google::Cloud::Compute::V1::InstanceSettings
def get(project: nil, zone: nil) -> ::Google::Cloud::Compute::V1::InstanceSettings

Get Instance settings.

Overloads
def get(request, options = nil) -> ::Google::Cloud::Compute::V1::InstanceSettings
Pass arguments to get via a request object, either of type GetInstanceSettingRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Compute::V1::GetInstanceSettingRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get(project: nil, zone: nil) -> ::Google::Cloud::Compute::V1::InstanceSettings
Pass arguments to get 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
  • project (::String) — Project ID for this request.
  • zone (::String) — Name of the zone for this request.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/compute/v1"

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

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

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

# The returned object is of type Google::Cloud::Compute::V1::InstanceSettings.
p result

#initialize

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

Create a new InstanceSettingsService REST client object.

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

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

#patch

def patch(request, options = nil) -> ::Gapic::GenericLRO::Operation
def patch(instance_settings_resource: nil, project: nil, request_id: nil, update_mask: nil, zone: nil) -> ::Gapic::GenericLRO::Operation

Patch Instance settings

Overloads
def patch(request, options = nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to patch via a request object, either of type PatchInstanceSettingRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Compute::V1::PatchInstanceSettingRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def patch(instance_settings_resource: nil, project: nil, request_id: nil, update_mask: nil, zone: nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to patch 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_settings_resource (::Google::Cloud::Compute::V1::InstanceSettings, ::Hash) — The body resource for this request
  • project (::String) — Project ID for this request.
  • request_id (::String) — An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
  • update_mask (::String) — update_mask indicates fields to be updated as part of this request.
  • zone (::String) — The zone scoping this request. It should conform to RFC1035.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::GenericLRO::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::GenericLRO::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/compute/v1"

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

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

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

# The returned object is of type Google::Cloud::Compute::V1::Operation.
p result

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#zone_operations

def zone_operations() -> ::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client

Get the associated client for long-running operations via ZoneOperations.