# 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
mysql_client = oci.mysql.DbSystemClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
create_db_system_response = mysql_client.create_db_system(
    create_db_system_details=oci.mysql.models.CreateDbSystemDetails(
        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
        shape_name="EXAMPLE-shapeName-Value",
        subnet_id="ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
        display_name="EXAMPLE-displayName-Value",
        description="EXAMPLE-description-Value",
        rest=oci.mysql.models.CreateRestDetails(
            configuration="DBSYSTEM_ONLY",
            port=4439),
        is_highly_available=True,
        availability_domain="EXAMPLE-availabilityDomain-Value",
        fault_domain="EXAMPLE-faultDomain-Value",
        configuration_id="ocid1.test.oc1..<unique_ID>EXAMPLE-configurationId-Value",
        mysql_version="EXAMPLE-mysqlVersion-Value",
        nsg_ids=["EXAMPLE--Value"],
        admin_username="EXAMPLE-adminUsername-Value",
        admin_password="EXAMPLE-adminPassword-Value",
        data_storage_size_in_gbs=31908,
        data_storage=oci.mysql.models.DataStorageDetails(
            is_auto_expand_storage_enabled=False,
            max_storage_size_in_gbs=17535),
        hostname_label="EXAMPLE-hostnameLabel-Value",
        ip_address="EXAMPLE-ipAddress-Value",
        port=64768,
        port_x=38864,
        backup_policy=oci.mysql.models.CreateBackupPolicyDetails(
            is_enabled=False,
            soft_delete="ENABLED",
            copy_policies=[
                        oci.mysql.models.CopyPolicy(
                            copy_to_region="EXAMPLE-copyToRegion-Value",
                            backup_copy_retention_in_days=14)],
            window_start_time="EXAMPLE-windowStartTime-Value",
            retention_in_days=9,
            freeform_tags={
                        'EXAMPLE_KEY_mILqM': 'EXAMPLE_VALUE_Ymhf1274qR4sJZxG2Qca'},
            defined_tags={
                'EXAMPLE_KEY_EQGoF': {
                    'EXAMPLE_KEY_RnaMR': 'EXAMPLE--Value'}},
            pitr_policy=oci.mysql.models.PitrPolicy(
                is_enabled=False)),
        source=oci.mysql.models.CreateDbSystemSourceImportFromUrlDetails(
            source_type="IMPORTURL",
            source_url="EXAMPLE-sourceUrl-Value"),
        maintenance=oci.mysql.models.CreateMaintenanceDetails(
            window_start_time="EXAMPLE-windowStartTime-Value"),
        freeform_tags={
            'EXAMPLE_KEY_MoMvi': 'EXAMPLE_VALUE_gpWRh63r6WYHoqE4I0sA'},
        defined_tags={
            'EXAMPLE_KEY_4Mho0': {
                'EXAMPLE_KEY_tRpBK': 'EXAMPLE--Value'}},
        deletion_policy=oci.mysql.models.CreateDeletionPolicyDetails(
            automatic_backup_retention="DELETE",
            final_backup="SKIP_FINAL_BACKUP",
            is_delete_protected=True),
        crash_recovery="ENABLED",
        database_management="DISABLED",
        secure_connections=oci.mysql.models.SecureConnectionDetails(
            certificate_generation_type="SYSTEM",
            certificate_id="ocid1.test.oc1..<unique_ID>EXAMPLE-certificateId-Value"),
        database_mode="READ_WRITE",
        access_mode="RESTRICTED",
        customer_contacts=[
            oci.mysql.models.CustomerContact(
                email="EXAMPLE-email-Value")],
        read_endpoint=oci.mysql.models.CreateReadEndpointDetails(
            is_enabled=False,
            read_endpoint_ip_address="EXAMPLE-readEndpointIpAddress-Value",
            read_endpoint_hostname_label="EXAMPLE-readEndpointHostnameLabel-Value",
            exclude_ips=["EXAMPLE--Value"])),
    opc_request_id="RKOFWWZ6QRC9L7PIAIUS<unique_ID>",
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

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