# 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).

from datetime import datetime
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_client = oci.database.DatabaseClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
create_db_home_response = database_client.create_db_home(
    create_db_home_with_db_system_id_details=oci.database.models.CreateDbHomeWithDbSystemIdFromDatabaseDetails(
        source="DATABASE",
        db_system_id="ocid1.test.oc1..<unique_ID>EXAMPLE-dbSystemId-Value",
        database=oci.database.models.CreateDatabaseFromAnotherDatabaseDetails(
            database_id="ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value",
            admin_password="EXAMPLE-adminPassword-Value",
            backup_tde_password="EXAMPLE-backupTDEPassword-Value",
            db_unique_name="EXAMPLE-dbUniqueName-Value",
            db_name="EXAMPLE-dbName-Value",
            time_stamp_for_point_in_time_recovery=datetime.strptime(
                "2049-11-19T23:31:54.731Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            pluggable_databases=["EXAMPLE--Value"],
            freeform_tags={
                'EXAMPLE_KEY_xlf7c': 'EXAMPLE_VALUE_MlvGTCy44Z0MoBc08Wk1'},
            defined_tags={
                'EXAMPLE_KEY_GQu8E': {
                    'EXAMPLE_KEY_zWKWw': 'EXAMPLE--Value'}},
            sid_prefix="EXAMPLE-sidPrefix-Value",
            source_encryption_key_location_details=oci.database.models.GoogleCloudProviderEncryptionKeyDetails(
                provider_type="GCP",
                google_cloud_provider_encryption_key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-googleCloudProviderEncryptionKeyId-Value"),
            storage_size_details=oci.database.models.DatabaseStorageSizeDetails(
                data_storage_size_in_gbs=398,
                reco_storage_size_in_gbs=76),
            vm_cluster_id="ocid1.test.oc1..<unique_ID>EXAMPLE-vmClusterId-Value"),
        display_name="EXAMPLE-displayName-Value",
        kms_key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
        kms_key_version_id="ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value",
        database_software_image_id="ocid1.test.oc1..<unique_ID>EXAMPLE-databaseSoftwareImageId-Value",
        freeform_tags={
            'EXAMPLE_KEY_DFOjF': 'EXAMPLE_VALUE_84lRNGzkobgUgXGgHeQS'},
        defined_tags={
            'EXAMPLE_KEY_wVfxN': {
                'EXAMPLE_KEY_M6QHe': 'EXAMPLE--Value'}},
        is_desupported_version=True,
        is_unified_auditing_enabled=False),
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

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