Class: Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb

Overview

REST client for the InstanceGroupManagers service.

The InstanceGroupManagers API.

Defined Under Namespace

Classes: Configuration

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Create a new InstanceGroupManagers REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::Client.new

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

Yields:

  • (config)

    Configure the InstanceGroupManagers client.

Yield Parameters:



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 161

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
  credentials ||= Credentials.default scope: @config.scope
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @instance_group_managers_stub = ::Google::Cloud::Compute::V1::InstanceGroupManagers::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
end

Class Method Details

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

Configure the InstanceGroupManagers Client class.

See Configuration for a description of the configuration fields.

Examples:


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

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 56

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Compute", "V1"]
    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.rpcs.abandon_instances.timeout = 600.0

    default_config.rpcs.aggregated_list.timeout = 600.0
    default_config.rpcs.aggregated_list.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.apply_updates_to_instances.timeout = 600.0

    default_config.rpcs.create_instances.timeout = 600.0

    default_config.rpcs.delete.timeout = 600.0

    default_config.rpcs.delete_instances.timeout = 600.0

    default_config.rpcs.delete_per_instance_configs.timeout = 600.0

    default_config.rpcs.get.timeout = 600.0
    default_config.rpcs.get.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.insert.timeout = 600.0

    default_config.rpcs.list.timeout = 600.0
    default_config.rpcs.list.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.list_errors.timeout = 600.0
    default_config.rpcs.list_errors.retry_policy = {
      initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
    }

    default_config.rpcs.list_managed_instances.timeout = 600.0

    default_config.rpcs.list_per_instance_configs.timeout = 600.0

    default_config.rpcs.patch.timeout = 600.0

    default_config.rpcs.patch_per_instance_configs.timeout = 600.0

    default_config.rpcs.recreate_instances.timeout = 600.0

    default_config.rpcs.resize.timeout = 600.0

    default_config.rpcs.set_instance_template.timeout = 600.0

    default_config.rpcs.set_target_pools.timeout = 600.0

    default_config.rpcs.update_per_instance_configs.timeout = 600.0

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#abandon_instances(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #abandon_instances(instance_group_manager: nil, instance_group_managers_abandon_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

Flags the specified instances to be 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:

  • #abandon_instances(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::AbandonInstancesInstanceGroupManagerRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #abandon_instances(instance_group_manager: nil, instance_group_managers_abandon_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

      The name of the managed instance group.

    • instance_group_managers_abandon_instances_request_resource (::Google::Cloud::Compute::V1::InstanceGroupManagersAbandonInstancesRequest, ::Hash) (defaults to: nil)

      The body resource for this request

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

      Project ID for this request.

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

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

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

      The name of the zone where the managed instance group is located.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

  • result (::Gapic::Rest::BaseOperation)
  • response (::Faraday::Response)

Returns:

  • (::Gapic::Rest::BaseOperation)

Raises:

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

    if the REST call is aborted.



217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 217

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AbandonInstancesInstanceGroupManagerRequest

  # 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.abandon_instances..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.abandon_instances.timeout,
                         metadata:     

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

  @instance_group_managers_stub.abandon_instances request, options do |result, response|
    result = ::Gapic::Rest::BaseOperation.new result
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

#aggregated_list(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InstanceGroupManagersScopedList> #aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InstanceGroupManagersScopedList>

Retrieves the list of managed instance groups and groups them by zone.

Overloads:

  • #aggregated_list(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InstanceGroupManagersScopedList>

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::AggregatedListInstanceGroupManagersRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InstanceGroupManagersScopedList>

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

      A filter expression that filters resources listed in the response. The 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 : operator can be used with string fields to match substrings. For non-string fields it is equivalent to the = operator. 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)

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

      Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.

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

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

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

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

      Project ID for this request.

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

      Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 291

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AggregatedListInstanceGroupManagersRequest

  # 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.aggregated_list..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.aggregated_list.timeout,
                         metadata:     

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

  @instance_group_managers_stub.aggregated_list request, options do |result, response|
    result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :aggregated_list, "items", request, result, options
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

