class Google::Cloud::VMMigration::V1::VMMigration::Client

Client for the VmMigration service.

VM Migration Service

Attributes

operations_client[R]

Get the associated client for long-running operations.

@return [::Google::Cloud::VMMigration::V1::VMMigration::Operations]

vm_migration_stub[R]

@private

Public Class Methods

configure() { |configure| ... } click to toggle source

Configure the VmMigration Client class.

See {::Google::Cloud::VMMigration::V1::VMMigration::Client::Configuration} for a description of the configuration fields.

@example

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

@yield [config] Configure the Client client. @yieldparam config [Client::Configuration]

@return [Client::Configuration]

# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 56
def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "VMMigration", "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.timeout = 60.0

    default_config.rpcs.create_source.timeout = 900.0

    default_config.rpcs.fetch_inventory.timeout = 300.0

    default_config.rpcs.create_utilization_report.timeout = 300.0

    default_config
  end
  yield @configure if block_given?
  @configure
end
new() { |config| ... } click to toggle source

Create a new VmMigration client object.

@example

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

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

@yield [config] Configure the VmMigration client. @yieldparam config [Client::Configuration]

# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 117
def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/cloud/vmmigration/v1/vmmigration_services_pb"

  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
                           !@config.endpoint.split(".").first.include?("-")
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end
  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
  end

  @vm_migration_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::VMMigration::V1::VmMigration::Stub,
    credentials:  credentials,
    endpoint:     @config.endpoint,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors
  )
end

Public Instance Methods

add_group_migration(request, options = nil) { |response, operation| ... } click to toggle source

Adds a MigratingVm to a Group.

@overload add_group_migration(request, options = nil)

