google-cloud-compute-v1/lib/google/cloud/compute/v1/zone_operations/rest/client.rb
##
# Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress.
#
# This method is called on a best-effort basis. Specifically:
# - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds.
# - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`.
#
# @overload wait(request, options = nil)
#   Pass arguments to `wait` via a request object, either of type
#   {::Google::Cloud::Compute::V1::WaitZoneOperationRequest} or an equivalent Hash.
#
#   @param request [::Google::Cloud::Compute::V1::WaitZoneOperationRequest, ::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 wait(operation: nil, project: nil, zone: nil)
#   Pass arguments to `wait` 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 operation [::String]
#     Name of the Operations resource to return.
#   @param project [::String]
#     Project ID for this request.
#   @param zone [::String]
#     Name of the zone for this request.
# @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.
Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress.
This method is called on a best-effort basis. Specifically:
In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds.
If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`.
Waits for the specified Operation resource to return as ` DONE ` or for the request to approach the 2 minute deadline and retrieves the specified Operation resource . This method differs from the ` GET ` method in that it waits for no more than the default deadline ( 2 minutes ) and then returns the current state of the operation which might be ` DONE ` or still in progress . This method is called on a best - effort basis . Specifically : In uncommon cases when the server is overloaded the request might return before the default deadline is reached or might return after zero seconds . If the default deadline is reached there is no guarantee that the operation is actually done when the method returns . Be prepared to retry if the operation is not ` DONE ` .
def wait request, options = nil
                raise ::ArgumentError, "request must be provided" if request.nil?
                request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::WaitZoneOperationRequest
                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_wait request
                response = @client_stub.make_post_request(
                  uri:     uri,
                  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 wait request , options = nil raise :: ArgumentError , "request must be provided" if request . nil? request = :: Gapic :: Protobuf . coerce request , to : :: Google :: Cloud :: Compute :: V1 :: WaitZoneOperationRequest 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_wait request response = @client_stub . make_post_request ( uri : uri , 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
Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource.
Waits for the specified Operation resource to return as ` DONE ` or for the request to approach the 2 minute deadline and retrieves the specified Operation resource .
# 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
wait(request, options = nil) Pass arguments to `wait` via a request object, either of type {::Google::Cloud::Compute::V1::WaitZoneOperationRequest} or an equivalent Hash. @param request [::Google::Cloud::Compute::V1::WaitZoneOperationRequest, ::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
wait ( request options = nil ) Pass arguments to ` wait ` via a request object either of type { :: Google :: Cloud :: Compute :: V1 :: WaitZoneOperationRequest } or an equivalent Hash . @param request [ :: Google :: Cloud :: Compute :: V1 :: WaitZoneOperationRequest :: 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
nil, project: nil, zone: nil) Pass arguments to `wait` 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 . @param operation [::String] Name of the Operations resource to return. @param project [::String] Project ID for this request. @param zone [::String] Name of the zone for this request.
nil project : nil zone : nil ) Pass arguments to ` wait ` 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 . @param operation [ :: String ] Name of the Operations resource to return . @param project [ :: String ] Project ID for this request . @param zone [ :: String ] Name of the zone for this request .