#apply_updates_to_instances(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #apply_updates_to_instances(instance_group_manager: nil, instance_group_managers_apply_updates_request_resource: nil, project: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions.

Overloads:

  • #apply_updates_to_instances(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::ApplyUpdatesToInstancesInstanceGroupManagerRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #apply_updates_to_instances(instance_group_manager: nil, instance_group_managers_apply_updates_request_resource: nil, project: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

      The name of the managed instance group, should conform to RFC1035.

    • instance_group_managers_apply_updates_request_resource (::Google::Cloud::Compute::V1::InstanceGroupManagersApplyUpdatesRequest, ::Hash) (defaults to: nil)

      The body resource for this request

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

      Project ID for this request.

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

      The name of the zone where the managed instance group is located. Should conform to RFC1035.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

  • result (::Gapic::Rest::BaseOperation)
  • response (::Faraday::Response)

Returns:

  • (::Gapic::Rest::BaseOperation)

Raises:

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

    if the REST call is aborted.



359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 359

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ApplyUpdatesToInstancesInstanceGroupManagerRequest

  # 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.apply_updates_to_instances..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.apply_updates_to_instances.timeout,
                         metadata:     

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

  @instance_group_managers_stub.apply_updates_to_instances request, options do |result, response|
    result = ::Gapic::Rest::BaseOperation.new result
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

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

Configure the InstanceGroupManagers 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:



140
141
142
143
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 140

def configure
  yield @config if block_given?
  @config
end

#create_instances(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #create_instances(instance_group_manager: nil, instance_group_managers_create_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

Creates instances with per-instance configs in this 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:

  • #create_instances(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::CreateInstancesInstanceGroupManagerRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #create_instances(instance_group_manager: nil, instance_group_managers_create_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

      The name of the managed instance group. It should conform to RFC1035.

    • instance_group_managers_create_instances_request_resource (::Google::Cloud::Compute::V1::InstanceGroupManagersCreateInstancesRequest, ::Hash) (defaults to: nil)

      The body resource for this request

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

      Project ID for this request.

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

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

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

      The name of the zone where the managed instance group is located. It should conform to RFC1035.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

  • result (::Gapic::Rest::BaseOperation)
  • response (::Faraday::Response)

Returns:

  • (::Gapic::Rest::BaseOperation)

Raises:

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

    if the REST call is aborted.



429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 429

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::CreateInstancesInstanceGroupManagerRequest

  # 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_instances..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.create_instances.timeout,
                         metadata:     

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

  @instance_group_managers_stub.create_instances request, options do |result, response|
    result = ::Gapic::Rest::BaseOperation.new result
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

#delete(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #delete(instance_group_manager: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information.

Overloads:

  • #delete(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::DeleteInstanceGroupManagerRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #delete(instance_group_manager: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

      The name of the managed instance group to delete.

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

      Project ID for this request.

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

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

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

      The name of the zone where the managed instance group is located.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

  • result (::Gapic::Rest::BaseOperation)
  • response (::Faraday::Response)

Returns:

  • (::Gapic::Rest::BaseOperation)

Raises:

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

    if the REST call is aborted.



497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 497

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteInstanceGroupManagerRequest

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

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.delete.timeout,
                         metadata:     

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

  @instance_group_managers_stub.delete request, options do |result, response|
    result = ::Gapic::Rest::BaseOperation.new result
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

#delete_instances(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #delete_instances(instance_group_manager: nil, instance_group_managers_delete_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

Flags the specified instances in the managed instance group for immediate deletion. 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. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. 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:

  • #delete_instances(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::DeleteInstancesInstanceGroupManagerRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #delete_instances(instance_group_manager: nil, instance_group_managers_delete_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

      The name of the managed instance group.

    • instance_group_managers_delete_instances_request_resource (::Google::Cloud::Compute::V1::InstanceGroupManagersDeleteInstancesRequest, ::Hash) (defaults to: nil)

      The body resource for this request

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

      Project ID for this request.

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

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

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

      The name of the zone where the managed instance group is located.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

  • result (::Gapic::Rest::BaseOperation)
  • response (::Faraday::Response)

