class OCI::ApplicationMigration::ApplicationMigrationClient

Application Migration simplifies the migration of applications from Oracle Cloud Infrastructure Classic to Oracle Cloud Infrastructure. You can use Application Migration API to migrate applications, such as Oracle Java Cloud Service, SOA Cloud Service, and Integration Classic instances, to Oracle Cloud Infrastructure. For more information, see [Overview of Application Migration](/iaas/application-migration/appmigrationoverview.htm).

Attributes

api_client[R]

Client used to make HTTP requests. @return [OCI::ApiClient]

endpoint[R]

Fully qualified endpoint URL @return [String]

region[R]

The region, which will usually correspond to a value in {OCI::Regions::REGION_ENUM}. @return [String]

retry_config[R]

The default retry configuration to apply to all operations in this service client. This can be overridden on a per-operation basis. The default retry configuration value is `nil`, which means that an operation will not perform any retries @return [OCI::Retry::RetryConfig]

Public Class Methods

new(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) click to toggle source

Creates a new ApplicationMigrationClient. Notes:

If a config is not specified, then the global OCI.config will be used.

This client is not thread-safe

Either a region or an endpoint must be specified.  If an endpoint is specified, it will be used instead of the
  region. A region may be specified in the config or via or the region parameter. If specified in both, then the
  region parameter will be used.

@param [Config] config A Config object. @param [String] region A region used to determine the service endpoint. This will usually

correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.

@param [String] endpoint The fully qualified endpoint URL @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then

a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
so that the instance principals signer can be provided to the client

@param [OCI::ApiClientProxySettings] proxy_settings If your environment requires you to use a proxy server for outgoing HTTP requests

the details for the proxy can be provided in this parameter

@param [OCI::Retry::RetryConfig] retry_config The retry configuration for this service client. This represents the default retry configuration to

apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
will not perform any retries
# File lib/oci/application_migration/application_migration_client.rb, line 56
def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
  # If the signer is an InstancePrincipalsSecurityTokenSigner or SecurityTokenSigner and no config was supplied (they are self-sufficient signers)
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
  # pass it to this constructor.
  #
  # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
  # so try and load the config from the default file.
  config = OCI::Config.validate_and_build_config_with_signer(config, signer)

  signer = OCI::Signer.config_file_auth_builder(config) if signer.nil?

  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
  @retry_config = retry_config

  if endpoint
    @endpoint = endpoint + '/20191031'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "ApplicationMigrationClient endpoint set to '#{@endpoint}'." if logger
end

Public Instance Methods

cancel_work_request(work_request_id, opts = {}) click to toggle source

Cancels the specified work request. When you cancel a work request, it causes the in-progress task to be canceled. For example, if the create migration work request is in the accepted or in progress state for a long time, you can cancel the work request.

When you cancel a work request, the state of the work request changes to cancelling, and then to the cancelled state.

@param [String] work_request_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the work request. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@option opts [String] :if_match For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match`

parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource
will be updated or deleted only if the etag you provide matches the resource's current etag value.

@return [Response] A Response object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/cancel_work_request.rb.html) to see an example of how to use cancel_work_request API.

# File lib/oci/application_migration/application_migration_client.rb, line 122
def cancel_work_request(work_request_id, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#cancel_work_request.' if logger

  raise "Missing the required parameter 'work_request_id' when calling cancel_work_request." if work_request_id.nil?
  raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id)

  path = '/workRequests/{workRequestId}'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#cancel_work_request') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end
change_migration_compartment(migration_id, change_migration_compartment_details, opts = {}) click to toggle source

Moves the specified migration into a different compartment within the same tenancy. For information about moving resources between compartments, see [Moving Resources to a Different Compartment](docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).

@param [String] migration_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the migration. @param [OCI::ApplicationMigration::Models::ChangeCompartmentDetails] change_migration_compartment_details The updated compartment details @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :if_match For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match`

parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource
will be updated or deleted only if the etag you provide matches the resource's current etag value.

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or

