google-cloud-compute-v1/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb
##
# 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.
#
# @overload resize(request, options = nil)
#   Pass arguments to `resize` via a request object, either of type
#   {::Google::Cloud::Compute::V1::ResizeInstanceGroupManagerRequest} or an equivalent Hash.
#
#   @param 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.
#   @param options [::Gapic::CallOptions, ::Hash]
#     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
#
# @overload resize(instance_group_manager: nil, project: nil, request_id: nil, size: nil, zone: nil)
#   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).
#
#   @param instance_group_manager [::String]
#     The name of the managed instance group.
#   @param project [::String]
#     Project ID for this request.
#   @param request_id [::String]
#     An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
#
#     For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
#
#     The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
#   @param size [::Integer]
#     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.
#   @param zone [::String]
#     The name of the zone where the managed instance group is located.
# @yield [result, env] Access the result along with the Faraday environment object
# @yieldparam result [::Google::Cloud::Compute::V1::Operation]
# @yieldparam env [::Faraday::Env]
#
# @return [::Google::Cloud::Compute::V1::Operation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
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.
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 .
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
                options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
                call_metadata = {}
                call_metadata[:"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
                options.apply_defaults timeout:      @config.timeout,
                                       metadata:     call_metadata
                (uri, _body, query_string_params) = transcode_resize request
                response = @client_stub.make_post_request(
                  uri:     uri,
                  params:  query_string_params,
                  options: options
                )
                result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
                yield result, response if block_given?
                result
              rescue ::Faraday::Error => e
                gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
                raise ::Google::Cloud::Error.from_error(gapic_error)
              end
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 options = :: Gapic :: CallOptions . new ( ** options . to_h ) if options . respond_to? :to_h call_metadata = { } call_metadata [ :" 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 options . apply_defaults timeout : @config . timeout , metadata : call_metadata ( uri , _body , query_string_params ) = transcode_resize request response = @client_stub . make_post_request ( uri : uri , params : query_string_params , options : options ) result = :: Google :: Cloud :: Compute :: V1 :: Operation . decode_json response . body , ignore_unknown_fields : true yield result , response if block_given? result rescue :: Faraday :: Error => e gapic_error = :: Gapic :: Rest :: Error . wrap_faraday_error e raise :: Google :: Cloud :: Error . from_error ( gapic_error ) end
Resizes the managed instance group.
Resizes the managed instance group .
# Converts hash and nil to an options object # Customize the options with defaults # Set x-goog-api-client header
None
::Google::Cloud::Compute::V1::Operation
[::Google::Cloud::Error] if the REST call is aborted.
[ :: Google :: Cloud :: Error ] if the REST call is aborted .
request
<not_specific>
options
<not_specific>
]
<not_specific>
Access the result along with the Faraday environment object
Access the result along with the Faraday environment object
<not_specific>
None
overload
resize(request, options = nil) Pass arguments to `resize` via a request object, either of type {::Google::Cloud::Compute::V1::ResizeInstanceGroupManagerRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] 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 ( request options = nil ) Pass arguments to ` resize ` via a request object either of type { :: Google :: Cloud :: Compute :: V1 :: ResizeInstanceGroupManagerRequest } or an equivalent Hash . @param 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 . @param options [ :: Gapic :: CallOptions :: Hash ] 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
overload
None