# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).

import oci

# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()


# Initialize service client with default config file
database_migration_client = oci.database_migration.DatabaseMigrationClient(
    config)


# Send the request to service, some parameters are not required, see API
# doc for more info
create_migration_response = database_migration_client.create_migration(
    create_migration_details=oci.database_migration.models.CreateMigrationDetails(
        type="ONLINE",
        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
        source_database_connection_id="ocid1.test.oc1..<unique_ID>EXAMPLE-sourceDatabaseConnectionId-Value",
        target_database_connection_id="ocid1.test.oc1..<unique_ID>EXAMPLE-targetDatabaseConnectionId-Value",
        display_name="EXAMPLE-displayName-Value",
        agent_id="ocid1.test.oc1..<unique_ID>EXAMPLE-agentId-Value",
        source_container_database_connection_id="ocid1.test.oc1..<unique_ID>EXAMPLE-sourceContainerDatabaseConnectionId-Value",
        data_transfer_medium_details=oci.database_migration.models.CreateDataTransferMediumDetails(
            database_link_details=oci.database_migration.models.CreateDatabaseLinkDetails(
                name="EXAMPLE-name-Value",
                wallet_bucket=oci.database_migration.models.CreateObjectStoreBucket(
                    namespace_name="EXAMPLE-namespaceName-Value",
                    bucket_name="EXAMPLE-bucketName-Value")),
            object_storage_details=oci.database_migration.models.CreateObjectStoreBucket(
                namespace_name="EXAMPLE-namespaceName-Value",
                bucket_name="EXAMPLE-bucketName-Value"),
            aws_s3_details=oci.database_migration.models.CreateAwsS3Details(
                name="EXAMPLE-name-Value",
                region="EXAMPLE-region-Value",
                access_key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-accessKeyId-Value",
                secret_access_key="EXAMPLE-secretAccessKey-Value")),
        dump_transfer_details=oci.database_migration.models.CreateDumpTransferDetails(
            source=oci.database_migration.models.CreateCurlTransferDetails(
                kind="CURL"),
            target=oci.database_migration.models.CreateCurlTransferDetails(
                kind="CURL")),
        datapump_settings=oci.database_migration.models.CreateDataPumpSettings(
            job_mode="FULL",
            data_pump_parameters=oci.database_migration.models.CreateDataPumpParameters(
                is_cluster=True,
                estimate="STATISTICS",
                table_exists_action="TRUNCATE",
                exclude_parameters=[
                    "INDEX",
                    "MATERIALIZED_VIEW",
                    "MATERIALIZED_VIEW_LOG"],
                import_parallelism_degree=692,
                export_parallelism_degree=19),
            metadata_remaps=[
                oci.database_migration.models.MetadataRemap(
                    type="DATAFILE",
                    old_value="EXAMPLE-oldValue-Value",
                    new_value="EXAMPLE-newValue-Value")],
            tablespace_details=oci.database_migration.models.CreateNonADBRemapTablespaceDetails(
                target_type="NON_ADB_REMAP",
                remap_target="EXAMPLE-remapTarget-Value"),
            export_directory_object=oci.database_migration.models.CreateDirectoryObject(
                name="EXAMPLE-name-Value",
                path="EXAMPLE-path-Value"),
            import_directory_object=oci.database_migration.models.CreateDirectoryObject(
                name="EXAMPLE-name-Value",
                path="EXAMPLE-path-Value")),
        advisor_settings=oci.database_migration.models.CreateAdvisorSettings(
            is_skip_advisor=False,
            is_ignore_errors=False),
        exclude_objects=[
            oci.database_migration.models.DatabaseObject(
                owner="EXAMPLE-owner-Value",
                object_name="EXAMPLE-objectName-Value",
                type="EXAMPLE-type-Value")],
        include_objects=[
            oci.database_migration.models.DatabaseObject(
                owner="EXAMPLE-owner-Value",
                object_name="EXAMPLE-objectName-Value",
                type="EXAMPLE-type-Value")],
        golden_gate_details=oci.database_migration.models.CreateGoldenGateDetails(
            hub=oci.database_migration.models.CreateGoldenGateHub(
                rest_admin_credentials=oci.database_migration.models.CreateAdminCredentials(
                    username="EXAMPLE-username-Value",
                    password="EXAMPLE-password-Value"),
                url="EXAMPLE-url-Value",
                source_microservices_deployment_name="EXAMPLE-sourceMicroservicesDeploymentName-Value",
                target_microservices_deployment_name="EXAMPLE-targetMicroservicesDeploymentName-Value",
                compute_id="ocid1.test.oc1..<unique_ID>EXAMPLE-computeId-Value"),
            settings=oci.database_migration.models.CreateGoldenGateSettings(
                extract=oci.database_migration.models.CreateExtract(
                    performance_profile="MEDIUM",
                    long_trans_duration=591),
                replicat=oci.database_migration.models.CreateReplicat(
                    map_parallelism=44,
                    min_apply_parallelism=669,
                    max_apply_parallelism=381),
                acceptable_lag=10)),
        vault_details=oci.database_migration.models.CreateVaultDetails(
            compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
            vault_id="ocid1.test.oc1..<unique_ID>EXAMPLE-vaultId-Value",
            key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-keyId-Value"),
        freeform_tags={
            'EXAMPLE_KEY_W3b07': 'EXAMPLE_VALUE_MkyJJb7XNXE9U0fNyLsz'},
        defined_tags={
            'EXAMPLE_KEY_H4OPd': {
                'EXAMPLE_KEY_iTjW1': 'EXAMPLE--Value'}}),
    opc_retry_token="EXAMPLE-opcRetryToken-Value",
    opc_request_id="5DJSSTRXOAUXCVFZSDK2<unique_ID>")

# Get the data from response
print(create_migration_response.data)