Cloud Database Migration Service V1 API - Class Google::Cloud::CloudDMS::V1::DataMigrationService::Client (v0.1.5)

Reference documentation and code samples for the Cloud Database Migration Service V1 API class Google::Cloud::CloudDMS::V1::DataMigrationService::Client.

Client for the DataMigrationService service.

Database Migration service

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the DataMigrationService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all DataMigrationService clients
::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the DataMigrationService 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 Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_connection_profile

def create_connection_profile(request, options = nil) -> ::Gapic::Operation
def create_connection_profile(parent: nil, connection_profile_id: nil, connection_profile: nil, request_id: nil) -> ::Gapic::Operation

Creates a new connection profile in a given project and location.

Overloads
def create_connection_profile(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_connection_profile via a request object, either of type CreateConnectionProfileRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::CreateConnectionProfileRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_connection_profile(parent: nil, connection_profile_id: nil, connection_profile: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to create_connection_profile via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent, which owns this collection of connection profiles.
  • connection_profile_id (::String) — Required. The connection profile identifier.
  • connection_profile (::Google::Cloud::CloudDMS::V1::ConnectionProfile, ::Hash) — Required. The create request body including the connection profile data
  • request_id (::String) — A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored.

    It is recommended to always set this value to a UUID.

    The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

# Call the create_connection_profile method.
result = client.create_connection_profile 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

#create_migration_job

def create_migration_job(request, options = nil) -> ::Gapic::Operation
def create_migration_job(parent: nil, migration_job_id: nil, migration_job: nil, request_id: nil) -> ::Gapic::Operation

Creates a new migration job in a given project and location.

Overloads
def create_migration_job(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_migration_job via a request object, either of type CreateMigrationJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::CreateMigrationJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_migration_job(parent: nil, migration_job_id: nil, migration_job: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to create_migration_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).
Parameters
  • parent (::String) — Required. The parent, which owns this collection of migration jobs.
  • migration_job_id (::String) — Required. The ID of the instance to create.
  • migration_job (::Google::Cloud::CloudDMS::V1::MigrationJob, ::Hash) — Required. Represents a migration job object.
  • request_id (::String) — A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored.

    It is recommended to always set this value to a UUID.

    The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

# Call the create_migration_job method.
result = client.create_migration_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

#delete_connection_profile

def delete_connection_profile(request, options = nil) -> ::Gapic::Operation
def delete_connection_profile(name: nil, request_id: nil, force: nil) -> ::Gapic::Operation

Deletes a single Database Migration Service connection profile. A connection profile can only be deleted if it is not in use by any active migration jobs.

Overloads
def delete_connection_profile(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_connection_profile via a request object, either of type Google::Cloud::CloudDMS::V1::DeleteConnectionProfileRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::DeleteConnectionProfileRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_connection_profile(name: nil, request_id: nil, force: nil) -> ::Gapic::Operation
Pass arguments to delete_connection_profile via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. Name of the connection profile resource to delete.
  • request_id (::String) — A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored.

    It is recommended to always set this value to a UUID.

    The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

  • force (::Boolean) — In case of force delete, the CloudSQL replica database is also deleted (only for CloudSQL connection profile).
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

# Call the delete_connection_profile method.
result = client.delete_connection_profile 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

#delete_migration_job

def delete_migration_job(request, options = nil) -> ::Gapic::Operation
def delete_migration_job(name: nil, request_id: nil, force: nil) -> ::Gapic::Operation

Deletes a single migration job.

Overloads
def delete_migration_job(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_migration_job via a request object, either of type Google::Cloud::CloudDMS::V1::DeleteMigrationJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::DeleteMigrationJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_migration_job(name: nil, request_id: nil, force: nil) -> ::Gapic::Operation
Pass arguments to delete_migration_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).
Parameters
  • name (::String) — Required. Name of the migration job resource to delete.
  • request_id (::String) — A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored.

    It is recommended to always set this value to a UUID.

    The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

  • force (::Boolean) — The destination CloudSQL connection profile is always deleted with the migration job. In case of force delete, the destination CloudSQL replica database is also deleted.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

# Call the delete_migration_job method.
result = client.delete_migration_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

#generate_ssh_script

def generate_ssh_script(request, options = nil) -> ::Google::Cloud::CloudDMS::V1::SshScript
def generate_ssh_script(migration_job: nil, vm: nil, vm_creation_config: nil, vm_selection_config: nil, vm_port: nil) -> ::Google::Cloud::CloudDMS::V1::SshScript

Generate a SSH configuration script to configure the reverse SSH connectivity.

Overloads
def generate_ssh_script(request, options = nil) -> ::Google::Cloud::CloudDMS::V1::SshScript
Pass arguments to generate_ssh_script via a request object, either of type GenerateSshScriptRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::GenerateSshScriptRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def generate_ssh_script(migration_job: nil, vm: nil, vm_creation_config: nil, vm_selection_config: nil, vm_port: nil) -> ::Google::Cloud::CloudDMS::V1::SshScript
Pass arguments to generate_ssh_script via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

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

# The returned object is of type Google::Cloud::CloudDMS::V1::SshScript.
p result

#get_connection_profile

def get_connection_profile(request, options = nil) -> ::Google::Cloud::CloudDMS::V1::ConnectionProfile
def get_connection_profile(name: nil) -> ::Google::Cloud::CloudDMS::V1::ConnectionProfile

Gets details of a single connection profile.

Overloads
def get_connection_profile(request, options = nil) -> ::Google::Cloud::CloudDMS::V1::ConnectionProfile
Pass arguments to get_connection_profile via a request object, either of type GetConnectionProfileRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::GetConnectionProfileRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_connection_profile(name: nil) -> ::Google::Cloud::CloudDMS::V1::ConnectionProfile
Pass arguments to get_connection_profile 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).
Parameter
  • name (::String) — Required. Name of the connection profile resource to get.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

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

# The returned object is of type Google::Cloud::CloudDMS::V1::ConnectionProfile.
p result

#get_migration_job

def get_migration_job(request, options = nil) -> ::Google::Cloud::CloudDMS::V1::MigrationJob
def get_migration_job(name: nil) -> ::Google::Cloud::CloudDMS::V1::MigrationJob

Gets details of a single migration job.

Overloads
def get_migration_job(request, options = nil) -> ::Google::Cloud::CloudDMS::V1::MigrationJob
Pass arguments to get_migration_job via a request object, either of type GetMigrationJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::GetMigrationJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_migration_job(name: nil) -> ::Google::Cloud::CloudDMS::V1::MigrationJob
Pass arguments to get_migration_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).
Parameter
  • name (::String) — Required. Name of the migration job resource to get.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

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

# The returned object is of type Google::Cloud::CloudDMS::V1::MigrationJob.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new DataMigrationService client object.

Yields
  • (config) — Configure the DataMigrationService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new

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

#list_connection_profiles

def list_connection_profiles(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::CloudDMS::V1::ConnectionProfile>
def list_connection_profiles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::CloudDMS::V1::ConnectionProfile>

Retrieve a list of all connection profiles in a given project and location.

Overloads
def list_connection_profiles(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::CloudDMS::V1::ConnectionProfile>
Pass arguments to list_connection_profiles via a request object, either of type ListConnectionProfilesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::ListConnectionProfilesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_connection_profiles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::CloudDMS::V1::ConnectionProfile>
Pass arguments to list_connection_profiles via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent, which owns this collection of connection profiles.
  • page_size (::Integer) — The maximum number of connection profiles to return. The service may return fewer than this value. If unspecified, at most 50 connection profiles will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
  • page_token (::String) — A page token, received from a previous ListConnectionProfiles call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to ListConnectionProfiles must match the call that provided the page token.

  • filter (::String) — A filter expression that filters connection profiles listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, list connection profiles created this year by specifying createTime %gt; 2020-01-01T00:00:00.000000000Z. You can also filter nested fields. For example, you could specify mySql.username = %lt;my_username%gt; to list all connection profiles configured to connect with a specific username.
  • order_by (::String) — the order by fields for the result.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

# Call the list_connection_profiles method.
result = client.list_connection_profiles 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::CloudDMS::V1::ConnectionProfile.
  p response
end

#list_migration_jobs

def list_migration_jobs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::CloudDMS::V1::MigrationJob>
def list_migration_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::CloudDMS::V1::MigrationJob>

Lists migration jobs in a given project and location.

Overloads
def list_migration_jobs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::CloudDMS::V1::MigrationJob>
Pass arguments to list_migration_jobs via a request object, either of type ListMigrationJobsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::ListMigrationJobsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_migration_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::CloudDMS::V1::MigrationJob>
Pass arguments to list_migration_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).
Parameters
  • parent (::String) — Required. The parent, which owns this collection of migrationJobs.
  • page_size (::Integer) — The maximum number of migration jobs to return. The service may return fewer than this value. If unspecified, at most 50 migration jobs will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
  • page_token (::String) — The nextPageToken value received in the previous call to migrationJobs.list, used in the subsequent request to retrieve the next page of results. On first call this should be left blank. When paginating, all other parameters provided to migrationJobs.list must match the call that provided the page token.
  • filter (::String) — A filter expression that filters migration jobs listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, list migration jobs created this year by specifying createTime %gt; 2020-01-01T00:00:00.000000000Z. You can also filter nested fields. For example, you could specify reverseSshConnectivity.vmIp = "1.2.3.4" to select all migration jobs connecting through the specific SSH tunnel bastion.
  • order_by (::String) — Sort the results based on the migration job name. Valid values are: "name", "name asc", and "name desc".
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

# Call the list_migration_jobs method.
result = client.list_migration_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::CloudDMS::V1::MigrationJob.
  p response
end

#operations_client

def operations_client() -> ::Google::Cloud::CloudDMS::V1::DataMigrationService::Operations

Get the associated client for long-running operations.

#promote_migration_job

def promote_migration_job(request, options = nil) -> ::Gapic::Operation
def promote_migration_job(name: nil) -> ::Gapic::Operation

Promote a migration job, stopping replication to the destination and promoting the destination to be a standalone database.

Overloads
def promote_migration_job(request, options = nil) -> ::Gapic::Operation
Pass arguments to promote_migration_job via a request object, either of type PromoteMigrationJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::PromoteMigrationJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def promote_migration_job(name: nil) -> ::Gapic::Operation
Pass arguments to promote_migration_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).
Parameter
  • name (::String) — Name of the migration job resource to promote.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

# Call the promote_migration_job method.
result = client.promote_migration_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

#restart_migration_job

def restart_migration_job(request, options = nil) -> ::Gapic::Operation
def restart_migration_job(name: nil) -> ::Gapic::Operation

Restart a stopped or failed migration job, resetting the destination instance to its original state and starting the migration process from scratch.

Overloads
def restart_migration_job(request, options = nil) -> ::Gapic::Operation
Pass arguments to restart_migration_job via a request object, either of type RestartMigrationJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::RestartMigrationJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def restart_migration_job(name: nil) -> ::Gapic::Operation
Pass arguments to restart_migration_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).
Parameter
  • name (::String) — Name of the migration job resource to restart.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

# Call the restart_migration_job method.
result = client.restart_migration_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

#resume_migration_job

def resume_migration_job(request, options = nil) -> ::Gapic::Operation
def resume_migration_job(name: nil) -> ::Gapic::Operation

Resume a migration job that is currently stopped and is resumable (was stopped during CDC phase).

Overloads
def resume_migration_job(request, options = nil) -> ::Gapic::Operation
Pass arguments to resume_migration_job via a request object, either of type ResumeMigrationJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::ResumeMigrationJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def resume_migration_job(name: nil) -> ::Gapic::Operation
Pass arguments to resume_migration_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).
Parameter
  • name (::String) — Name of the migration job resource to resume.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

