Google Cloud Compute V1 API - Class Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Rest::Client (v2.9.0)

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

REST client for the RegionInstanceGroupManagers service.

The RegionInstanceGroupManagers API.

Inherits

  • Object

Methods

.configure

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

Configure the RegionInstanceGroupManagers 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 RegionInstanceGroupManagers clients
::Google::Cloud::Compute::V1::RegionInstanceGroupManagers::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#abandon_instances

def abandon_instances(request, options = nil) -> ::Gapic::GenericLRO::Operation
def abandon_instances(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_abandon_instances_request_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation

Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.

Overloads
def abandon_instances(request, options = nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to abandon_instances via a request object, either of type AbandonInstancesRegionInstanceGroupManagerRequest or an equivalent Hash.
Parameters
def abandon_instances(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_abandon_instances_request_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to abandon_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
  • instance_group_manager (::String) — Name of the managed instance group.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping this request.
  • region_instance_group_managers_abandon_instances_request_resource (::Google::Cloud::Compute::V1::RegionInstanceGroupManagersAbandonInstancesRequest, ::Hash) — The body resource 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).
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::RegionInstanceGroupManagers::Rest::Client.new

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

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

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

#apply_updates_to_instances

def apply_updates_to_instances(request, options = nil) -> ::Gapic::GenericLRO::Operation
def apply_updates_to_instances(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_apply_updates_request_resource: nil) -> ::Gapic::GenericLRO::Operation

Apply updates to selected instances the managed instance group.

Overloads
def apply_updates_to_instances(request, options = nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to apply_updates_to_instances via a request object, either of type ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest or an equivalent Hash.
Parameters
def apply_updates_to_instances(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_apply_updates_request_resource: nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to apply_updates_to_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
  • instance_group_manager (::String) — The name of the managed instance group, should conform to RFC1035.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping this request, should conform to RFC1035.
  • region_instance_group_managers_apply_updates_request_resource (::Google::Cloud::Compute::V1::RegionInstanceGroupManagersApplyUpdatesRequest, ::Hash) — The body resource for this request
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::RegionInstanceGroupManagers::Rest::Client.new

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

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

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

#configure

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

Configure the RegionInstanceGroupManagers Client instance.

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

See Configuration for a description of the configuration fields.

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

#create_instances

def create_instances(request, options = nil) -> ::Gapic::GenericLRO::Operation
def create_instances(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_create_instances_request_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation

Creates instances with per-instance configurations in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.

Overloads
def create_instances(request, options = nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to create_instances via a request object, either of type CreateInstancesRegionInstanceGroupManagerRequest or an equivalent Hash.
Parameters
def create_instances(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_create_instances_request_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to create_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
  • instance_group_manager (::String) — The name of the managed instance group. It should conform to RFC1035.
  • project (::String) — Project ID for this request.
  • region (::String) — The name of the region where the managed instance group is located. It should conform to RFC1035.
  • region_instance_group_managers_create_instances_request_resource (::Google::Cloud::Compute::V1::RegionInstanceGroupManagersCreateInstancesRequest, ::Hash) — The body resource 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. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
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::RegionInstanceGroupManagers::Rest::Client.new

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

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

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

#delete

def delete(request, options = nil) -> ::Gapic::GenericLRO::Operation
def delete(instance_group_manager: nil, project: nil, region: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation

Deletes the specified managed instance group and all of the instances in that group.

Overloads
def delete(request, options = nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to delete via a request object, either of type DeleteRegionInstanceGroupManagerRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Compute::V1::DeleteRegionInstanceGroupManagerRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete(instance_group_manager: nil, project: nil, region: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to delete 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_group_manager (::String) — Name of the managed instance group to delete.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping 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).
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::RegionInstanceGroupManagers::Rest::Client.new

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

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

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

#delete_instances

def delete_instances(request, options = nil) -> ::Gapic::GenericLRO::Operation
def delete_instances(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_delete_instances_request_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation

Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.

Overloads
def delete_instances(request, options = nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to delete_instances via a request object, either of type DeleteInstancesRegionInstanceGroupManagerRequest or an equivalent Hash.
Parameters
def delete_instances(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_delete_instances_request_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to delete_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
  • instance_group_manager (::String) — Name of the managed instance group.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping this request.
  • region_instance_group_managers_delete_instances_request_resource (::Google::Cloud::Compute::V1::RegionInstanceGroupManagersDeleteInstancesRequest, ::Hash) — The body resource 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).
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::RegionInstanceGroupManagers::Rest::Client.new

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

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

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

#delete_per_instance_configs

def delete_per_instance_configs(request, options = nil) -> ::Gapic::GenericLRO::Operation
def delete_per_instance_configs(instance_group_manager: nil, project: nil, region: nil, region_instance_group_manager_delete_instance_config_req_resource: nil) -> ::Gapic::GenericLRO::Operation

Deletes selected per-instance configurations for the managed instance group.

Overloads
def delete_per_instance_configs(request, options = nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to delete_per_instance_configs via a request object, either of type DeletePerInstanceConfigsRegionInstanceGroupManagerRequest or an equivalent Hash.
Parameters
def delete_per_instance_configs(instance_group_manager: nil, project: nil, region: nil, region_instance_group_manager_delete_instance_config_req_resource: nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to delete_per_instance_configs 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_group_manager (::String) — The name of the managed instance group. It should conform to RFC1035.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping this request, should conform to RFC1035.
  • region_instance_group_manager_delete_instance_config_req_resource (::Google::Cloud::Compute::V1::RegionInstanceGroupManagerDeleteInstanceConfigReq, ::Hash) — The body resource for this request
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::RegionInstanceGroupManagers::Rest::Client.new

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

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

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

#get

def get(request, options = nil) -> ::Google::Cloud::Compute::V1::InstanceGroupManager
def get(instance_group_manager: nil, project: nil, region: nil) -> ::Google::Cloud::Compute::V1::InstanceGroupManager

Returns all of the details about the specified managed instance group.

Overloads
def get(request, options = nil) -> ::Google::Cloud::Compute::V1::InstanceGroupManager
Pass arguments to get via a request object, either of type GetRegionInstanceGroupManagerRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Compute::V1::GetRegionInstanceGroupManagerRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get(instance_group_manager: nil, project: nil, region: nil) -> ::Google::Cloud::Compute::V1::InstanceGroupManager
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
  • instance_group_manager (::String) — Name of the managed instance group to return.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping 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::RegionInstanceGroupManagers::Rest::Client.new

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

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

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

#initialize

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

Create a new RegionInstanceGroupManagers REST client object.

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

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

#insert

def insert(request, options = nil) -> ::Gapic::GenericLRO::Operation
def insert(instance_group_manager_resource: nil, project: nil, region: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation

Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. A regional managed instance group can contain up to 2000 instances.

Overloads
def insert(request, options = nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to insert via a request object, either of type InsertRegionInstanceGroupManagerRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Compute::V1::InsertRegionInstanceGroupManagerRequest, ::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 insert(instance_group_manager_resource: nil, project: nil, region: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to insert 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_group_manager_resource (::Google::Cloud::Compute::V1::InstanceGroupManager, ::Hash) — The body resource for this request
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping 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).
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::RegionInstanceGroupManagers::Rest::Client.new

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

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

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

#list

def list(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceGroupManager>
def list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceGroupManager>

Retrieves the list of managed instance groups that are contained within the specified region.

Overloads
def list(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceGroupManager>
Pass arguments to list via a request object, either of type ListRegionInstanceGroupManagersRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Compute::V1::ListRegionInstanceGroupManagersRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceGroupManager>
Pass arguments to list 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
  • filter (::String) — A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either =, !=, >, <, <=, >= or :. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. The :* comparison can be used to test whether a key has been defined. For example, to find all objects with owner label use: labels.owner:* You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example: (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) If you want to use a regular expression, use the eq (equal) or ne (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: fieldname eq unquoted literal fieldname eq 'single quoted literal' fieldname eq "double quoted literal" (fieldname1 eq literal) (fieldname2 ne "literal") The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use name ne .*instance. You cannot combine constraints on multiple fields using regular expressions.
  • max_results (::Integer) — The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
  • order_by (::String) — Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported.
  • page_token (::String) — Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping this request.
  • return_partial_success (::Boolean) — Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/compute/v1"

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

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

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

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

#list_errors

def list_errors(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceManagedByIgmError>
def list_errors(filter: nil, instance_group_manager: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceManagedByIgmError>

Lists all errors thrown by actions on instances for a given regional managed instance group. The filter and orderBy query parameters are not supported.

Overloads
def list_errors(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceManagedByIgmError>
Pass arguments to list_errors via a request object, either of type ListErrorsRegionInstanceGroupManagersRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Compute::V1::ListErrorsRegionInstanceGroupManagersRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_errors(filter: nil, instance_group_manager: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceManagedByIgmError>
Pass arguments to list_errors 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
  • filter (::String) — A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either =, !=, >, <, <=, >= or :. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. The :* comparison can be used to test whether a key has been defined. For example, to find all objects with owner label use: labels.owner:* You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example: (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) If you want to use a regular expression, use the eq (equal) or ne (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: fieldname eq unquoted literal fieldname eq 'single quoted literal' fieldname eq "double quoted literal" (fieldname1 eq literal) (fieldname2 ne "literal") The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use name ne .*instance. You cannot combine constraints on multiple fields using regular expressions.
  • instance_group_manager (::String) — The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:a-z?)|1-9{0,19}.
  • max_results (::Integer) — The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
  • order_by (::String) — Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported.
  • page_token (::String) — Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping this request. This should conform to RFC1035.
  • return_partial_success (::Boolean) — Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/compute/v1"

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

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

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

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

#list_managed_instances

def list_managed_instances(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ManagedInstance>
def list_managed_instances(filter: nil, instance_group_manager: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ManagedInstance>

Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. The orderBy query parameter is not supported. The pageToken query parameter is supported only if the group's listManagedInstancesResults field is set to PAGINATED.

Overloads
def list_managed_instances(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ManagedInstance>
Pass arguments to list_managed_instances via a request object, either of type ListManagedInstancesRegionInstanceGroupManagersRequest or an equivalent Hash.
Parameters
def list_managed_instances(filter: nil, instance_group_manager: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ManagedInstance>
Pass arguments to list_managed_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
  • filter (::String) — A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either =, !=, >, <, <=, >= or :. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. The :* comparison can be used to test whether a key has been defined. For example, to find all objects with owner label use: labels.owner:* You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example: (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) If you want to use a regular expression, use the eq (equal) or ne (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: fieldname eq unquoted literal fieldname eq 'single quoted literal' fieldname eq "double quoted literal" (fieldname1 eq literal) (fieldname2 ne "literal") The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use name ne .*instance. You cannot combine constraints on multiple fields using regular expressions.
  • instance_group_manager (::String) — The name of the managed instance group.
  • max_results (::Integer) — The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
  • order_by (::String) — Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported.
  • page_token (::String) — Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping this request.
  • return_partial_success (::Boolean) — Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/compute/v1"

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

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

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

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

#list_per_instance_configs

def list_per_instance_configs(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::PerInstanceConfig>
def list_per_instance_configs(filter: nil, instance_group_manager: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::PerInstanceConfig>

Lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported.

Overloads
def list_per_instance_configs(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::PerInstanceConfig>
Pass arguments to list_per_instance_configs via a request object, either of type ListPerInstanceConfigsRegionInstanceGroupManagersRequest or an equivalent Hash.
Parameters
def list_per_instance_configs(filter: nil, instance_group_manager: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::PerInstanceConfig>
Pass arguments to list_per_instance_configs 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
  • filter (::String) — A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either =, !=, >, <, <=, >= or :. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. The :* comparison can be used to test whether a key has been defined. For example, to find all objects with owner label use: labels.owner:* You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example: (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) If you want to use a regular expression, use the eq (equal) or ne (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: fieldname eq unquoted literal fieldname eq 'single quoted literal' fieldname eq "double quoted literal" (fieldname1 eq literal) (fieldname2 ne "literal") The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use name ne .*instance. You cannot combine constraints on multiple fields using regular expressions.
  • instance_group_manager (::String) — The name of the managed instance group. It should conform to RFC1035.
  • max_results (::Integer) — The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)
  • order_by (::String) — Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported.
  • page_token (::String) — Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping this request, should conform to RFC1035.
  • return_partial_success (::Boolean) — Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/compute/v1"

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

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

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

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

#patch

def patch(request, options = nil) -> ::Gapic::GenericLRO::Operation
def patch(instance_group_manager: nil, instance_group_manager_resource: nil, project: nil, region: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation

Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. If you update your group to specify a new template or instance configuration, it's possible that your intended specification for each VM in the group is different from the current state of that VM. To learn how to apply an updated configuration to the VMs in a MIG, see Updating instances in a MIG.

Overloads
def patch(request, options = nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to patch via a request object, either of type PatchRegionInstanceGroupManagerRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Compute::V1::PatchRegionInstanceGroupManagerRequest, ::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_group_manager: nil, instance_group_manager_resource: nil, project: nil, region: nil, request_id: 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_group_manager (::String) — The name of the instance group manager.
  • instance_group_manager_resource (::Google::Cloud::Compute::V1::InstanceGroupManager, ::Hash) — The body resource for this request
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping 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).
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::RegionInstanceGroupManagers::Rest::Client.new

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

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

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

#patch_per_instance_configs

def patch_per_instance_configs(request, options = nil) -> ::Gapic::GenericLRO::Operation
def patch_per_instance_configs(instance_group_manager: nil, project: nil, region: nil, region_instance_group_manager_patch_instance_config_req_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation

Inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.

Overloads
def patch_per_instance_configs(request, options = nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to patch_per_instance_configs via a request object, either of type PatchPerInstanceConfigsRegionInstanceGroupManagerRequest or an equivalent Hash.
Parameters
def patch_per_instance_configs(instance_group_manager: nil, project: nil, region: nil, region_instance_group_manager_patch_instance_config_req_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to patch_per_instance_configs 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_group_manager (::String) — The name of the managed instance group. It should conform to RFC1035.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping this request, should conform to RFC1035.
  • region_instance_group_manager_patch_instance_config_req_resource (::Google::Cloud::Compute::V1::RegionInstanceGroupManagerPatchInstanceConfigReq, ::Hash) — The body resource 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).
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::RegionInstanceGroupManagers::Rest::Client.new

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

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

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

#recreate_instances

def recreate_instances(request, options = nil) -> ::Gapic::GenericLRO::Operation
def recreate_instances(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_recreate_request_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation

Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.

Overloads
def recreate_instances(request, options = nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to recreate_instances via a request object, either of type Google::Cloud::Compute::V1::RecreateInstancesRegionInstanceGroupManagerRequest or an equivalent Hash.
Parameters
def recreate_instances(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_recreate_request_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to recreate_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
  • instance_group_manager (::String) — Name of the managed instance group.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping this request.
  • region_instance_group_managers_recreate_request_resource (::Google::Cloud::Compute::V1::RegionInstanceGroupManagersRecreateRequest, ::Hash) — The body resource 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).
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::RegionInstanceGroupManagers::Rest::Client.new

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

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

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

#region_operations

def region_operations() -> ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client

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

#resize

def resize(request, options = nil) -> ::Gapic::GenericLRO::Operation
def resize(instance_group_manager: nil, project: nil, region: nil, request_id: nil, size: nil) -> ::Gapic::GenericLRO::Operation

Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted.

Overloads
def resize(request, options = nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to resize via a request object, either of type Google::Cloud::Compute::V1::ResizeRegionInstanceGroupManagerRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Compute::V1::ResizeRegionInstanceGroupManagerRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def resize(instance_group_manager: nil, project: nil, region: nil, request_id: nil, size: nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to resize 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_group_manager (::String) — Name of the managed instance group.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping 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).
  • size (::Integer) — Number of instances that should exist in this instance group manager.
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::RegionInstanceGroupManagers::Rest::Client.new

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

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

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

#set_instance_template

def set_instance_template(request, options = nil) -> ::Gapic::GenericLRO::Operation
def set_instance_template(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_set_template_request_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation

Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.

Overloads
def set_instance_template(request, options = nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to set_instance_template via a request object, either of type SetInstanceTemplateRegionInstanceGroupManagerRequest or an equivalent Hash.
Parameters
def set_instance_template(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_set_template_request_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to set_instance_template 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_group_manager (::String) — The name of the managed instance group.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping this request.
  • region_instance_group_managers_set_template_request_resource (::Google::Cloud::Compute::V1::RegionInstanceGroupManagersSetTemplateRequest, ::Hash) — The body resource 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).
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::RegionInstanceGroupManagers::Rest::Client.new

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

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

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

#set_target_pools

def set_target_pools(request, options = nil) -> ::Gapic::GenericLRO::Operation
def set_target_pools(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_set_target_pools_request_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation

Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.

Overloads
def set_target_pools(request, options = nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to set_target_pools via a request object, either of type SetTargetPoolsRegionInstanceGroupManagerRequest or an equivalent Hash.
Parameters
def set_target_pools(instance_group_manager: nil, project: nil, region: nil, region_instance_group_managers_set_target_pools_request_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to set_target_pools 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_group_manager (::String) — Name of the managed instance group.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping this request.
  • region_instance_group_managers_set_target_pools_request_resource (::Google::Cloud::Compute::V1::RegionInstanceGroupManagersSetTargetPoolsRequest, ::Hash) — The body resource 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).
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::RegionInstanceGroupManagers::Rest::Client.new

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

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

#update_per_instance_configs

def update_per_instance_configs(request, options = nil) -> ::Gapic::GenericLRO::Operation
def update_per_instance_configs(instance_group_manager: nil, project: nil, region: nil, region_instance_group_manager_update_instance_config_req_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation

Inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.

Overloads
def update_per_instance_configs(request, options = nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to update_per_instance_configs via a request object, either of type UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest or an equivalent Hash.
Parameters
def update_per_instance_configs(instance_group_manager: nil, project: nil, region: nil, region_instance_group_manager_update_instance_config_req_resource: nil, request_id: nil) -> ::Gapic::GenericLRO::Operation
Pass arguments to update_per_instance_configs 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_group_manager (::String) — The name of the managed instance group. It should conform to RFC1035.
  • project (::String) — Project ID for this request.
  • region (::String) — Name of the region scoping this request, should conform to RFC1035.
  • region_instance_group_manager_update_instance_config_req_resource (::Google::Cloud::Compute::V1::RegionInstanceGroupManagerUpdateInstanceConfigReq, ::Hash) — The body resource 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).
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::RegionInstanceGroupManagers::Rest::Client.new

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

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

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