Returns:

  • (::Gapic::Rest::BaseOperation)

Raises:

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

    if the REST call is aborted.



567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 567

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteInstancesInstanceGroupManagerRequest

  # 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_instances..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.delete_instances.timeout,
                         metadata:     

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

  @instance_group_managers_stub.delete_instances request, options do |result, response|
    result = ::Gapic::Rest::BaseOperation.new result
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

#delete_per_instance_configs(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #delete_per_instance_configs(instance_group_manager: nil, instance_group_managers_delete_per_instance_configs_req_resource: nil, project: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

Overloads:

  • #delete_per_instance_configs(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::DeletePerInstanceConfigsInstanceGroupManagerRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #delete_per_instance_configs(instance_group_manager: nil, instance_group_managers_delete_per_instance_configs_req_resource: nil, project: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

      The name of the managed instance group. It should conform to RFC1035.

    • instance_group_managers_delete_per_instance_configs_req_resource (::Google::Cloud::Compute::V1::InstanceGroupManagersDeletePerInstanceConfigsReq, ::Hash) (defaults to: nil)

      The body resource for this request

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

      Project ID for this request.

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

      The name of the zone where the managed instance group is located. It should conform to RFC1035.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

  • result (::Gapic::Rest::BaseOperation)
  • response (::Faraday::Response)

Returns:

  • (::Gapic::Rest::BaseOperation)

Raises:

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

    if the REST call is aborted.



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
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 635

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeletePerInstanceConfigsInstanceGroupManagerRequest

  # 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_per_instance_configs..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.delete_per_instance_configs.timeout,
                         metadata:     

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

  @instance_group_managers_stub.delete_per_instance_configs request, options do |result, response|
    result = ::Gapic::Rest::BaseOperation.new result
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

#get(request, options = nil) ⇒ ::Google::Cloud::Compute::V1::InstanceGroupManager #get(instance_group_manager: nil, project: nil, zone: nil) ⇒ ::Google::Cloud::Compute::V1::InstanceGroupManager

Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request.

Overloads:

  • #get(request, options = nil) ⇒ ::Google::Cloud::Compute::V1::InstanceGroupManager

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::GetInstanceGroupManagerRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #get(instance_group_manager: nil, project: nil, zone: 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) (defaults to: nil)

      The name of the managed instance group.

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

      Project ID for this request.

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

      The name of the zone where the managed instance group is located.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 701

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetInstanceGroupManagerRequest

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

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.get.timeout,
                         metadata:     

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

  @instance_group_managers_stub.get request, options do |result, response|
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

#insert(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #insert(instance_group_manager_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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 managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit.

Overloads:

  • #insert(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation

    Pass arguments to insert via a request object, either of type Google::Cloud::Compute::V1::InsertInstanceGroupManagerRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Compute::V1::InsertInstanceGroupManagerRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #insert(instance_group_manager_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

      The body resource for this request

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

      Project ID for this request.

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

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

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

      The name of the zone where you want to create the managed instance group.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

  • result (::Gapic::Rest::BaseOperation)
  • response (::Faraday::Response)

Returns:

  • (::Gapic::Rest::BaseOperation)

Raises:

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

    if the REST call is aborted.



768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 768

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertInstanceGroupManagerRequest

  # 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.insert..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.insert.timeout,
                         metadata:     

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

  @instance_group_managers_stub.insert request, options do |result, response|
    result = ::Gapic::Rest::BaseOperation.new result
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

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

Retrieves a list of managed instance groups that are contained within the specified project and zone.

