# 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_v2=oci.database_migration.models.AwsS3DataTransferMediumDetails(
            type="AWS_S3",
            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",
            object_storage_bucket=oci.database_migration.models.ObjectStoreBucket(
                namespace_name="EXAMPLE-namespaceName-Value",
                bucket_name="EXAMPLE-bucketName-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",
                wallet_location="EXAMPLE-walletLocation-Value"),
            target=oci.database_migration.models.CreateOciCliDumpTransferDetails(
                kind="OCI_CLI",
                oci_home="EXAMPLE-ociHome-Value",
                wallet_location="EXAMPLE-walletLocation-Value"),
            shared_storage_mount_target_id="ocid1.test.oc1..<unique_ID>EXAMPLE-sharedStorageMountTargetId-Value"),
        datapump_settings=oci.database_migration.models.CreateDataPumpSettings(
            job_mode="SCHEMA",
            data_pump_parameters=oci.database_migration.models.CreateDataPumpParameters(
                is_cluster=False,
                estimate="STATISTICS",
                table_exists_action="TRUNCATE",
                exclude_parameters=[
                    "INDEX",
                    "MATERIALIZED_VIEW",
                    "MATERIALIZED_VIEW_LOG"],
                import_parallelism_degree=151,
                export_parallelism_degree=6),
            metadata_remaps=[
                oci.database_migration.models.MetadataRemap(
                    type="TABLESPACE",
                    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",
                is_omit_excluded_table_from_replication=True)],
        include_objects=[
            oci.database_migration.models.DatabaseObject(
                owner="EXAMPLE-owner-Value",
                object_name="EXAMPLE-objectName-Value",
                type="EXAMPLE-type-Value",
                is_omit_excluded_table_from_replication=True)],
        csv_text="EXAMPLE-csvText-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="HIGH",
                    long_trans_duration=539),
                replicat=oci.database_migration.models.CreateReplicat(
                    performance_profile="LOW",
                    map_parallelism=94,
                    min_apply_parallelism=598,
                    max_apply_parallelism=918),
                acceptable_lag=10)),
        golden_gate_service_details=oci.database_migration.models.CreateGoldenGateServiceDetails(
            source_db_credentials=oci.database_migration.models.DatabaseCredentials(
                username="EXAMPLE-username-Value",
                password="EXAMPLE-password-Value"),
            source_container_db_credentials=oci.database_migration.models.DatabaseCredentials(
                username="EXAMPLE-username-Value",
                password="EXAMPLE-password-Value"),
            target_db_credentials=oci.database_migration.models.DatabaseCredentials(
                username="EXAMPLE-username-Value",
                password="EXAMPLE-password-Value"),
            settings=oci.database_migration.models.CreateGoldenGateSettings(
                extract=oci.database_migration.models.CreateExtract(
                    performance_profile="LOW",
                    long_trans_duration=543),
                replicat=oci.database_migration.models.CreateReplicat(
                    performance_profile="HIGH",
                    map_parallelism=38,
                    min_apply_parallelism=2,
                    max_apply_parallelism=776),
                acceptable_lag=25)),
        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_O0E77': 'EXAMPLE_VALUE_Tdr6TsFqVL4dVEW5CDhr'},
        defined_tags={
            'EXAMPLE_KEY_UDtDy': {
                'EXAMPLE_KEY_I70UG': 'EXAMPLE--Value'}}),
    opc_retry_token="EXAMPLE-opcRetryToken-Value",
    opc_request_id="CKRNFDTU9QY3VVUXGMNO<unique_ID>")

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