# Call the resume_migration_job method.
result = client.resume_migration_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

#start_migration_job

def start_migration_job(request, options = nil) -> ::Gapic::Operation
def start_migration_job(name: nil) -> ::Gapic::Operation

Start an already created migration job.

Overloads
def start_migration_job(request, options = nil) -> ::Gapic::Operation
Pass arguments to start_migration_job via a request object, either of type StartMigrationJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::StartMigrationJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def start_migration_job(name: nil) -> ::Gapic::Operation
Pass arguments to start_migration_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).
Parameter
  • name (::String) — Name of the migration job resource to start.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

# Call the start_migration_job method.
result = client.start_migration_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

#stop_migration_job

def stop_migration_job(request, options = nil) -> ::Gapic::Operation
def stop_migration_job(name: nil) -> ::Gapic::Operation

Stops a running migration job.

Overloads
def stop_migration_job(request, options = nil) -> ::Gapic::Operation
Pass arguments to stop_migration_job via a request object, either of type StopMigrationJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::StopMigrationJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def stop_migration_job(name: nil) -> ::Gapic::Operation
Pass arguments to stop_migration_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).
Parameter
  • name (::String) — Name of the migration job resource to stop.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

# Call the stop_migration_job method.
result = client.stop_migration_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

#update_connection_profile

