class Google::Cloud::CloudDMS::V1::DataMigrationService::Client
Client
for the DataMigrationService
service.
Database Migration service
Attributes
@private
Get the associated client for long-running operations.
@return [::Google::Cloud::CloudDMS::V1::DataMigrationService::Operations]
Public Class Methods
Configure the DataMigrationService
Client
class.
See {::Google::Cloud::CloudDMS::V1::DataMigrationService::Client::Configuration} for a description of the configuration fields.
@example
# Modify the configuration for all DataMigrationService clients ::Google::Cloud::CloudDMS::V1::DataMigrationService::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/cloud_dms/v1/data_migration_service/client.rb, line 56 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "CloudDMS", "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.retry_policy = { initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] } default_config.rpcs.list_migration_jobs.timeout = 60.0 default_config.rpcs.get_migration_job.timeout = 60.0 default_config.rpcs.create_migration_job.timeout = 60.0 default_config.rpcs.update_migration_job.timeout = 60.0 default_config.rpcs.delete_migration_job.timeout = 60.0 default_config.rpcs.start_migration_job.timeout = 60.0 default_config.rpcs.stop_migration_job.timeout = 60.0 default_config.rpcs.resume_migration_job.timeout = 60.0 default_config.rpcs.promote_migration_job.timeout = 60.0 default_config.rpcs.verify_migration_job.timeout = 60.0 default_config.rpcs.restart_migration_job.timeout = 60.0 default_config.rpcs.generate_ssh_script.timeout = 60.0 default_config.rpcs.list_connection_profiles.timeout = 60.0 default_config.rpcs.get_connection_profile.timeout = 60.0 default_config.rpcs.create_connection_profile.timeout = 60.0 default_config.rpcs.update_connection_profile.timeout = 60.0 default_config.rpcs.delete_connection_profile.timeout = 60.0 default_config end yield @configure if block_given? @configure end
Create a new DataMigrationService
client object.
@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
@yield [config] Configure the DataMigrationService
client. @yieldparam config [Client::Configuration]
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 148 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/clouddms/v1/clouddms_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.endpoint = @config.endpoint end @data_migration_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::CloudDMS::V1::DataMigrationService::Stub, credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, interceptors: @config.interceptors ) end
Public Instance Methods
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 {::Google::Cloud::CloudDMS::V1::DataMigrationService::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/cloud_dms/v1/data_migration_service/client.rb, line 127 def configure yield @config if block_given? @config end
Creates a new connection profile in a given project and location.
@overload create_connection_profile
(request, options = nil)
Pass arguments to `create_connection_profile` via a request object, either of type {::Google::Cloud::CloudDMS::V1::CreateConnectionProfileRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload create_connection_profile
(parent: nil, connection_profile_id: nil, connection_profile: nil, request_id: nil)
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). @param parent [::String] Required. The parent, which owns this collection of connection profiles. @param connection_profile_id [::String] Required. The connection profile identifier. @param connection_profile [::Google::Cloud::CloudDMS::V1::ConnectionProfile, ::Hash] Required. The create request body including the connection profile data @param 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.
@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.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 1300 def create_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::CreateConnectionProfileRequest # 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_connection_profile.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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } 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_connection_profile.timeout, metadata: metadata, retry_policy: @config.rpcs.create_connection_profile.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :create_connection_profile, 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
Creates a new migration job in a given project and location.
@overload create_migration_job
(request, options = nil)
Pass arguments to `create_migration_job` via a request object, either of type {::Google::Cloud::CloudDMS::V1::CreateMigrationJobRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload create_migration_job
(parent: nil, migration_job_id: nil, migration_job: nil, request_id: nil)
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). @param parent [::String] Required. The parent, which owns this collection of migration jobs. @param migration_job_id [::String] Required. The ID of the instance to create. @param migration_job [::Google::Cloud::CloudDMS::V1::MigrationJob, ::Hash] Required. Represents a [migration job](https://cloud.google.com/database-migration/docs/reference/rest/v1/projects.locations.migrationJobs) object. @param 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.
@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.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 402 def create_migration_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::CreateMigrationJobRequest # 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_migration_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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } 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_migration_job.timeout, metadata: metadata, retry_policy: @config.rpcs.create_migration_job.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :create_migration_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
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.
@overload delete_connection_profile
(request, options = nil)
Pass arguments to `delete_connection_profile` via a request object, either of type {::Google::Cloud::CloudDMS::V1::DeleteConnectionProfileRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload delete_connection_profile
(name: nil, request_id: nil, force: nil)
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). @param name [::String] Required. Name of the connection profile resource to delete. @param 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. @param force [::Boolean] In case of force delete, the CloudSQL replica database is also deleted (only for CloudSQL connection profile).
@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.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 1462 def delete_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::DeleteConnectionProfileRequest # 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_connection_profile.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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } 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_connection_profile.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_connection_profile.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :delete_connection_profile, 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
Deletes a single migration job.
@overload delete_migration_job
(request, options = nil)
Pass arguments to `delete_migration_job` via a request object, either of type {::Google::Cloud::CloudDMS::V1::DeleteMigrationJobRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload delete_migration_job
(name: nil, request_id: nil, force: nil)
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). @param name [::String] Required. Name of the migration job resource to delete. @param 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. @param 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.
@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.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 563 def delete_migration_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::DeleteMigrationJobRequest # 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_migration_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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } 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_migration_job.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_migration_job.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :delete_migration_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
Generate a SSH configuration script to configure the reverse SSH connectivity.
@overload generate_ssh_script
(request, options = nil)
Pass arguments to `generate_ssh_script` via a request object, either of type {::Google::Cloud::CloudDMS::V1::GenerateSshScriptRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload generate_ssh_script
(migration_job: nil, vm: nil, vm_creation_config: nil, vm_selection_config: nil, vm_port: nil)
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). @param migration_job [::String] Name of the migration job resource to generate the SSH script. @param vm [::String] Required. Bastion VM Instance name to use or to create. @param vm_creation_config [::Google::Cloud::CloudDMS::V1::VmCreationConfig, ::Hash] The VM creation configuration @param vm_selection_config [::Google::Cloud::CloudDMS::V1::VmSelectionConfig, ::Hash] The VM selection configuration @param vm_port [::Integer] The port that will be open on the bastion host
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::CloudDMS::V1::SshScript] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::CloudDMS::V1::SshScript]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 1060 def generate_ssh_script request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::GenerateSshScriptRequest # 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.generate_ssh_script.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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "migration_job" => request.migration_job } 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.generate_ssh_script.timeout, metadata: metadata, retry_policy: @config.rpcs.generate_ssh_script.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :generate_ssh_script, 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
Gets details of a single connection profile.
@overload get_connection_profile
(request, options = nil)
Pass arguments to `get_connection_profile` via a request object, either of type {::Google::Cloud::CloudDMS::V1::GetConnectionProfileRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload get_connection_profile
(name: nil)
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). @param name [::String] Required. Name of the connection profile resource to get.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::CloudDMS::V1::ConnectionProfile] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::CloudDMS::V1::ConnectionProfile]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 1220 def get_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::GetConnectionProfileRequest # 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_connection_profile.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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } 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_connection_profile.timeout, metadata: metadata, retry_policy: @config.rpcs.get_connection_profile.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :get_connection_profile, 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
Gets details of a single migration job.
@overload get_migration_job
(request, options = nil)
Pass arguments to `get_migration_job` via a request object, either of type {::Google::Cloud::CloudDMS::V1::GetMigrationJobRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload get_migration_job
(name: nil)
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). @param name [::String] Required. Name of the migration job resource to get.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::CloudDMS::V1::MigrationJob] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::CloudDMS::V1::MigrationJob]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 320 def get_migration_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::GetMigrationJobRequest # 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_migration_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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } 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_migration_job.timeout, metadata: metadata, retry_policy: @config.rpcs.get_migration_job.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :get_migration_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
Retrieve a list of all connection profiles in a given project and location.
@overload list_connection_profiles
(request, options = nil)
Pass arguments to `list_connection_profiles` via a request object, either of type {::Google::Cloud::CloudDMS::V1::ListConnectionProfilesRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload list_connection_profiles
(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
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). @param parent [::String] Required. The parent, which owns this collection of connection profiles. @param 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. @param 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. @param 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. @param order_by [::String] the order by fields for the result.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::CloudDMS::V1::ConnectionProfile>] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::PagedEnumerable<::Google::Cloud::CloudDMS::V1::ConnectionProfile>]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 1151 def list_connection_profiles request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::ListConnectionProfilesRequest # 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_connection_profiles.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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } 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_connection_profiles.timeout, metadata: metadata, retry_policy: @config.rpcs.list_connection_profiles.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :list_connection_profiles, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @data_migration_service_stub, :list_connection_profiles, 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
Lists migration jobs in a given project and location.
@overload list_migration_jobs
(request, options = nil)
Pass arguments to `list_migration_jobs` via a request object, either of type {::Google::Cloud::CloudDMS::V1::ListMigrationJobsRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload list_migration_jobs
(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
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). @param parent [::String] Required. The parent, which owns this collection of migrationJobs. @param 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. @param 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. @param 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. @param order_by [::String] Sort the results based on the migration job name. Valid values are: "name", "name asc", and "name desc".
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::CloudDMS::V1::MigrationJob>] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::PagedEnumerable<::Google::Cloud::CloudDMS::V1::MigrationJob>]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 251 def list_migration_jobs request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::ListMigrationJobsRequest # 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_migration_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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } 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_migration_jobs.timeout, metadata: metadata, retry_policy: @config.rpcs.list_migration_jobs.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :list_migration_jobs, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @data_migration_service_stub, :list_migration_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
Promote a migration job, stopping replication to the destination and promoting the destination to be a standalone database.
@overload promote_migration_job
(request, options = nil)
Pass arguments to `promote_migration_job` via a request object, either of type {::Google::Cloud::CloudDMS::V1::PromoteMigrationJobRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload promote_migration_job
(name: nil)
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). @param name [::String] Name of the migration job resource to promote.
@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.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 841 def promote_migration_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::PromoteMigrationJobRequest # 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.promote_migration_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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } 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.promote_migration_job.timeout, metadata: metadata, retry_policy: @config.rpcs.promote_migration_job.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :promote_migration_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
Restart a stopped or failed migration job, resetting the destination instance to its original state and starting the migration process from scratch.
@overload restart_migration_job
(request, options = nil)
Pass arguments to `restart_migration_job` via a request object, either of type {::Google::Cloud::CloudDMS::V1::RestartMigrationJobRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload restart_migration_job
(name: nil)
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). @param name [::String] Name of the migration job resource to restart.
@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.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 982 def restart_migration_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::RestartMigrationJobRequest # 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.restart_migration_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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } 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.restart_migration_job.timeout, metadata: metadata, retry_policy: @config.rpcs.restart_migration_job.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :restart_migration_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
Resume a migration job that is currently stopped and is resumable (was stopped during CDC phase).
@overload resume_migration_job
(request, options = nil)
Pass arguments to `resume_migration_job` via a request object, either of type {::Google::Cloud::CloudDMS::V1::ResumeMigrationJobRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload resume_migration_job
(name: nil)
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). @param name [::String] Name of the migration job resource to resume.
@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.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 771 def resume_migration_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::ResumeMigrationJobRequest # 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_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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } 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_job.timeout, metadata: metadata, retry_policy: @config.rpcs.resume_migration_job.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :resume_migration_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
Start an already created migration job.
@overload start_migration_job
(request, options = nil)
Pass arguments to `start_migration_job` via a request object, either of type {::Google::Cloud::CloudDMS::V1::StartMigrationJobRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload start_migration_job
(name: nil)
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). @param name [::String] Name of the migration job resource to start.
@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.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 632 def start_migration_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::StartMigrationJobRequest # 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_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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } 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_job.timeout, metadata: metadata, retry_policy: @config.rpcs.start_migration_job.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :start_migration_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
Stops a running migration job.
@overload stop_migration_job
(request, options = nil)
Pass arguments to `stop_migration_job` via a request object, either of type {::Google::Cloud::CloudDMS::V1::StopMigrationJobRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload stop_migration_job
(name: nil)
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). @param name [::String] Name of the migration job resource to stop.
@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.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 701 def stop_migration_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::StopMigrationJobRequest # 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.stop_migration_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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } 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.stop_migration_job.timeout, metadata: metadata, retry_policy: @config.rpcs.stop_migration_job.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :stop_migration_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
Update the configuration of a single connection profile.
@overload update_connection_profile
(request, options = nil)
Pass arguments to `update_connection_profile` via a request object, either of type {::Google::Cloud::CloudDMS::V1::UpdateConnectionProfileRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload update_connection_profile
(update_mask: nil, connection_profile: nil, request_id: nil)
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). @param 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. @param connection_profile [::Google::Cloud::CloudDMS::V1::ConnectionProfile, ::Hash] Required. The connection profile parameters to update. @param 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.
@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.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 1380 def update_connection_profile request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::UpdateConnectionProfileRequest # 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_connection_profile.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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "connection_profile.name" => request.connection_profile.name } 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_connection_profile.timeout, metadata: metadata, retry_policy: @config.rpcs.update_connection_profile.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :update_connection_profile, 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
Updates the parameters of a single migration job.
@overload update_migration_job
(request, options = nil)
Pass arguments to `update_migration_job` via a request object, either of type {::Google::Cloud::CloudDMS::V1::UpdateMigrationJobRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload update_migration_job
(update_mask: nil, migration_job: nil, request_id: nil)
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). @param 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. @param migration_job [::Google::Cloud::CloudDMS::V1::MigrationJob, ::Hash] Required. The migration job parameters to update. @param 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.
@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.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 482 def update_migration_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::UpdateMigrationJobRequest # 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_migration_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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "migration_job.name" => request.migration_job.name } 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_migration_job.timeout, metadata: metadata, retry_policy: @config.rpcs.update_migration_job.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :update_migration_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
Verify a migration job, making sure the destination can reach the source and that all configuration and prerequisites are met.
@overload verify_migration_job
(request, options = nil)
Pass arguments to `verify_migration_job` via a request object, either of type {::Google::Cloud::CloudDMS::V1::VerifyMigrationJobRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload verify_migration_job
(name: nil)
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). @param name [::String] Name of the migration job resource to verify.
@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.
# File lib/google/cloud/cloud_dms/v1/data_migration_service/client.rb, line 911 def verify_migration_job request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudDMS::V1::VerifyMigrationJobRequest # 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.verify_migration_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::CloudDMS::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } 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.verify_migration_job.timeout, metadata: metadata, retry_policy: @config.rpcs.verify_migration_job.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @data_migration_service_stub.call_rpc :verify_migration_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