Pass arguments to `add_group_migration` via a request object, either of type
{::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest, ::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.

@overload add_group_migration(group: nil, migrating_vm: nil)

Pass arguments to `add_group_migration` 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 group [::String]
  Required. The full path name of the Group to add to.
@param migrating_vm [::String]
  The full path name of the MigratingVm to add.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 3876
def add_group_migration request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest

  # 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
  metadata = @config.rpcs.add_group_migration.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.group
    header_params["group"] = request.group
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.add_group_migration.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.add_group_migration.retry_policy

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

  @vm_migration_stub.call_rpc :add_group_migration, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
cancel_clone_job(request, options = nil) { |response, operation| ... } click to toggle source

Initiates the cancellation of a running clone job.

@overload cancel_clone_job(request, options = nil)

Pass arguments to `cancel_clone_job` via a request object, either of type
{::Google::Cloud::VMMigration::V1::CancelCloneJobRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::CancelCloneJobRequest, ::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.

@overload cancel_clone_job(name: nil)

Pass arguments to `cancel_clone_job` 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 name [::String]
  Required. The clone job id

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 2668
def cancel_clone_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelCloneJobRequest

  # 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
  metadata = @config.rpcs.cancel_clone_job.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.cancel_clone_job.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.cancel_clone_job.retry_policy

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

  @vm_migration_stub.call_rpc :cancel_clone_job, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
cancel_cutover_job(request, options = nil) { |response, operation| ... } click to toggle source

Initiates the cancellation of a running cutover job.

@overload cancel_cutover_job(request, options = nil)

Pass arguments to `cancel_cutover_job` via a request object, either of type
{::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest, ::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.

@overload cancel_cutover_job(name: nil)

Pass arguments to `cancel_cutover_job` 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 name [::String]
  Required. The cutover job id

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 3066
def cancel_cutover_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest

  # 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
  metadata = @config.rpcs.cancel_cutover_job.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.cancel_cutover_job.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.cancel_cutover_job.retry_policy

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

  @vm_migration_stub.call_rpc :cancel_cutover_job, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
configure() { |config| ... } click to toggle source

Configure the VmMigration Client instance.

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

See {::Google::Cloud::VMMigration::V1::VMMigration::Client::Configuration} for a description of the configuration fields.

@yield [config] Configure the Client client. @yieldparam config [Client::Configuration]

@return [Client::Configuration]

# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 96
def configure
  yield @config if block_given?
  @config
end
create_clone_job(request, options = nil) { |response, operation| ... } click to toggle source

Initiates a Clone of a specific migrating VM.

@overload create_clone_job(request, options = nil)

Pass arguments to `create_clone_job` via a request object, either of type
{::Google::Cloud::VMMigration::V1::CreateCloneJobRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::CreateCloneJobRequest, ::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.

@overload create_clone_job(parent: nil, clone_job_id: nil, clone_job: nil, request_id: nil)

Pass arguments to `create_clone_job` 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 parent [::String]
  Required. The Clone's parent.
@param clone_job_id [::String]
  Required. The clone job identifier.
@param clone_job [::Google::Cloud::VMMigration::V1::CloneJob, ::Hash]
  Required. The clone request body.
@param request_id [::String]
  A 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. The server will guarantee
  that for at least 60 minutes since the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 2575
def create_clone_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateCloneJobRequest

  # 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
  metadata = @config.rpcs.create_clone_job.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_clone_job.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_clone_job.retry_policy

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

  @vm_migration_stub.call_rpc :create_clone_job, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
create_cutover_job(request, options = nil) { |response, operation| ... } click to toggle source

Initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover job resource is created and the job is initiated.

@overload create_cutover_job(request, options = nil)

Pass arguments to `create_cutover_job` via a request object, either of type
{::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest, ::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.

@overload create_cutover_job(parent: nil, cutover_job_id: nil, cutover_job: nil, request_id: nil)

Pass arguments to `create_cutover_job` 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 parent [::String]
  Required. The Cutover's parent.
@param cutover_job_id [::String]
  Required. The cutover job identifier.
@param cutover_job [::Google::Cloud::VMMigration::V1::CutoverJob, ::Hash]
  Required. The cutover request body.
@param request_id [::String]
  A 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. The server will guarantee
  that for at least 60 minutes since the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 2973
def create_cutover_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest

  # 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
  metadata = @config.rpcs.create_cutover_job.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_cutover_job.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_cutover_job.retry_policy

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

  @vm_migration_stub.call_rpc :create_cutover_job, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
create_datacenter_connector(request, options = nil) { |response, operation| ... } click to toggle source

Creates a new DatacenterConnector in a given Source.

@overload create_datacenter_connector(request, options = nil)

Pass arguments to `create_datacenter_connector` via a request object, either of type
{::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest, ::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.

@overload create_datacenter_connector(parent: nil, datacenter_connector_id: nil, datacenter_connector: nil, request_id: nil)

Pass arguments to `create_datacenter_connector` 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 parent [::String]
  Required. The DatacenterConnector's parent.
  Required. The Source in where the new DatacenterConnector will be created.
  For example:
  `projects/my-project/locations/us-central1/sources/my-source`
@param datacenter_connector_id [::String]
  Required. The datacenterConnector identifier.
@param datacenter_connector [::Google::Cloud::VMMigration::V1::DatacenterConnector, ::Hash]
  Required. The create request body.
@param request_id [::String]
  A 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. The server will guarantee
  that for at least 60 minutes since the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 1469
def create_datacenter_connector request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest

  # 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
  metadata = @config.rpcs.create_datacenter_connector.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_datacenter_connector.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_datacenter_connector.retry_policy

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

  @vm_migration_stub.call_rpc :create_datacenter_connector, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
create_group(request, options = nil) { |response, operation| ... } click to toggle source

Creates a new Group in a given project and location.

@overload create_group(request, options = nil)

Pass arguments to `create_group` via a request object, either of type
{::Google::Cloud::VMMigration::V1::CreateGroupRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::CreateGroupRequest, ::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.

@overload create_group(parent: nil, group_id: nil, group: nil, request_id: nil)

Pass arguments to `create_group` 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 parent [::String]
  Required. The Group's parent.
@param group_id [::String]
  Required. The group identifier.
@param group [::Google::Cloud::VMMigration::V1::Group, ::Hash]
  Required. The create request body.
@param request_id [::String]
  A 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. The server will guarantee
  that for at least 60 minutes since the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 3561
def create_group request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateGroupRequest

  # 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
  metadata = @config.rpcs.create_group.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_group.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_group.retry_policy

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

  @vm_migration_stub.call_rpc :create_group, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
create_migrating_vm(request, options = nil) { |response, operation| ... } click to toggle source

Creates a new MigratingVm in a given Source.

@overload create_migrating_vm(request, options = nil)

Pass arguments to `create_migrating_vm` via a request object, either of type
{::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest, ::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.

@overload create_migrating_vm(parent: nil, migrating_vm_id: nil, migrating_vm: nil, request_id: nil)

Pass arguments to `create_migrating_vm` 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 parent [::String]
  Required. The MigratingVm's parent.
@param migrating_vm_id [::String]
  Required. The migratingVm identifier.
@param migrating_vm [::Google::Cloud::VMMigration::V1::MigratingVm, ::Hash]
  Required. The create request body.
@param request_id [::String]
  A 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. The server will guarantee
  that for at least 60 minutes since the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 1687
def create_migrating_vm request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest

  # 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
  metadata = @config.rpcs.create_migrating_vm.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_migrating_vm.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_migrating_vm.retry_policy

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

  @vm_migration_stub.call_rpc :create_migrating_vm, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
create_source(request, options = nil) { |response, operation| ... } click to toggle source

Creates a new Source in a given project and location.

@overload create_source(request, options = nil)

Pass arguments to `create_source` via a request object, either of type
{::Google::Cloud::VMMigration::V1::CreateSourceRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::CreateSourceRequest, ::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.

@overload create_source(parent: nil, source_id: nil, source: nil, request_id: nil)

Pass arguments to `create_source` 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 parent [::String]
  Required. The Source's parent.
@param source_id [::String]
  Required. The source identifier.
@param source [::Google::Cloud::VMMigration::V1::Source, ::Hash]
  Required. The create request body.
@param request_id [::String]
  A 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. The server will guarantee
  that for at least 60 minutes since the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 429
def create_source request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateSourceRequest

  # 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
  metadata = @config.rpcs.create_source.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_source.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_source.retry_policy

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

  @vm_migration_stub.call_rpc :create_source, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
create_target_project(request, options = nil) { |response, operation| ... } click to toggle source

Creates a new TargetProject in a given project.

NOTE: TargetProject is a global resource; hence the only supported value for location is ‘global`.

@overload create_target_project(request, options = nil)

Pass arguments to `create_target_project` via a request object, either of type
{::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest, ::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.

@overload create_target_project(parent: nil, target_project_id: nil, target_project: nil, request_id: nil)

Pass arguments to `create_target_project` 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 parent [::String]
  Required. The TargetProject's parent.
@param target_project_id [::String]
  Required. The target_project identifier.
@param target_project [::Google::Cloud::VMMigration::V1::TargetProject, ::Hash]
  Required. The create request body.
@param request_id [::String]
  A 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. The server will guarantee
  that for at least 60 minutes since the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 4283
def create_target_project request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest

  # 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
  metadata = @config.rpcs.create_target_project.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_target_project.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_target_project.retry_policy

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

  @vm_migration_stub.call_rpc :create_target_project, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
create_utilization_report(request, options = nil) { |response, operation| ... } click to toggle source

Creates a new UtilizationReport.

@overload create_utilization_report(request, options = nil)

Pass arguments to `create_utilization_report` via a request object, either of type
{::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest, ::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.

@overload create_utilization_report(parent: nil, utilization_report: nil, utilization_report_id: nil, request_id: nil)

Pass arguments to `create_utilization_report` 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 parent [::String]
  Required. The Utilization Report's parent.
@param utilization_report [::Google::Cloud::VMMigration::V1::UtilizationReport, ::Hash]
  Required. The report to create.
@param utilization_report_id [::String]
  Required. The ID to use for the report, which will become the final component of
  the reports's resource name.

  This value maximum length is 63 characters, and valid characters
  are /[a-z][0-9]-/. It must start with an english letter and must not
  end with a hyphen.
@param request_id [::String]
  A 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. The server will guarantee
  that for at least 60 minutes since the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 1055
def create_utilization_report request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest

  # 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
  metadata = @config.rpcs.create_utilization_report.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_utilization_report.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.create_utilization_report.retry_policy

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

  @vm_migration_stub.call_rpc :create_utilization_report, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_datacenter_connector(request, options = nil) { |response, operation| ... } click to toggle source

Deletes a single DatacenterConnector.

@overload delete_datacenter_connector(request, options = nil)

Pass arguments to `delete_datacenter_connector` via a request object, either of type
{::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest, ::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.

@overload delete_datacenter_connector(name: nil, request_id: nil)

Pass arguments to `delete_datacenter_connector` 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 name [::String]
  Required. The DatacenterConnector name.
@param request_id [::String]
  A 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. The server will guarantee
  that for at least 60 minutes after the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 1576
def delete_datacenter_connector request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest

  # 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
  metadata = @config.rpcs.delete_datacenter_connector.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_datacenter_connector.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_datacenter_connector.retry_policy

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

  @vm_migration_stub.call_rpc :delete_datacenter_connector, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_group(request, options = nil) { |response, operation| ... } click to toggle source

Deletes a single Group.

@overload delete_group(request, options = nil)

Pass arguments to `delete_group` via a request object, either of type
{::Google::Cloud::VMMigration::V1::DeleteGroupRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::DeleteGroupRequest, ::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.

@overload delete_group(name: nil, request_id: nil)

Pass arguments to `delete_group` 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 name [::String]
  Required. The Group name.
@param request_id [::String]
  Optional. A 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. The server will guarantee
  that for at least 60 minutes after the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 3781
def delete_group request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteGroupRequest

  # 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
  metadata = @config.rpcs.delete_group.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_group.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_group.retry_policy

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

  @vm_migration_stub.call_rpc :delete_group, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_migrating_vm(request, options = nil) { |response, operation| ... } click to toggle source

Deletes a single MigratingVm.

@overload delete_migrating_vm(request, options = nil)

Pass arguments to `delete_migrating_vm` via a request object, either of type
{::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest, ::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.

@overload delete_migrating_vm(name: nil)

Pass arguments to `delete_migrating_vm` 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 name [::String]
  Required. The name of the MigratingVm.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 2085
def delete_migrating_vm request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest

  # 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
  metadata = @config.rpcs.delete_migrating_vm.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_migrating_vm.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_migrating_vm.retry_policy

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

  @vm_migration_stub.call_rpc :delete_migrating_vm, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_source(request, options = nil) { |response, operation| ... } click to toggle source

Deletes a single Source.

@overload delete_source(request, options = nil)

Pass arguments to `delete_source` via a request object, either of type
{::Google::Cloud::VMMigration::V1::DeleteSourceRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::DeleteSourceRequest, ::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.

@overload delete_source(name: nil, request_id: nil)

Pass arguments to `delete_source` 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 name [::String]
  Required. The Source name.
@param request_id [::String]
  Optional. A 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. The server will guarantee
  that for at least 60 minutes after the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 649
def delete_source request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteSourceRequest

  # 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
  metadata = @config.rpcs.delete_source.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_source.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_source.retry_policy

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

  @vm_migration_stub.call_rpc :delete_source, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_target_project(request, options = nil) { |response, operation| ... } click to toggle source

Deletes a single TargetProject.

NOTE: TargetProject is a global resource; hence the only supported value for location is ‘global`.

@overload delete_target_project(request, options = nil)

Pass arguments to `delete_target_project` via a request object, either of type
{::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest, ::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.

@overload delete_target_project(name: nil, request_id: nil)

Pass arguments to `delete_target_project` 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 name [::String]
  Required. The TargetProject name.
@param request_id [::String]
  Optional. A 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. The server will guarantee
  that for at least 60 minutes after the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 4509
def delete_target_project request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest

  # 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
  metadata = @config.rpcs.delete_target_project.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_target_project.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_target_project.retry_policy

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

  @vm_migration_stub.call_rpc :delete_target_project, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
delete_utilization_report(request, options = nil) { |response, operation| ... } click to toggle source

Deletes a single Utilization Report.

@overload delete_utilization_report(request, options = nil)

Pass arguments to `delete_utilization_report` via a request object, either of type
{::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest, ::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.

@overload delete_utilization_report(name: nil, request_id: nil)

Pass arguments to `delete_utilization_report` 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 name [::String]
  Required. The Utilization Report name.
@param request_id [::String]
  Optional. A 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. The server will guarantee
  that for at least 60 minutes after the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 1162
def delete_utilization_report request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest

  # 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
  metadata = @config.rpcs.delete_utilization_report.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_utilization_report.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.delete_utilization_report.retry_policy

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

  @vm_migration_stub.call_rpc :delete_utilization_report, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
fetch_inventory(request, options = nil) { |response, operation| ... } click to toggle source

List remote source’s inventory of VMs. The remote source is the onprem vCenter (remote in the sense it’s not in Compute Engine). The inventory describes the list of existing VMs in that source. Note that this operation lists the VMs on the remote source, as opposed to listing the MigratingVms resources in the vmmigration service.

@overload fetch_inventory(request, options = nil)

Pass arguments to `fetch_inventory` via a request object, either of type
{::Google::Cloud::VMMigration::V1::FetchInventoryRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::FetchInventoryRequest, ::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.

@overload fetch_inventory(source: nil, force_refresh: nil)

Pass arguments to `fetch_inventory` 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 source [::String]
  Required. The name of the Source.
@param force_refresh [::Boolean]
  If this flag is set to true, the source will be queried instead of using
  cached results. Using this flag will make the call slower.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::VMMigration::V1::FetchInventoryResponse] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::VMMigration::V1::FetchInventoryResponse]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::FetchInventoryResponse.
p result
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 742
def fetch_inventory request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FetchInventoryRequest

  # 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
  metadata = @config.rpcs.fetch_inventory.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.source
    header_params["source"] = request.source
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.fetch_inventory.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.fetch_inventory.retry_policy

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

  @vm_migration_stub.call_rpc :fetch_inventory, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
finalize_migration(request, options = nil) { |response, operation| ... } click to toggle source

Marks a migration as completed, deleting migration resources that are no longer being used. Only applicable after cutover is done.

@overload finalize_migration(request, options = nil)

Pass arguments to `finalize_migration` via a request object, either of type
{::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest, ::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.

@overload finalize_migration(migrating_vm: nil)

Pass arguments to `finalize_migration` 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 migrating_vm [::String]
  Required. The name of the MigratingVm.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 2464
def finalize_migration request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest

  # 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
  metadata = @config.rpcs.finalize_migration.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.migrating_vm
    header_params["migrating_vm"] = request.migrating_vm
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.finalize_migration.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.finalize_migration.retry_policy

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

  @vm_migration_stub.call_rpc :finalize_migration, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_clone_job(request, options = nil) { |response, operation| ... } click to toggle source

Gets details of a single CloneJob.

@overload get_clone_job(request, options = nil)

Pass arguments to `get_clone_job` via a request object, either of type
{::Google::Cloud::VMMigration::V1::GetCloneJobRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::GetCloneJobRequest, ::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.

@overload get_clone_job(name: nil)

Pass arguments to `get_clone_job` 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 name [::String]
  Required. The name of the CloneJob.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::VMMigration::V1::CloneJob] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::VMMigration::V1::CloneJob]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::CloneJob.
p result
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 2861
def get_clone_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetCloneJobRequest

  # 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
  metadata = @config.rpcs.get_clone_job.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_clone_job.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_clone_job.retry_policy

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

  @vm_migration_stub.call_rpc :get_clone_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_cutover_job(request, options = nil) { |response, operation| ... } click to toggle source

Gets details of a single CutoverJob.

@overload get_cutover_job(request, options = nil)

Pass arguments to `get_cutover_job` via a request object, either of type
{::Google::Cloud::VMMigration::V1::GetCutoverJobRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::GetCutoverJobRequest, ::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.

@overload get_cutover_job(name: nil)

Pass arguments to `get_cutover_job` 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 name [::String]
  Required. The name of the CutoverJob.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::VMMigration::V1::CutoverJob] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::VMMigration::V1::CutoverJob]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::CutoverJob.
p result
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 3259
def get_cutover_job request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetCutoverJobRequest

  # 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
  metadata = @config.rpcs.get_cutover_job.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_cutover_job.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_cutover_job.retry_policy

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

  @vm_migration_stub.call_rpc :get_cutover_job, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_datacenter_connector(request, options = nil) { |response, operation| ... } click to toggle source

Gets details of a single DatacenterConnector.

@overload get_datacenter_connector(request, options = nil)

Pass arguments to `get_datacenter_connector` via a request object, either of type
{::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest, ::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.

@overload get_datacenter_connector(name: nil)

Pass arguments to `get_datacenter_connector` 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 name [::String]
  Required. The name of the DatacenterConnector.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::VMMigration::V1::DatacenterConnector] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::VMMigration::V1::DatacenterConnector]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::DatacenterConnector.
p result
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 1356
def get_datacenter_connector request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest

  # 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
  metadata = @config.rpcs.get_datacenter_connector.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_datacenter_connector.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_datacenter_connector.retry_policy

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

  @vm_migration_stub.call_rpc :get_datacenter_connector, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_group(request, options = nil) { |response, operation| ... } click to toggle source

Gets details of a single Group.

@overload get_group(request, options = nil)

Pass arguments to `get_group` via a request object, either of type
{::Google::Cloud::VMMigration::V1::GetGroupRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::GetGroupRequest, ::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.

@overload get_group(name: nil)

Pass arguments to `get_group` 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 name [::String]
  Required. The group name.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::VMMigration::V1::Group] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::VMMigration::V1::Group]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::Group.
p result
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 3451
def get_group request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetGroupRequest

  # 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
  metadata = @config.rpcs.get_group.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_group.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_group.retry_policy

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

  @vm_migration_stub.call_rpc :get_group, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_migrating_vm(request, options = nil) { |response, operation| ... } click to toggle source

Gets details of a single MigratingVm.

@overload get_migrating_vm(request, options = nil)

Pass arguments to `get_migrating_vm` via a request object, either of type
{::Google::Cloud::VMMigration::V1::GetMigratingVmRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::GetMigratingVmRequest, ::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.

@overload get_migrating_vm(name: nil)

Pass arguments to `get_migrating_vm` 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 name [::String]
  Required. The name of the MigratingVm.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::VMMigration::V1::MigratingVm] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::VMMigration::V1::MigratingVm]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::MigratingVm.
p result
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 1880
def get_migrating_vm request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetMigratingVmRequest

  # 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
  metadata = @config.rpcs.get_migrating_vm.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_migrating_vm.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_migrating_vm.retry_policy

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

  @vm_migration_stub.call_rpc :get_migrating_vm, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_source(request, options = nil) { |response, operation| ... } click to toggle source

Gets details of a single Source.

@overload get_source(request, options = nil)

Pass arguments to `get_source` via a request object, either of type
{::Google::Cloud::VMMigration::V1::GetSourceRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::GetSourceRequest, ::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.

@overload get_source(name: nil)

Pass arguments to `get_source` 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 name [::String]
  Required. The Source name.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::VMMigration::V1::Source] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::VMMigration::V1::Source]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::Source.
p result
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 319
def get_source request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetSourceRequest

  # 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
  metadata = @config.rpcs.get_source.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_source.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_source.retry_policy

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

  @vm_migration_stub.call_rpc :get_source, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_target_project(request, options = nil) { |response, operation| ... } click to toggle source

Gets details of a single TargetProject.

NOTE: TargetProject is a global resource; hence the only supported value for location is ‘global`.

@overload get_target_project(request, options = nil)

Pass arguments to `get_target_project` via a request object, either of type
{::Google::Cloud::VMMigration::V1::GetTargetProjectRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::GetTargetProjectRequest, ::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.

@overload get_target_project(name: nil)

Pass arguments to `get_target_project` 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 name [::String]
  Required. The TargetProject name.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::VMMigration::V1::TargetProject] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::VMMigration::V1::TargetProject]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::TargetProject.
p result
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 4170
def get_target_project request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetTargetProjectRequest

  # 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
  metadata = @config.rpcs.get_target_project.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_target_project.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_target_project.retry_policy

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

  @vm_migration_stub.call_rpc :get_target_project, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
get_utilization_report(request, options = nil) { |response, operation| ... } click to toggle source

Gets a single Utilization Report.

@overload get_utilization_report(request, options = nil)

Pass arguments to `get_utilization_report` via a request object, either of type
{::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest, ::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.

@overload get_utilization_report(name: nil, view: nil)

Pass arguments to `get_utilization_report` 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 name [::String]
  Required. The Utilization Report name.
@param view [::Google::Cloud::VMMigration::V1::UtilizationReportView]
  Optional. The level of details of the report.
  Defaults to FULL

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::VMMigration::V1::UtilizationReport] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Google::Cloud::VMMigration::V1::UtilizationReport]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Google::Cloud::VMMigration::V1::UtilizationReport.
p result
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 940
def get_utilization_report request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest

  # 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
  metadata = @config.rpcs.get_utilization_report.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_utilization_report.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.get_utilization_report.retry_policy

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

  @vm_migration_stub.call_rpc :get_utilization_report, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_clone_jobs(request, options = nil) { |response, operation| ... } click to toggle source

Lists CloneJobs of a given migrating VM.

@overload list_clone_jobs(request, options = nil)

Pass arguments to `list_clone_jobs` via a request object, either of type
{::Google::Cloud::VMMigration::V1::ListCloneJobsRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::ListCloneJobsRequest, ::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.

@overload list_clone_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)

Pass arguments to `list_clone_jobs` 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 parent [::String]
  Required. The parent, which owns this collection of source VMs.
@param page_size [::Integer]
  Optional. The maximum number of clone jobs to return. The service may return
  fewer than this value. If unspecified, at most 500 clone jobs will be
  returned. The maximum value is 1000; values above 1000 will be coerced to
  1000.
@param page_token [::String]
  Required. A page token, received from a previous `ListCloneJobs` call.
  Provide this to retrieve the subsequent page.

  When paginating, all other parameters provided to `ListCloneJobs` must
  match the call that provided the page token.
@param filter [::String]
  Optional. The filter request.
@param order_by [::String]
  Optional. the order by fields for the result.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CloneJob>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CloneJob>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::VMMigration::V1::CloneJob.
  p response
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 2775
def list_clone_jobs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListCloneJobsRequest

  # 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
  metadata = @config.rpcs.list_clone_jobs.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_clone_jobs.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_clone_jobs.retry_policy

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

  @vm_migration_stub.call_rpc :list_clone_jobs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_clone_jobs, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_cutover_jobs(request, options = nil) { |response, operation| ... } click to toggle source

Lists CutoverJobs of a given migrating VM.

@overload list_cutover_jobs(request, options = nil)

Pass arguments to `list_cutover_jobs` via a request object, either of type
{::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest, ::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.

@overload list_cutover_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)

Pass arguments to `list_cutover_jobs` 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 parent [::String]
  Required. The parent, which owns this collection of migrating VMs.
@param page_size [::Integer]
  Optional. The maximum number of cutover jobs to return. The service may return
  fewer than this value. If unspecified, at most 500 cutover jobs will be
  returned. The maximum value is 1000; values above 1000 will be coerced to
  1000.
@param page_token [::String]
  Required. A page token, received from a previous `ListCutoverJobs` call.
  Provide this to retrieve the subsequent page.

  When paginating, all other parameters provided to `ListCutoverJobs` must
  match the call that provided the page token.
@param filter [::String]
  Optional. The filter request.
@param order_by [::String]
  Optional. the order by fields for the result.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CutoverJob>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CutoverJob>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::VMMigration::V1::CutoverJob.
  p response
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 3173
def list_cutover_jobs request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest

  # 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
  metadata = @config.rpcs.list_cutover_jobs.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_cutover_jobs.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_cutover_jobs.retry_policy

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

  @vm_migration_stub.call_rpc :list_cutover_jobs, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_cutover_jobs, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_datacenter_connectors(request, options = nil) { |response, operation| ... } click to toggle source

Lists DatacenterConnectors in a given Source.

@overload list_datacenter_connectors(request, options = nil)

Pass arguments to `list_datacenter_connectors` via a request object, either of type
{::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest, ::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.

@overload list_datacenter_connectors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)

Pass arguments to `list_datacenter_connectors` 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 parent [::String]
  Required. The parent, which owns this collection of connectors.
@param page_size [::Integer]
  Optional. The maximum number of connectors to return. The service may return
  fewer than this value. If unspecified, at most 500 sources will be
  returned. The maximum value is 1000; values above 1000 will be coerced to
  1000.
@param page_token [::String]
  Required. A page token, received from a previous `ListDatacenterConnectors` call.
  Provide this to retrieve the subsequent page.

  When paginating, all other parameters provided to
  `ListDatacenterConnectors` must match the call that provided the page
  token.
@param filter [::String]
  Optional. The filter request.
@param order_by [::String]
  Optional. the order by fields for the result.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::DatacenterConnector>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::DatacenterConnector>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::VMMigration::V1::DatacenterConnector.
  p response
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 1270
def list_datacenter_connectors request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest

  # 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
  metadata = @config.rpcs.list_datacenter_connectors.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_datacenter_connectors.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_datacenter_connectors.retry_policy

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

  @vm_migration_stub.call_rpc :list_datacenter_connectors, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_datacenter_connectors, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_groups(request, options = nil) { |response, operation| ... } click to toggle source

Lists Groups in a given project and location.

@overload list_groups(request, options = nil)

Pass arguments to `list_groups` via a request object, either of type
{::Google::Cloud::VMMigration::V1::ListGroupsRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::ListGroupsRequest, ::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.

@overload list_groups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)

Pass arguments to `list_groups` 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 parent [::String]
  Required. The parent, which owns this collection of groups.
@param page_size [::Integer]
  Optional. The maximum number of groups to return. The service may return
  fewer than this value. If unspecified, at most 500 groups will be
  returned. The maximum value is 1000; values above 1000 will be coerced to
  1000.
@param page_token [::String]
  Required. A page token, received from a previous `ListGroups` call.
  Provide this to retrieve the subsequent page.

  When paginating, all other parameters provided to `ListGroups` must
  match the call that provided the page token.
@param filter [::String]
  Optional. The filter request.
@param order_by [::String]
  Optional. the order by fields for the result.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Group>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Group>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::VMMigration::V1::Group.
  p response
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 3365
def list_groups request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListGroupsRequest

  # 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
  metadata = @config.rpcs.list_groups.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_groups.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_groups.retry_policy

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

  @vm_migration_stub.call_rpc :list_groups, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_groups, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_migrating_vms(request, options = nil) { |response, operation| ... } click to toggle source

Lists MigratingVms in a given Source.

@overload list_migrating_vms(request, options = nil)

Pass arguments to `list_migrating_vms` via a request object, either of type
{::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest, ::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.

@overload list_migrating_vms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)

Pass arguments to `list_migrating_vms` 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 parent [::String]
  Required. The parent, which owns this collection of MigratingVms.
@param page_size [::Integer]
  Optional. The maximum number of migrating VMs to return. The service may return
  fewer than this value. If unspecified, at most 500 migrating VMs will be
  returned. The maximum value is 1000; values above 1000 will be coerced to
  1000.
@param page_token [::String]
  Required. A page token, received from a previous `ListMigratingVms` call.
  Provide this to retrieve the subsequent page.

  When paginating, all other parameters provided to `ListMigratingVms`
  must match the call that provided the page token.
@param filter [::String]
  Optional. The filter request.
@param order_by [::String]
  Optional. the order by fields for the result.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::MigratingVm>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::MigratingVm>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::VMMigration::V1::MigratingVm.
  p response
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 1794
def list_migrating_vms request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest

  # 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
  metadata = @config.rpcs.list_migrating_vms.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_migrating_vms.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_migrating_vms.retry_policy

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

  @vm_migration_stub.call_rpc :list_migrating_vms, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_migrating_vms, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_sources(request, options = nil) { |response, operation| ... } click to toggle source

Lists Sources in a given project and location.

@overload list_sources(request, options = nil)

Pass arguments to `list_sources` via a request object, either of type
{::Google::Cloud::VMMigration::V1::ListSourcesRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::ListSourcesRequest, ::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.

@overload list_sources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)

Pass arguments to `list_sources` 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 parent [::String]
  Required. The parent, which owns this collection of sources.
@param page_size [::Integer]
  Optional. The maximum number of sources to return. The service may return
  fewer than this value. If unspecified, at most 500 sources will be
  returned. The maximum value is 1000; values above 1000 will be coerced to
  1000.
@param page_token [::String]
  Required. A page token, received from a previous `ListSources` call.
  Provide this to retrieve the subsequent page.

  When paginating, all other parameters provided to `ListSources` must
  match the call that provided the page token.
@param filter [::String]
  Optional. The filter request.
@param order_by [::String]
  Optional. the order by fields for the result.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Source>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Source>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::VMMigration::V1::Source.
  p response
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 233
def list_sources request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListSourcesRequest

  # 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
  metadata = @config.rpcs.list_sources.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_sources.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_sources.retry_policy

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

  @vm_migration_stub.call_rpc :list_sources, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_sources, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_target_projects(request, options = nil) { |response, operation| ... } click to toggle source

Lists TargetProjects in a given project.

NOTE: TargetProject is a global resource; hence the only supported value for location is ‘global`.

@overload list_target_projects(request, options = nil)

Pass arguments to `list_target_projects` via a request object, either of type
{::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest, ::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.

@overload list_target_projects(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)

Pass arguments to `list_target_projects` 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 parent [::String]
  Required. The parent, which owns this collection of targets.
@param page_size [::Integer]
  Optional. The maximum number of targets to return. The service may return
  fewer than this value. If unspecified, at most 500 targets will be
  returned. The maximum value is 1000; values above 1000 will be coerced to
  1000.
@param page_token [::String]
  Required. A page token, received from a previous `ListTargets` call.
  Provide this to retrieve the subsequent page.

  When paginating, all other parameters provided to `ListTargets` must
  match the call that provided the page token.
@param filter [::String]
  Optional. The filter request.
@param order_by [::String]
  Optional. the order by fields for the result.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::TargetProject>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::TargetProject>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::VMMigration::V1::TargetProject.
  p response
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 4081
def list_target_projects request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest

  # 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
  metadata = @config.rpcs.list_target_projects.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_target_projects.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_target_projects.retry_policy

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

  @vm_migration_stub.call_rpc :list_target_projects, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_target_projects, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
list_utilization_reports(request, options = nil) { |response, operation| ... } click to toggle source

Lists Utilization Reports of the given Source.

@overload list_utilization_reports(request, options = nil)

Pass arguments to `list_utilization_reports` via a request object, either of type
{::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest, ::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.

@overload list_utilization_reports(parent: nil, view: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)

Pass arguments to `list_utilization_reports` 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 parent [::String]
  Required. The Utilization Reports parent.
@param view [::Google::Cloud::VMMigration::V1::UtilizationReportView]
  Optional. The level of details of each report.
  Defaults to BASIC.
@param page_size [::Integer]
  Optional. The maximum number of reports to return. The service may return
  fewer than this value. If unspecified, at most 500 reports will be
  returned. The maximum value is 1000; values above 1000 will be coerced to
  1000.
@param page_token [::String]
  Required. A page token, received from a previous `ListUtilizationReports` call.
  Provide this to retrieve the subsequent page.

  When paginating, all other parameters provided to `ListUtilizationReports`
  must match the call that provided the page token.
@param filter [::String]
  Optional. The filter request.
@param order_by [::String]
  Optional. the order by fields for the result.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::UtilizationReport>] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::UtilizationReport>]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::VMMigration::V1::UtilizationReport.
  p response
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 851
def list_utilization_reports request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest

  # 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
  metadata = @config.rpcs.list_utilization_reports.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_utilization_reports.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.list_utilization_reports.retry_policy

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

  @vm_migration_stub.call_rpc :list_utilization_reports, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_utilization_reports, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
pause_migration(request, options = nil) { |response, operation| ... } click to toggle source

Pauses a migration for a VM. If cycle tasks are running they will be cancelled, preserving source task data. Further replication cycles will not be triggered while the VM is paused.

@overload pause_migration(request, options = nil)

Pass arguments to `pause_migration` via a request object, either of type
{::Google::Cloud::VMMigration::V1::PauseMigrationRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::PauseMigrationRequest, ::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.

@overload pause_migration(migrating_vm: nil)

Pass arguments to `pause_migration` 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 migrating_vm [::String]
  Required. The name of the MigratingVm.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 2370
def pause_migration request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::PauseMigrationRequest

  # 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
  metadata = @config.rpcs.pause_migration.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.migrating_vm
    header_params["migrating_vm"] = request.migrating_vm
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.pause_migration.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.pause_migration.retry_policy

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

  @vm_migration_stub.call_rpc :pause_migration, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
remove_group_migration(request, options = nil) { |response, operation| ... } click to toggle source

Removes a MigratingVm from a Group.

@overload remove_group_migration(request, options = nil)

Pass arguments to `remove_group_migration` via a request object, either of type
{::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest, ::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.

@overload remove_group_migration(group: nil, migrating_vm: nil)

Pass arguments to `remove_group_migration` 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 group [::String]
  Required. The name of the Group.
@param migrating_vm [::String]
  The MigratingVm to remove.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 3971
def remove_group_migration request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest

  # 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
  metadata = @config.rpcs.remove_group_migration.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.group
    header_params["group"] = request.group
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.remove_group_migration.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.remove_group_migration.retry_policy

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

  @vm_migration_stub.call_rpc :remove_group_migration, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
resume_migration(request, options = nil) { |response, operation| ... } click to toggle source

Resumes a migration for a VM. When called on a paused migration, will start the process of uploading data and creating snapshots; when called on a completed cut-over migration, will update the migration to active state and start the process of uploading data and creating snapshots.

@overload resume_migration(request, options = nil)

Pass arguments to `resume_migration` via a request object, either of type
{::Google::Cloud::VMMigration::V1::ResumeMigrationRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::ResumeMigrationRequest, ::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.

@overload resume_migration(migrating_vm: nil)

Pass arguments to `resume_migration` 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 migrating_vm [::String]
  Required. The name of the MigratingVm.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 2275
def resume_migration request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ResumeMigrationRequest

  # 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
  metadata = @config.rpcs.resume_migration.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.migrating_vm
    header_params["migrating_vm"] = request.migrating_vm
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.resume_migration.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.resume_migration.retry_policy

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

  @vm_migration_stub.call_rpc :resume_migration, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
start_migration(request, options = nil) { |response, operation| ... } click to toggle source

Starts migration for a VM. Starts the process of uploading data and creating snapshots, in replication cycles scheduled by the policy.

@overload start_migration(request, options = nil)

Pass arguments to `start_migration` via a request object, either of type
{::Google::Cloud::VMMigration::V1::StartMigrationRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::StartMigrationRequest, ::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.

@overload start_migration(migrating_vm: nil)

Pass arguments to `start_migration` 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 migrating_vm [::String]
  Required. The name of the MigratingVm.

@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 2179
def start_migration request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::StartMigrationRequest

  # 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
  metadata = @config.rpcs.start_migration.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.migrating_vm
    header_params["migrating_vm"] = request.migrating_vm
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.start_migration.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.start_migration.retry_policy

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

  @vm_migration_stub.call_rpc :start_migration, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
update_group(request, options = nil) { |response, operation| ... } click to toggle source

Updates the parameters of a single Group.

@overload update_group(request, options = nil)

Pass arguments to `update_group` via a request object, either of type
{::Google::Cloud::VMMigration::V1::UpdateGroupRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::UpdateGroupRequest, ::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.

@overload update_group(update_mask: nil, group: nil, request_id: nil)

Pass arguments to `update_group` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash]
  Field mask is used to specify the fields to be overwritten in the
  Group resource by the update.
  The fields specified in the update_mask are relative to the resource, not
  the full request. A field will be overwritten if it is in the mask. If the
  user does not provide a mask then all fields will be overwritten.
@param group [::Google::Cloud::VMMigration::V1::Group, ::Hash]
  Required. The update request body.
@param request_id [::String]
  A 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. The server will guarantee
  that for at least 60 minutes since the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 3674
def update_group request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateGroupRequest

  # 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
  metadata = @config.rpcs.update_group.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.group&.name
    header_params["group.name"] = request.group.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_group.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.update_group.retry_policy

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

  @vm_migration_stub.call_rpc :update_group, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
update_migrating_vm(request, options = nil) { |response, operation| ... } click to toggle source

Updates the parameters of a single MigratingVm.

@overload update_migrating_vm(request, options = nil)

Pass arguments to `update_migrating_vm` via a request object, either of type
{::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest, ::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.

@overload update_migrating_vm(update_mask: nil, migrating_vm: nil, request_id: nil)

Pass arguments to `update_migrating_vm` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash]
  Field mask is used to specify the fields to be overwritten in the
  MigratingVm resource by the update.
  The fields specified in the update_mask are relative to the resource, not
  the full request. A field will be overwritten if it is in the mask. If the
  user does not provide a mask then all fields will be overwritten.
@param migrating_vm [::Google::Cloud::VMMigration::V1::MigratingVm, ::Hash]
  Required. The update request body.
@param request_id [::String]
  A 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. The server will guarantee
  that for at least 60 minutes since the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 1992
def update_migrating_vm request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest

  # 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
  metadata = @config.rpcs.update_migrating_vm.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.migrating_vm&.name
    header_params["migrating_vm.name"] = request.migrating_vm.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_migrating_vm.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.update_migrating_vm.retry_policy

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

  @vm_migration_stub.call_rpc :update_migrating_vm, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
update_source(request, options = nil) { |response, operation| ... } click to toggle source

Updates the parameters of a single Source.

@overload update_source(request, options = nil)

Pass arguments to `update_source` via a request object, either of type
{::Google::Cloud::VMMigration::V1::UpdateSourceRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::UpdateSourceRequest, ::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.

@overload update_source(update_mask: nil, source: nil, request_id: nil)

Pass arguments to `update_source` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash]
  Field mask is used to specify the fields to be overwritten in the
  Source resource by the update.
  The fields specified in the update_mask are relative to the resource, not
  the full request. A field will be overwritten if it is in the mask. If the
  user does not provide a mask then all fields will be overwritten.
@param source [::Google::Cloud::VMMigration::V1::Source, ::Hash]
  Required. The update request body.
@param request_id [::String]
  A 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. The server will guarantee
  that for at least 60 minutes since the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 542
def update_source request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateSourceRequest

  # 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
  metadata = @config.rpcs.update_source.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.source&.name
    header_params["source.name"] = request.source.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_source.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.update_source.retry_policy

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

  @vm_migration_stub.call_rpc :update_source, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end
update_target_project(request, options = nil) { |response, operation| ... } click to toggle source

Updates the parameters of a single TargetProject.

NOTE: TargetProject is a global resource; hence the only supported value for location is ‘global`.

@overload update_target_project(request, options = nil)

Pass arguments to `update_target_project` via a request object, either of type
{::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest} or an equivalent Hash.

@param request [::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest, ::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.

@overload update_target_project(update_mask: nil, target_project: nil, request_id: nil)

Pass arguments to `update_target_project` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash]
  Field mask is used to specify the fields to be overwritten in the
  TargetProject resource by the update.
  The fields specified in the update_mask are relative to the resource, not
  the full request. A field will be overwritten if it is in the mask. If the
  user does not provide a mask then all fields will be overwritten.
@param target_project [::Google::Cloud::VMMigration::V1::TargetProject, ::Hash]
  Required. The update request body.
@param request_id [::String]
  A 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. The server will guarantee
  that for at least 60 minutes since the first request.

  For example, consider a situation where you make an initial request and t
  he 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 [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]

@return [::Gapic::Operation]

@raise [::Google::Cloud::Error] if the RPC is aborted.

@example Basic example

require "google/cloud/vm_migration/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end
# File lib/google/cloud/vm_migration/v1/vm_migration/client.rb, line 4399
def update_target_project request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest

  # 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
  metadata = @config.rpcs.update_target_project.metadata.to_h

  # Set x-goog-api-client and x-goog-user-project headers
  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::VMMigration::V1::VERSION
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.target_project&.name
    header_params["target_project.name"] = request.target_project.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  metadata[:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_target_project.timeout,
                         metadata:     metadata,
                         retry_policy: @config.rpcs.update_target_project.retry_policy

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

  @vm_migration_stub.call_rpc :update_target_project, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end