def update_connection_profile(request, options = nil) -> ::Gapic::Operation
def update_connection_profile(update_mask: nil, connection_profile: nil, request_id: nil) -> ::Gapic::Operation

Update the configuration of a single connection profile.

Overloads
def update_connection_profile(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_connection_profile via a request object, either of type UpdateConnectionProfileRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::UpdateConnectionProfileRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_connection_profile(update_mask: nil, connection_profile: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to update_connection_profile via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Field mask is used to specify the fields to be overwritten in the connection profile resource by the update.
  • connection_profile (::Google::Cloud::CloudDMS::V1::ConnectionProfile, ::Hash) — Required. The connection profile parameters to update.
  • request_id (::String) — A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored.

    It is recommended to always set this value to a UUID.

    The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

# Call the update_connection_profile method.
result = client.update_connection_profile 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

#update_migration_job

def update_migration_job(request, options = nil) -> ::Gapic::Operation
def update_migration_job(update_mask: nil, migration_job: nil, request_id: nil) -> ::Gapic::Operation

Updates the parameters of a single migration job.

Overloads
def update_migration_job(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_migration_job via a request object, either of type UpdateMigrationJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::UpdateMigrationJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_migration_job(update_mask: nil, migration_job: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to update_migration_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).
Parameters
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Field mask is used to specify the fields to be overwritten in the migration job resource by the update.
  • migration_job (::Google::Cloud::CloudDMS::V1::MigrationJob, ::Hash) — Required. The migration job parameters to update.
  • request_id (::String) — A unique id used to identify the request. If the server receives two requests with the same id, then the second request will be ignored.

    It is recommended to always set this value to a UUID.

    The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

# Call the update_migration_job method.
result = client.update_migration_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

#verify_migration_job

def verify_migration_job(request, options = nil) -> ::Gapic::Operation
def verify_migration_job(name: nil) -> ::Gapic::Operation

Verify a migration job, making sure the destination can reach the source and that all configuration and prerequisites are met.

Overloads
def verify_migration_job(request, options = nil) -> ::Gapic::Operation
Pass arguments to verify_migration_job via a request object, either of type VerifyMigrationJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::CloudDMS::V1::VerifyMigrationJobRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def verify_migration_job(name: nil) -> ::Gapic::Operation
Pass arguments to verify_migration_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).
Parameter
  • name (::String) — Name of the migration job resource to verify.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/cloud_dms/v1"

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

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

# Call the verify_migration_job method.
result = client.verify_migration_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