Overloads:

  • #list(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::InstanceGroupManager>

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::ListInstanceGroupManagersRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, zone: 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) (defaults to: nil)

      A filter expression that filters resources listed in the response. The 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 : operator can be used with string fields to match substrings. For non-string fields it is equivalent to the = operator. 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)

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

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

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

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

      Project ID for this request.

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

      Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.

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

      The name of the zone where the managed instance group is located.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 842

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListInstanceGroupManagersRequest

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

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.list.timeout,
                         metadata:     

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

  @instance_group_managers_stub.list request, options do |result, response|
    result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list, "items", request, result, options
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

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

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

Overloads:

  • #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 ListErrorsInstanceGroupManagersRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Compute::V1::ListErrorsInstanceGroupManagersRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #list_errors(filter: nil, instance_group_manager: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, zone: 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) (defaults to: nil)

      A filter expression that filters resources listed in the response. The 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 : operator can be used with string fields to match substrings. For non-string fields it is equivalent to the = operator. 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)

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

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

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

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

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

      Project ID for this request.

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

      Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.

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

      The name of the zone where the managed instance group is located. It should conform to RFC1035.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 918

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListErrorsInstanceGroupManagersRequest

  # 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_errors..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.list_errors.timeout,
                         metadata:     

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

  @instance_group_managers_stub.list_errors request, options do |result, response|
    result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list_errors, "items", request, result, options
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

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

Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. The orderBy query parameter is not supported.

Overloads:

  • #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 ListManagedInstancesInstanceGroupManagersRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Compute::V1::ListManagedInstancesInstanceGroupManagersRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #list_managed_instances(filter: nil, instance_group_manager: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, zone: 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) (defaults to: nil)

      A filter expression that filters resources listed in the response. The 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 : operator can be used with string fields to match substrings. For non-string fields it is equivalent to the = operator. 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)

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

      The name of the managed instance group.

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

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

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

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

      Project ID for this request.

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

      Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.

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

      The name of the zone where the managed instance group is located.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 994

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListManagedInstancesInstanceGroupManagersRequest

  # 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_managed_instances..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.list_managed_instances.timeout,
                         metadata:     

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

  @instance_group_managers_stub.list_managed_instances request, options do |result, response|
    result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list_managed_instances, "managed_instances", request, result, options
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

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

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

Overloads:

  • #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 ListPerInstanceConfigsInstanceGroupManagersRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Compute::V1::ListPerInstanceConfigsInstanceGroupManagersRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #list_per_instance_configs(filter: nil, instance_group_manager: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, zone: 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) (defaults to: nil)

      A filter expression that filters resources listed in the response. The 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 : operator can be used with string fields to match substrings. For non-string fields it is equivalent to the = operator. 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)

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

      The name of the managed instance group. It should conform to RFC1035.

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

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

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

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

      Project ID for this request.

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

      Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.

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

      The name of the zone where the managed instance group is located. It should conform to RFC1035.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1070
1071
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
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1070

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListPerInstanceConfigsInstanceGroupManagersRequest

  # 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_per_instance_configs..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.list_per_instance_configs.timeout,
                         metadata:     

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

  @instance_group_managers_stub.list_per_instance_configs request, options do |result, response|
    result = ::Gapic::Rest::PagedEnumerable.new @instance_group_managers_stub, :list_per_instance_configs, "items", request, result, options
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

#patch(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #patch(instance_group_manager: nil, instance_group_manager_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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:

  • #patch(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::PatchInstanceGroupManagerRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #patch(instance_group_manager: nil, instance_group_manager_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

      The name of the instance group manager.

    • instance_group_manager_resource (::Google::Cloud::Compute::V1::InstanceGroupManager, ::Hash) (defaults to: nil)

      The body resource for this request

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

      Project ID for this request.

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

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

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

      The name of the zone where you want to create the managed instance group.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

  • result (::Gapic::Rest::BaseOperation)
  • response (::Faraday::Response)

Returns:

  • (::Gapic::Rest::BaseOperation)

Raises:

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

    if the REST call is aborted.



1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1140

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchInstanceGroupManagerRequest

  # 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.patch..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.patch.timeout,
                         metadata:     

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

  @instance_group_managers_stub.patch request, options do |result, response|
    result = ::Gapic::Rest::BaseOperation.new result
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

