google-cloud-compute-v1/lib/google/cloud/compute/v1/projects/rest/client.rb
##
# Moves a persistent disk from one zone to another.
#
# @overload move_disk(request, options = nil)
#   Pass arguments to `move_disk` via a request object, either of type
#   {::Google::Cloud::Compute::V1::MoveDiskProjectRequest} or an equivalent Hash.
#
#   @param request [::Google::Cloud::Compute::V1::MoveDiskProjectRequest, ::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 move_disk(disk_move_request_resource: nil, project: nil, request_id: nil)
#   Pass arguments to `move_disk` 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 disk_move_request_resource [::Google::Cloud::Compute::V1::DiskMoveRequest, ::Hash]
#     The body resource for this request
#   @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).
# @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.
Moves a persistent disk from one zone to another.
Moves a persistent disk from one zone to another .
def move_disk request, options = nil
                raise ::ArgumentError, "request must be provided" if request.nil?
                request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::MoveDiskProjectRequest
                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_move_disk request
                response = @client_stub.make_post_request(
                  uri:     uri,
                  body:    body,
                  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 move_disk request , options = nil raise :: ArgumentError , "request must be provided" if request . nil? request = :: Gapic :: Protobuf . coerce request , to : :: Google :: Cloud :: Compute :: V1 :: MoveDiskProjectRequest 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_move_disk request response = @client_stub . make_post_request ( uri : uri , body : body , 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
Moves a persistent disk from one zone to another.
Moves a persistent disk from one zone to another .
# 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
move_disk(request, options = nil) Pass arguments to `move_disk` via a request object, either of type {::Google::Cloud::Compute::V1::MoveDiskProjectRequest} or an equivalent Hash. @param request [::Google::Cloud::Compute::V1::MoveDiskProjectRequest, ::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
move_disk ( request options = nil ) Pass arguments to ` move_disk ` via a request object either of type { :: Google :: Cloud :: Compute :: V1 :: MoveDiskProjectRequest } or an equivalent Hash . @param request [ :: Google :: Cloud :: Compute :: V1 :: MoveDiskProjectRequest :: 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, request_id: nil) Pass arguments to `move_disk` 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 disk_move_request_resource [::Google::Cloud::Compute::V1::DiskMoveRequest, ::Hash] The body resource for this request @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.
nil project : nil request_id : nil ) Pass arguments to ` move_disk ` 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 disk_move_request_resource [ :: Google :: Cloud :: Compute :: V1 :: DiskMoveRequest :: Hash ] The body resource for this request @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 .