# 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
update_migration_response = database_migration_client.update_migration(
    migration_id="ocid1.test.oc1..<unique_ID>EXAMPLE-migrationId-Value",
    update_migration_details=oci.database_migration.models.UpdateMigrationDetails(
        type="ONLINE",
        display_name="EXAMPLE-displayName-Value",
        agent_id="ocid1.test.oc1..<unique_ID>EXAMPLE-agentId-Value",
        source_database_connection_id="ocid1.test.oc1..<unique_ID>EXAMPLE-sourceDatabaseConnectionId-Value",
        source_container_database_connection_id="ocid1.test.oc1..<unique_ID>EXAMPLE-sourceContainerDatabaseConnectionId-Value",
        target_database_connection_id="ocid1.test.oc1..<unique_ID>EXAMPLE-targetDatabaseConnectionId-Value",
        data_transfer_medium_details_v2=oci.database_migration.models.DbLinkDataTransferMediumDetails(
            type="DBLINK",
            object_storage_bucket=oci.database_migration.models.ObjectStoreBucket(
                namespace_name="EXAMPLE-namespaceName-Value",
                bucket_name="EXAMPLE-bucketName-Value"),
            name="EXAMPLE-name-Value"),
        data_transfer_medium_details=oci.database_migration.models.UpdateDataTransferMediumDetails(
            database_link_details=oci.database_migration.models.UpdateDatabaseLinkDetails(
                name="EXAMPLE-name-Value",
                wallet_bucket=oci.database_migration.models.UpdateObjectStoreBucket(
                    namespace_name="EXAMPLE-namespaceName-Value",
                    bucket_name="EXAMPLE-bucketName-Value")),
            object_storage_details=oci.database_migration.models.UpdateObjectStoreBucket(
                namespace_name="EXAMPLE-namespaceName-Value",
                bucket_name="EXAMPLE-bucketName-Value"),
            aws_s3_details=oci.database_migration.models.UpdateAwsS3Details(
                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.UpdateDumpTransferDetails(
            source=oci.database_migration.models.UpdateCurlTransferDetails(
                kind="CURL",
                wallet_location="EXAMPLE-walletLocation-Value"),
            target=oci.database_migration.models.UpdateOciCliDumpTransferDetails(
                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.UpdateDataPumpSettings(
            job_mode="SCHEMA",
            data_pump_parameters=oci.database_migration.models.UpdateDataPumpParameters(
                is_cluster=False,
                estimate="STATISTICS",
                table_exists_action="REPLACE",
                exclude_parameters=[
                    "INDEX",
                    "MATERIALIZED_VIEW",
                    "MATERIALIZED_VIEW_LOG"],
                import_parallelism_degree=816,
                export_parallelism_degree=9),
            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.UpdateADBServerlesTablespaceDetails(
                target_type="ADB_S_REMAP"),
            export_directory_object=oci.database_migration.models.UpdateDirectoryObject(
                name="EXAMPLE-name-Value",
                path="EXAMPLE-path-Value"),
            import_directory_object=oci.database_migration.models.UpdateDirectoryObject(
                name="EXAMPLE-name-Value",
                path="EXAMPLE-path-Value")),
        advisor_settings=oci.database_migration.models.UpdateAdvisorSettings(
            is_skip_advisor=False,
            is_ignore_errors=True),
        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=False)],
        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=False)],
        golden_gate_service_details=oci.database_migration.models.UpdateGoldenGateServiceDetails(
            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.UpdateGoldenGateSettings(
                extract=oci.database_migration.models.UpdateExtract(
                    performance_profile="HIGH",
                    long_trans_duration=150),
                replicat=oci.database_migration.models.UpdateReplicat(
                    performance_profile="LOW",
                    map_parallelism=35,
                    min_apply_parallelism=320,
                    max_apply_parallelism=979),
                acceptable_lag=5)),
        golden_gate_details=oci.database_migration.models.UpdateGoldenGateDetails(
            hub=oci.database_migration.models.UpdateGoldenGateHub(
                rest_admin_credentials=oci.database_migration.models.UpdateAdminCredentials(
                    username="EXAMPLE-username-Value",
                    password="EXAMPLE-password-Value"),
                source_db_admin_credentials=oci.database_migration.models.UpdateAdminCredentials(
                    username="EXAMPLE-username-Value",
                    password="EXAMPLE-password-Value"),
                source_container_db_admin_credentials=oci.database_migration.models.UpdateAdminCredentials(
                    username="EXAMPLE-username-Value",
                    password="EXAMPLE-password-Value"),
                target_db_admin_credentials=oci.database_migration.models.UpdateAdminCredentials(
                    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.UpdateGoldenGateSettings(
                extract=oci.database_migration.models.UpdateExtract(
                    performance_profile="LOW",
                    long_trans_duration=477),
                replicat=oci.database_migration.models.UpdateReplicat(
                    performance_profile="LOW",
                    map_parallelism=43,
                    min_apply_parallelism=232,
                    max_apply_parallelism=156),
                acceptable_lag=13)),
        vault_details=oci.database_migration.models.UpdateVaultDetails(
            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_oOtcD': 'EXAMPLE_VALUE_nhIbkynMF8ZQH9hU2UW9'},
        defined_tags={
            'EXAMPLE_KEY_MvE83': {
                'EXAMPLE_KEY_tF0Jk': 'EXAMPLE--Value'}}),
    opc_request_id="67HNZHWVXSQZHNATMMZ1<unique_ID>",
    if_match="EXAMPLE-ifMatch-Value")

# Get the data from response
print(update_migration_response.headers)