#patch_per_instance_configs(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #patch_per_instance_configs(instance_group_manager: nil, instance_group_managers_patch_per_instance_configs_req_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

Overloads:

  • #patch_per_instance_configs(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::PatchPerInstanceConfigsInstanceGroupManagerRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #patch_per_instance_configs(instance_group_manager: nil, instance_group_managers_patch_per_instance_configs_req_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

      The name of the managed instance group. It should conform to RFC1035.

    • instance_group_managers_patch_per_instance_configs_req_resource (::Google::Cloud::Compute::V1::InstanceGroupManagersPatchPerInstanceConfigsReq, ::Hash) (defaults to: nil)

      The body resource for this request

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

      Project ID for this request.

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

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

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

      The name of the zone where the managed instance group is located. It should conform to RFC1035.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

  • result (::Gapic::Rest::BaseOperation)
  • response (::Faraday::Response)

Returns:

  • (::Gapic::Rest::BaseOperation)

Raises:

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

    if the REST call is aborted.



1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1210

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchPerInstanceConfigsInstanceGroupManagerRequest

  # 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.patch_per_instance_configs..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.patch_per_instance_configs.timeout,
                         metadata:     

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

  @instance_group_managers_stub.patch_per_instance_configs request, options do |result, response|
    result = ::Gapic::Rest::BaseOperation.new result
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

#recreate_instances(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #recreate_instances(instance_group_manager: nil, instance_group_managers_recreate_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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:

  • #recreate_instances(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::RecreateInstancesInstanceGroupManagerRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #recreate_instances(instance_group_manager: nil, instance_group_managers_recreate_instances_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

      The name of the managed instance group.

    • instance_group_managers_recreate_instances_request_resource (::Google::Cloud::Compute::V1::InstanceGroupManagersRecreateInstancesRequest, ::Hash) (defaults to: nil)

      The body resource for this request

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

      Project ID for this request.

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

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

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

      The name of the zone where the managed instance group is located.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

  • result (::Gapic::Rest::BaseOperation)
  • response (::Faraday::Response)

Returns:

  • (::Gapic::Rest::BaseOperation)

Raises:

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

    if the REST call is aborted.



1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1280

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::RecreateInstancesInstanceGroupManagerRequest

  # 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.recreate_instances..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.recreate_instances.timeout,
                         metadata:     

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

  @instance_group_managers_stub.recreate_instances request, options do |result, response|
    result = ::Gapic::Rest::BaseOperation.new result
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

#resize(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #resize(instance_group_manager: nil, project: nil, request_id: nil, size: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

Resizes 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 instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: + The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. This list is subject to change. 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:

  • #resize(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::ResizeInstanceGroupManagerRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #resize(instance_group_manager: nil, project: nil, request_id: nil, size: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

      The name of the managed instance group.

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

      Project ID for this request.

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

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

      The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.

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

      The name of the zone where the managed instance group is located.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

  • result (::Gapic::Rest::BaseOperation)
  • response (::Faraday::Response)

Returns:

  • (::Gapic::Rest::BaseOperation)

Raises:

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

    if the REST call is aborted.



1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1350

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ResizeInstanceGroupManagerRequest

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

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.resize.timeout,
                         metadata:     

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

  @instance_group_managers_stub.resize request, options do |result, response|
    result = ::Gapic::Rest::BaseOperation.new result
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

#set_instance_template(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #set_instance_template(instance_group_manager: nil, instance_group_managers_set_instance_template_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.

Overloads:

  • #set_instance_template(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::SetInstanceTemplateInstanceGroupManagerRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #set_instance_template(instance_group_manager: nil, instance_group_managers_set_instance_template_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

      The name of the managed instance group.

    • instance_group_managers_set_instance_template_request_resource (::Google::Cloud::Compute::V1::InstanceGroupManagersSetInstanceTemplateRequest, ::Hash) (defaults to: nil)

      The body resource for this request

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

      Project ID for this request.

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

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

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

      The name of the zone where the managed instance group is located.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

  • result (::Gapic::Rest::BaseOperation)
  • response (::Faraday::Response)