server error without risk of retrying the same action. Retry tokens expire after
24 hours, but can be invalidated before then due to conflicting operations. For example,
if a resource has been deleted and purged from the system, then a retry of the original
creation request may be rejected.

@return [Response] A Response object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/change_migration_compartment.rb.html) to see an example of how to use change_migration_compartment API.

# File lib/oci/application_migration/application_migration_client.rb, line 191
def change_migration_compartment(migration_id, change_migration_compartment_details, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#change_migration_compartment.' if logger

  raise "Missing the required parameter 'migration_id' when calling change_migration_compartment." if migration_id.nil?
  raise "Missing the required parameter 'change_migration_compartment_details' when calling change_migration_compartment." if change_migration_compartment_details.nil?
  raise "Parameter value for 'migration_id' must not be blank" if OCI::Internal::Util.blank_string?(migration_id)

  path = '/migrations/{migrationId}/actions/changeCompartment'.sub('{migrationId}', migration_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(change_migration_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#change_migration_compartment') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end
change_source_compartment(source_id, change_source_compartment_details, opts = {}) click to toggle source

Moves the specified source into a different compartment within the same tenancy. For information about moving resources between compartments, see [Moving Resources to a Different Compartment](docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).

@param [String] source_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the source. @param [OCI::ApplicationMigration::Models::ChangeCompartmentDetails] change_source_compartment_details The updated compartment details @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :if_match For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match`

parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource
will be updated or deleted only if the etag you provide matches the resource's current etag value.

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or

server error without risk of retrying the same action. Retry tokens expire after
24 hours, but can be invalidated before then due to conflicting operations. For example,
if a resource has been deleted and purged from the system, then a retry of the original
creation request may be rejected.

@return [Response] A Response object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/change_source_compartment.rb.html) to see an example of how to use change_source_compartment API.

# File lib/oci/application_migration/application_migration_client.rb, line 263
def change_source_compartment(source_id, change_source_compartment_details, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#change_source_compartment.' if logger

  raise "Missing the required parameter 'source_id' when calling change_source_compartment." if source_id.nil?
  raise "Missing the required parameter 'change_source_compartment_details' when calling change_source_compartment." if change_source_compartment_details.nil?
  raise "Parameter value for 'source_id' must not be blank" if OCI::Internal::Util.blank_string?(source_id)

  path = '/sources/{sourceId}/actions/changeCompartment'.sub('{sourceId}', source_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(change_source_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#change_source_compartment') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end
create_migration(create_migration_details, opts = {}) click to toggle source

Creates a migration. A migration represents the end-to-end workflow of moving an application from a source environment to Oracle Cloud Infrastructure. Each migration moves a single application to Oracle Cloud Infrastructure. For more information, see [Manage Migrations](docs.cloud.oracle.com/iaas/application-migration/manage_migrations.htm).

When you create a migration, provide the required information to let Application Migration access the source environment. Application Migration uses this information to access the application in the source environment and discover application artifacts.

All Oracle Cloud Infrastructure resources, including migrations, get an Oracle-assigned, unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response. You can also retrieve a resource's OCID by using a List API operation on that resource type, or by viewing the resource in the Console. For more information, see Resource Identifiers.

After you send your request, a migration is created in the compartment that contains the source. The new migration's lifecycle state will temporarily be CREATING and the state of the migration will be DISCOVERING_APPLICATION. During this phase, Application Migration sets the template for the serviceConfig and applicationConfig fields of the migration. When this operation is complete, the state of the migration changes to MISSING_CONFIG_VALUES. Next, you'll need to update the migration to provide configuration values. Before updating the migration, ensure that its state has changed to MISSING_CONFIG_VALUES.

To track the progress of this operation, you can monitor the status of the Create Migration and Discover Application work requests by using the {#get_work_request get_work_request} REST API operation on the work request or by viewing the status of the work request in the console.

@param [OCI::ApplicationMigration::Models::CreateMigrationDetails] create_migration_details The properties for creating a migration. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or

server error without risk of retrying the same action. Retry tokens expire after
24 hours, but can be invalidated before then due to conflicting operations. For example,
if a resource has been deleted and purged from the system, then a retry of the original
creation request may be rejected.

@return [Response] A Response object with data of type {OCI::ApplicationMigration::Models::Migration Migration} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/create_migration.rb.html) to see an example of how to use create_migration API.

# File lib/oci/application_migration/application_migration_client.rb, line 349
def create_migration(create_migration_details, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#create_migration.' if logger

  raise "Missing the required parameter 'create_migration_details' when calling create_migration." if create_migration_details.nil?

  path = '/migrations'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_migration_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#create_migration') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::ApplicationMigration::Models::Migration'
    )
  end
  # rubocop:enable Metrics/BlockLength
end
create_source(create_source_details, opts = {}) click to toggle source

Creates a source in the specified compartment. In Application Migration, a source refers to the environment from which the application is being migrated. For more information, see [Manage Sources](docs.cloud.oracle.com/iaas/application-migration/manage_sources.htm).

All Oracle Cloud Infrastructure resources, including sources, get an Oracle-assigned, unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response. You can also retrieve a resource's OCID by using a List API operation on that resource type, or by viewing the resource in the Console.

After you send your request, a source is created in the specified compartment. The new source's lifecycle state will temporarily be CREATING. Application Migration connects to the source environment with the authentication credentials that you have provided. If the connection is established, the status of the source changes to ACTIVE and Application Migration fetches the list of applications that are available for migration in the source environment.

To track the progress of the operation, you can monitor the status of the Create Source work request by using the {#get_work_request get_work_request} REST API operation on the work request or by viewing the status of the work request in the console.

Ensure that the state of the source has changed to ACTIVE, before you retrieve the list of applications from the source environment using the {#list_source_applications list_source_applications} REST API call.

@param [OCI::ApplicationMigration::Models::CreateSourceDetails] create_source_details The properties for creating a source. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or

server error without risk of retrying the same action. Retry tokens expire after
24 hours, but can be invalidated before then due to conflicting operations. For example,
if a resource has been deleted and purged from the system, then a retry of the original
creation request may be rejected.

@return [Response] A Response object with data of type {OCI::ApplicationMigration::Models::Source Source} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/create_source.rb.html) to see an example of how to use create_source API.

# File lib/oci/application_migration/application_migration_client.rb, line 429
def create_source(create_source_details, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#create_source.' if logger

  raise "Missing the required parameter 'create_source_details' when calling create_source." if create_source_details.nil?

  path = '/sources'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_source_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#create_source') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::ApplicationMigration::Models::Source'
    )
  end
  # rubocop:enable Metrics/BlockLength
end
delete_migration(migration_id, opts = {}) click to toggle source

Deletes the specified migration.

If you have migrated the application or for any other reason if you no longer require a migration, then you can delete the relevant migration. You can delete a migration, irrespective of its state. If any work request is being processed for the migration that you want to delete, then the associated work requests are cancelled and then the migration is deleted.

@param [String] migration_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the migration. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@option opts [String] :if_match For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match`

parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource
will be updated or deleted only if the etag you provide matches the resource's current etag value.

@return [Response] A Response object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/delete_migration.rb.html) to see an example of how to use delete_migration API.

# File lib/oci/application_migration/application_migration_client.rb, line 495
def delete_migration(migration_id, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#delete_migration.' if logger

  raise "Missing the required parameter 'migration_id' when calling delete_migration." if migration_id.nil?
  raise "Parameter value for 'migration_id' must not be blank" if OCI::Internal::Util.blank_string?(migration_id)

  path = '/migrations/{migrationId}'.sub('{migrationId}', migration_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#delete_migration') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end
delete_source(source_id, opts = {}) click to toggle source

Deletes the specified source.

Before deleting a source, you must delete all the migrations associated with the source. If you have migrated all the required applications in a source or for any other reason you no longer require a source, then you can delete the relevant source.

@param [String] source_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the source. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@option opts [String] :if_match For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match`

parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource
will be updated or deleted only if the etag you provide matches the resource's current etag value.

@return [Response] A Response object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/delete_source.rb.html) to see an example of how to use delete_source API.

# File lib/oci/application_migration/application_migration_client.rb, line 560
def delete_source(source_id, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#delete_source.' if logger

  raise "Missing the required parameter 'source_id' when calling delete_source." if source_id.nil?
  raise "Parameter value for 'source_id' must not be blank" if OCI::Internal::Util.blank_string?(source_id)

  path = '/sources/{sourceId}'.sub('{sourceId}', source_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#delete_source') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end
get_migration(migration_id, opts = {}) click to toggle source

Retrieves details of the specified migration. @param [String] migration_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the migration. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@return [Response] A Response object with data of type {OCI::ApplicationMigration::Models::Migration Migration} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/get_migration.rb.html) to see an example of how to use get_migration API.

# File lib/oci/application_migration/application_migration_client.rb, line 616
def get_migration(migration_id, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#get_migration.' if logger

  raise "Missing the required parameter 'migration_id' when calling get_migration." if migration_id.nil?
  raise "Parameter value for 'migration_id' must not be blank" if OCI::Internal::Util.blank_string?(migration_id)

  path = '/migrations/{migrationId}'.sub('{migrationId}', migration_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#get_migration') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::ApplicationMigration::Models::Migration'
    )
  end
  # rubocop:enable Metrics/BlockLength
end
get_source(source_id, opts = {}) click to toggle source

Retrieves details of the specified source. Specify the OCID of the source for which you want to retrieve details.

@param [String] source_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the source. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@return [Response] A Response object with data of type {OCI::ApplicationMigration::Models::Source Source} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/get_source.rb.html) to see an example of how to use get_source API.

# File lib/oci/application_migration/application_migration_client.rb, line 673
def get_source(source_id, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#get_source.' if logger

  raise "Missing the required parameter 'source_id' when calling get_source." if source_id.nil?
  raise "Parameter value for 'source_id' must not be blank" if OCI::Internal::Util.blank_string?(source_id)

  path = '/sources/{sourceId}'.sub('{sourceId}', source_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#get_source') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::ApplicationMigration::Models::Source'
    )
  end
  # rubocop:enable Metrics/BlockLength
end
get_work_request(work_request_id, opts = {}) click to toggle source

Gets the details of the specified work request. @param [String] work_request_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the work request. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@return [Response] A Response object with data of type {OCI::ApplicationMigration::Models::WorkRequest WorkRequest} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/get_work_request.rb.html) to see an example of how to use get_work_request API.

# File lib/oci/application_migration/application_migration_client.rb, line 729
def get_work_request(work_request_id, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#get_work_request.' if logger

  raise "Missing the required parameter 'work_request_id' when calling get_work_request." if work_request_id.nil?
  raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id)

  path = '/workRequests/{workRequestId}'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#get_work_request') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::ApplicationMigration::Models::WorkRequest'
    )
  end
  # rubocop:enable Metrics/BlockLength
end
list_migrations(compartment_id, opts = {}) click to toggle source

Retrieves details of all the migrations that are available in the specified compartment.

@param [String] compartment_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a compartment. Retrieves details of objects in the specified compartment. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@option opts [String] :id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) on which to query for a migration.

@option opts [Integer] :limit The number of items returned in a paginated `List` call. For information about pagination, see

[List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).

@option opts [String] :page The value of the `opc-next-page` response header from the preceding `List` call.

For information about pagination, see [List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).

@option opts [String] :sort_order The sort order, either `ASC` (ascending) or `DESC` (descending).

(default to ASC)

@option opts [String] :sort_by Specifies the field on which to sort.

By default, `TIMECREATED` is ordered descending.
By default, `DISPLAYNAME` is ordered ascending. Note that you can sort only on one field.
 (default to DISPLAYNAME)
Allowed values are: TIMECREATED, DISPLAYNAME

@option opts [String] :display_name Display name on which to query. @option opts [String] :lifecycle_state This field is not supported. Do not use. @return [Response] A Response object with data of type Array<{OCI::ApplicationMigration::Models::MigrationSummary MigrationSummary}> @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/list_migrations.rb.html) to see an example of how to use list_migrations API.

# File lib/oci/application_migration/application_migration_client.rb, line 803
def list_migrations(compartment_id, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#list_migrations.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_migrations." if compartment_id.nil?

  if opts[:sort_order] && !OCI::ApplicationMigration::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::ApplicationMigration::Models::SORT_ORDERS_ENUM.'
  end

  if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.'
  end

  if opts[:lifecycle_state] && !OCI::ApplicationMigration::Models::MIGRATION_LIFECYCLE_STATES_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::ApplicationMigration::Models::MIGRATION_LIFECYCLE_STATES_ENUM.'
  end

  path = '/migrations'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:id] = opts[:id] if opts[:id]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#list_migrations') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::ApplicationMigration::Models::MigrationSummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end
list_source_applications(source_id, compartment_id, opts = {}) click to toggle source

Retrieves details of all the applications associated with the specified source. This list is generated dynamically by interrogating the source and the list changes as applications are started or stopped in the source environment.

@param [String] source_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the source. @param [String] compartment_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a compartment. Retrieves details of objects in the specified compartment. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@option opts [Integer] :limit The number of items returned in a paginated `List` call. For information about pagination, see

[List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).

@option opts [String] :page The value of the `opc-next-page` response header from the preceding `List` call.

For information about pagination, see [List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).

@option opts [String] :sort_order The sort order, either `ASC` (ascending) or `DESC` (descending).

(default to ASC)

@option opts [String] :sort_by Specifies the field on which to sort.

By default, `TIMECREATED` is ordered descending.
By default, `DISPLAYNAME` is ordered ascending. Note that you can sort only on one field.
 (default to DISPLAYNAME)
Allowed values are: TIMECREATED, DISPLAYNAME

@option opts [String] :display_name Resource name on which to query. @return [Response] A Response object with data of type Array<{OCI::ApplicationMigration::Models::SourceApplicationSummary SourceApplicationSummary}> @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/list_source_applications.rb.html) to see an example of how to use list_source_applications API.

# File lib/oci/application_migration/application_migration_client.rb, line 896
def list_source_applications(source_id, compartment_id, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#list_source_applications.' if logger

  raise "Missing the required parameter 'source_id' when calling list_source_applications." if source_id.nil?
  raise "Missing the required parameter 'compartment_id' when calling list_source_applications." if compartment_id.nil?

  if opts[:sort_order] && !OCI::ApplicationMigration::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::ApplicationMigration::Models::SORT_ORDERS_ENUM.'
  end

  if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.'
  end
  raise "Parameter value for 'source_id' must not be blank" if OCI::Internal::Util.blank_string?(source_id)

  path = '/sources/{sourceId}/applications'.sub('{sourceId}', source_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#list_source_applications') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::ApplicationMigration::Models::SourceApplicationSummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end
list_sources(compartment_id, opts = {}) click to toggle source

Retrieves details of all the sources that are available in the specified compartment and match the specified query criteria. If you don't specify any query criteria, then details of all the sources are displayed. To filter the retrieved results, you can pass one or more of the following query parameters, by appending them to the URI as shown in the following example.

@param [String] compartment_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a compartment. Retrieves details of objects in the specified compartment. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@option opts [String] :id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) on which to query for a source.

@option opts [Integer] :limit The number of items returned in a paginated `List` call. For information about pagination, see

[List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).

@option opts [String] :page The value of the `opc-next-page` response header from the preceding `List` call.

For information about pagination, see [List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).

@option opts [String] :sort_order The sort order, either `ASC` (ascending) or `DESC` (descending).

(default to ASC)

@option opts [String] :sort_by Specifies the field on which to sort.

By default, `TIMECREATED` is ordered descending.
By default, `DISPLAYNAME` is ordered ascending. Note that you can sort only on one field.
 (default to DISPLAYNAME)
Allowed values are: TIMECREATED, DISPLAYNAME

@option opts [String] :display_name Display name on which to query. @option opts [String] :lifecycle_state Retrieves details of sources in the specified lifecycle state. @return [Response] A Response object with data of type Array<{OCI::ApplicationMigration::Models::SourceSummary SourceSummary}> @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/list_sources.rb.html) to see an example of how to use list_sources API.

# File lib/oci/application_migration/application_migration_client.rb, line 988
def list_sources(compartment_id, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#list_sources.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_sources." if compartment_id.nil?

  if opts[:sort_order] && !OCI::ApplicationMigration::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::ApplicationMigration::Models::SORT_ORDERS_ENUM.'
  end

  if opts[:sort_by] && !%w[TIMECREATED DISPLAYNAME].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.'
  end

  if opts[:lifecycle_state] && !OCI::ApplicationMigration::Models::SOURCE_LIFECYCLE_STATES_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::ApplicationMigration::Models::SOURCE_LIFECYCLE_STATES_ENUM.'
  end

  path = '/sources'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:id] = opts[:id] if opts[:id]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#list_sources') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::ApplicationMigration::Models::SourceSummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end
list_work_request_errors(work_request_id, opts = {}) click to toggle source

Retrieves details of the errors encountered while executing an operation that is tracked by the specified work request.

@param [String] work_request_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the work request. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [Integer] :limit The number of items returned in a paginated `List` call. For information about pagination, see

[List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).

@option opts [String] :page The value of the `opc-next-page` response header from the preceding `List` call.

For information about pagination, see [List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).

@option opts [String] :sort_order The sort order, either `ASC` (ascending) or `DESC` (descending).

(default to ASC)

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@return [Response] A Response object with data of type Array<{OCI::ApplicationMigration::Models::WorkRequestError WorkRequestError}> @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/list_work_request_errors.rb.html) to see an example of how to use list_work_request_errors API.

# File lib/oci/application_migration/application_migration_client.rb, line 1072
def list_work_request_errors(work_request_id, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#list_work_request_errors.' if logger

  raise "Missing the required parameter 'work_request_id' when calling list_work_request_errors." if work_request_id.nil?

  if opts[:sort_order] && !OCI::ApplicationMigration::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::ApplicationMigration::Models::SORT_ORDERS_ENUM.'
  end
  raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id)

  path = '/workRequests/{workRequestId}/errors'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#list_work_request_errors') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::ApplicationMigration::Models::WorkRequestError>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end
list_work_request_logs(work_request_id, opts = {}) click to toggle source

Retrieves logs for the specified work request.

@param [String] work_request_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the work request. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [Integer] :limit The number of items returned in a paginated `List` call. For information about pagination, see

[List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).

@option opts [String] :page The value of the `opc-next-page` response header from the preceding `List` call.

For information about pagination, see [List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).

@option opts [String] :sort_order The sort order, either `ASC` (ascending) or `DESC` (descending).

(default to ASC)

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@return [Response] A Response object with data of type Array<{OCI::ApplicationMigration::Models::WorkRequestLogEntry WorkRequestLogEntry}> @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/list_work_request_logs.rb.html) to see an example of how to use list_work_request_logs API.

# File lib/oci/application_migration/application_migration_client.rb, line 1144
def list_work_request_logs(work_request_id, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#list_work_request_logs.' if logger

  raise "Missing the required parameter 'work_request_id' when calling list_work_request_logs." if work_request_id.nil?

  if opts[:sort_order] && !OCI::ApplicationMigration::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::ApplicationMigration::Models::SORT_ORDERS_ENUM.'
  end
  raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id)

  path = '/workRequests/{workRequestId}/logs'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#list_work_request_logs') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::ApplicationMigration::Models::WorkRequestLogEntry>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end
list_work_requests(compartment_id, opts = {}) click to toggle source

Retrieves details of all the work requests and match the specified query criteria. To filter the retrieved results, you can pass one or more of the following query parameters, by appending them to the URI as shown in the following example.

@param [String] compartment_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a compartment. Retrieves details of objects in the specified compartment. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :resource_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for a resource. Retrieves details of the specified resource. @option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@option opts [Integer] :limit The number of items returned in a paginated `List` call. For information about pagination, see

[List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).

@option opts [String] :page The value of the `opc-next-page` response header from the preceding `List` call.

For information about pagination, see [List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).

@return [Response] A Response object with data of type Array<{OCI::ApplicationMigration::Models::WorkRequestSummary WorkRequestSummary}> @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/list_work_requests.rb.html) to see an example of how to use list_work_requests API.

# File lib/oci/application_migration/application_migration_client.rb, line 1215
def list_work_requests(compartment_id, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#list_work_requests.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_work_requests." if compartment_id.nil?

  path = '/workRequests'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:resourceId] = opts[:resource_id] if opts[:resource_id]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#list_work_requests') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::ApplicationMigration::Models::WorkRequestSummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end
logger() click to toggle source

@return [Logger] The logger for this client. May be nil.

# File lib/oci/application_migration/application_migration_client.rb, line 95
def logger
  @api_client.config.logger
end
migrate_application(migration_id, opts = {}) click to toggle source

Starts migrating the specified application to Oracle Cloud Infrastructure.

Before sending this request, ensure that you have provided configuration details to update the migration and the state of the migration is READY.

After you send this request, the migration's state will temporarily be MIGRATING.

To track the progress of the operation, you can monitor the status of the Migrate Application work request by using the {#get_work_request get_work_request} REST API operation on the work request or by viewing the status of the work request in the console. When this work request is processed successfully, Application Migration creates the required resources in the target environment and the state of the migration changes to MIGRATION_SUCCEEDED.

@param [String] migration_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the migration. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@option opts [String] :if_match For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match`

parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource
will be updated or deleted only if the etag you provide matches the resource's current etag value.

@option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or

server error without risk of retrying the same action. Retry tokens expire after
24 hours, but can be invalidated before then due to conflicting operations. For example,
if a resource has been deleted and purged from the system, then a retry of the original
creation request may be rejected.

@return [Response] A Response object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/migrate_application.rb.html) to see an example of how to use migrate_application API.

# File lib/oci/application_migration/application_migration_client.rb, line 1295
def migrate_application(migration_id, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#migrate_application.' if logger

  raise "Missing the required parameter 'migration_id' when calling migrate_application." if migration_id.nil?
  raise "Parameter value for 'migration_id' must not be blank" if OCI::Internal::Util.blank_string?(migration_id)

  path = '/migrations/{migrationId}/actions/migrate'.sub('{migrationId}', migration_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#migrate_application') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end
region=(new_region) click to toggle source

Set the region that will be used to determine the service endpoint. This will usually correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.

# File lib/oci/application_migration/application_migration_client.rb, line 85
def region=(new_region)
  @region = new_region

  raise 'A region must be specified.' unless @region

  @endpoint = OCI::Regions.get_service_endpoint_for_template(@region, 'https://applicationmigration.{region}.oci.{secondLevelDomain}') + '/20191031'
  logger.info "ApplicationMigrationClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
end
update_migration(migration_id, update_migration_details, opts = {}) click to toggle source

Updates the configuration details for the specified migration.

When you create a migration, Application Migration sets the template for the serviceConfig and applicationConfig attributes of the migration. When you update the migration, you must provide values for these fields to specify configuration information for the application in the target environment.

Before updating the migration, complete the following tasks: <ol> <li>Identify the migration that you want to update and ensure that the migration is in the MISSING_CONFIG_VALUES state.</li> <li>Get details of the migration using the GetMigration command. This returns the template for the serviceConfig and applicationConfig attributes of the migration.</li> <li>You must fill out the required details for the serviceConfig and applicationConfig attributes. The isRequired attribute of a configuration property indicates whether it is mandatory to provide a value.</li> <li>You can provide values for the optional configuration properties or you can delete the optional properties for which you do not provide values. Note that you cannot add any property that is not present in the template.</li> </ol>

To update the migration, pass the configuration values in the request body. The information that you must provide depends on the type of application that you are migrating. For reference information about configuration fields, see [Provide Configuration Information](docs.cloud.oracle.com/iaas/application-migration/manage_migrations.htm#provide_configuration_details).

To track the progress of the operation, you can monitor the status of the Update Migration work request by using the {#get_work_request get_work_request} REST API operation on the work request or by viewing the status of the work request in the console.

When the migration has been updated, the state of the migration changes to READY. After updating the migration, you can start the migration whenever you are ready.

@param [String] migration_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the migration. @param [OCI::ApplicationMigration::Models::UpdateMigrationDetails] update_migration_details Updated configuration for the migration.

@param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or

server error without risk of retrying the same action. Retry tokens expire after
24 hours, but can be invalidated before then due to conflicting operations. For example,
if a resource has been deleted and purged from the system, then a retry of the original
creation request may be rejected.

@option opts [String] :if_match For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match`

parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource
will be updated or deleted only if the etag you provide matches the resource's current etag value.

@return [Response] A Response object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/update_migration.rb.html) to see an example of how to use update_migration API.

# File lib/oci/application_migration/application_migration_client.rb, line 1394
def update_migration(migration_id, update_migration_details, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#update_migration.' if logger

  raise "Missing the required parameter 'migration_id' when calling update_migration." if migration_id.nil?
  raise "Missing the required parameter 'update_migration_details' when calling update_migration." if update_migration_details.nil?
  raise "Parameter value for 'migration_id' must not be blank" if OCI::Internal::Util.blank_string?(migration_id)

  path = '/migrations/{migrationId}'.sub('{migrationId}', migration_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(update_migration_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#update_migration') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end
update_source(source_id, update_source_details, opts = {}) click to toggle source

You can update the authorization details to access the source environment from which you want to migrate applications to Oracle Cloud Infrastructure. You can also update the description and tags of a source.

Warning: Oracle recommends that you avoid using any confidential information when you supply string values using the API.

@param [String] source_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the source. @param [OCI::ApplicationMigration::Models::UpdateSourceDetails] update_source_details Updated configuration for the source.

@param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level

retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry

@option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a

particular request, please provide the request ID.

@option opts [String] :if_match For optimistic concurrency control. In the `PUT` or `DELETE` call for a resource, set the `if-match`

parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource
will be updated or deleted only if the etag you provide matches the resource's current etag value.

@return [Response] A Response object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/applicationmigration/update_source.rb.html) to see an example of how to use update_source API.

# File lib/oci/application_migration/application_migration_client.rb, line 1463
def update_source(source_id, update_source_details, opts = {})
  logger.debug 'Calling operation ApplicationMigrationClient#update_source.' if logger

  raise "Missing the required parameter 'source_id' when calling update_source." if source_id.nil?
  raise "Missing the required parameter 'update_source_details' when calling update_source." if update_source_details.nil?
  raise "Parameter value for 'source_id' must not be blank" if OCI::Internal::Util.blank_string?(source_id)

  path = '/sources/{sourceId}'.sub('{sourceId}', source_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_source_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'ApplicationMigrationClient#update_source') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

Private Instance Methods

applicable_retry_config(opts = {}) click to toggle source

rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists rubocop:enable Metrics/MethodLength, Layout/EmptyLines

# File lib/oci/application_migration/application_migration_client.rb, line 1507
def applicable_retry_config(opts = {})
  return @retry_config unless opts.key?(:retry_config)

  opts[:retry_config]
end