Returns:

  • (::Gapic::Rest::BaseOperation)

Raises:

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

    if the REST call is aborted.



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
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1420

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetInstanceTemplateInstanceGroupManagerRequest

  # 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.set_instance_template..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.set_instance_template.timeout,
                         metadata:     

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

  @instance_group_managers_stub.set_instance_template request, options do |result, response|
    result = ::Gapic::Rest::BaseOperation.new result
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

#set_target_pools(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #set_target_pools(instance_group_manager: nil, instance_group_managers_set_target_pools_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.

Overloads:

  • #set_target_pools(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::SetTargetPoolsInstanceGroupManagerRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #set_target_pools(instance_group_manager: nil, instance_group_managers_set_target_pools_request_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

      The name of the managed instance group.

    • instance_group_managers_set_target_pools_request_resource (::Google::Cloud::Compute::V1::InstanceGroupManagersSetTargetPoolsRequest, ::Hash) (defaults to: nil)

      The body resource for this request

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

      Project ID for this request.

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

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

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

      The name of the zone where the managed instance group is located.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

  • result (::Gapic::Rest::BaseOperation)
  • response (::Faraday::Response)

Returns:

  • (::Gapic::Rest::BaseOperation)

Raises:

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

    if the REST call is aborted.



1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1490

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetTargetPoolsInstanceGroupManagerRequest

  # 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.set_target_pools..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.set_target_pools.timeout,
                         metadata:     

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

  @instance_group_managers_stub.set_target_pools request, options do |result, response|
    result = ::Gapic::Rest::BaseOperation.new result
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end

#update_per_instance_configs(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation #update_per_instance_configs(instance_group_manager: nil, instance_group_managers_update_per_instance_configs_req_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

Overloads:

  • #update_per_instance_configs(request, options = nil) ⇒ ::Gapic::Rest::BaseOperation

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

    Parameters:

    • request (::Google::Cloud::Compute::V1::UpdatePerInstanceConfigsInstanceGroupManagerRequest, ::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. Note: currently retry functionality is not implemented. While it is possible to set it using ::Gapic::CallOptions, it will not be applied

  • #update_per_instance_configs(instance_group_manager: nil, instance_group_managers_update_per_instance_configs_req_resource: nil, project: nil, request_id: nil, zone: nil) ⇒ ::Gapic::Rest::BaseOperation

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

      The name of the managed instance group. It should conform to RFC1035.

    • instance_group_managers_update_per_instance_configs_req_resource (::Google::Cloud::Compute::V1::InstanceGroupManagersUpdatePerInstanceConfigsReq, ::Hash) (defaults to: nil)

      The body resource for this request

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

      Project ID for this request.

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

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

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

      The name of the zone where the managed instance group is located. It should conform to RFC1035.

Yields:

  • (result, response)

    Access the result along with the Faraday response object

Yield Parameters:

  • result (::Gapic::Rest::BaseOperation)
  • response (::Faraday::Response)

Returns:

  • (::Gapic::Rest::BaseOperation)

Raises:

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

    if the REST call is aborted.



1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
# File 'lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb', line 1560

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdatePerInstanceConfigsInstanceGroupManagerRequest

  # 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_per_instance_configs..to_h

  # Set x-goog-api-client header
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Compute::V1::VERSION,
    transports_version_send: [:rest]

  options.apply_defaults timeout:      @config.rpcs.update_per_instance_configs.timeout,
                         metadata:     

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

  @instance_group_managers_stub.update_per_instance_configs request, options do |result, response|
    result = ::Gapic::Rest::BaseOperation.new result
    yield result, response if block_given?
    return result
  end
rescue ::Faraday::Error => e
  gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
  raise ::Google::Cloud::Error.from_error(gapic_error)
end