# 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
update_autonomous_database_response = database_client.update_autonomous_database(
    autonomous_database_id="ocid1.test.oc1..<unique_ID>EXAMPLE-autonomousDatabaseId-Value",
    update_autonomous_database_details=oci.database.models.UpdateAutonomousDatabaseDetails(
        backup_retention_period_in_days=1093,
        compute_model="ECPU",
        in_memory_percentage=473,
        local_adg_auto_failover_max_data_loss_limit=1032,
        cpu_core_count=29,
        long_term_backup_schedule=oci.database.models.LongTermBackUpScheduleDetails(
            repeat_cadence="ONE_TIME",
            time_of_backup=datetime.strptime(
                "2012-05-12T10:35:09.205Z",
                "%Y-%m-%dT%H:%M:%S.%fZ"),
            retention_period_in_days=243,
            is_disabled=True),
        is_dev_tier=False,
        compute_count=292.4121,
        ocpu_count=9125.58,
        data_storage_size_in_tbs=62,
        data_storage_size_in_gbs=25121,
        display_name="EXAMPLE-displayName-Value",
        is_free_tier=True,
        availability_domain="EXAMPLE-availabilityDomain-Value",
        time_scheduled_ad_update=datetime.strptime(
            "2044-08-17T17:13:22.366Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        is_disable_ad_update_schedule=True,
        is_schedule_ad_update_to_earliest=False,
        admin_password="EXAMPLE-adminPassword-Value",
        db_name="EXAMPLE-dbName-Value",
        freeform_tags={
            'EXAMPLE_KEY_Nvxcr': 'EXAMPLE_VALUE_Dudl53rv06zFT2rxYWLp'},
        defined_tags={
            'EXAMPLE_KEY_CTpWJ': {
                'EXAMPLE_KEY_rVLBG': 'EXAMPLE--Value'}},
        security_attributes={
            'EXAMPLE_KEY_BIbbp': {
                'EXAMPLE_KEY_hAtP6': 'EXAMPLE--Value'}},
        db_workload="OLTP",
        license_model="LICENSE_INCLUDED",
        byol_compute_count_limit=2226.6328,
        is_access_control_enabled=True,
        whitelisted_ips=["EXAMPLE--Value"],
        are_primary_whitelisted_ips_used=True,
        standby_whitelisted_ips=["EXAMPLE--Value"],
        is_auto_scaling_enabled=True,
        is_refreshable_clone=False,
        refreshable_mode="MANUAL",
        is_local_data_guard_enabled=False,
        is_data_guard_enabled=False,
        peer_db_id="ocid1.test.oc1..<unique_ID>EXAMPLE-peerDbId-Value",
        db_version="EXAMPLE-dbVersion-Value",
        open_mode="READ_WRITE",
        permission_level="UNRESTRICTED",
        subnet_id="ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
        private_endpoint_label="EXAMPLE-privateEndpointLabel-Value",
        private_endpoint_ip="EXAMPLE-privateEndpointIp-Value",
        nsg_ids=["EXAMPLE--Value"],
        auto_refresh_frequency_in_seconds=406273,
        auto_refresh_point_lag_in_seconds=98896,
        time_of_auto_refresh_start=datetime.strptime(
            "2006-04-10T03:29:59.657Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        customer_contacts=[
            oci.database.models.CustomerContact(
                email="EXAMPLE-email-Value")],
        is_mtls_connection_required=True,
        resource_pool_leader_id="ocid1.test.oc1..<unique_ID>EXAMPLE-resourcePoolLeaderId-Value",
        resource_pool_summary=oci.database.models.ResourcePoolSummary(
            pool_size=273,
            pool_storage_size_in_tbs=69,
            available_storage_capacity_in_tbs=8804.339,
            total_compute_capacity=7,
            available_compute_capacity=305,
            is_disabled=True),
        autonomous_maintenance_schedule_type="REGULAR",
        autonomous_database_maintenance_window=oci.database.models.AutonomousDatabaseMaintenanceWindowSummary(
            day_of_week=oci.database.models.DayOfWeek(
                name="MONDAY"),
            maintenance_start_time="EXAMPLE-maintenanceStartTime-Value",
            maintenance_end_time="EXAMPLE-maintenanceEndTime-Value",
            availability_domain="EXAMPLE-availabilityDomain-Value",
            is_maintenance_window_change_scheduled=True),
        time_maintenance_pause_until=datetime.strptime(
            "2016-09-03T09:35:52.397Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        scheduled_maintenance_window=oci.database.models.AutonomousDatabaseMaintenanceWindowSummary(
            day_of_week=oci.database.models.DayOfWeek(
                name="THURSDAY"),
            maintenance_start_time="EXAMPLE-maintenanceStartTime-Value",
            maintenance_end_time="EXAMPLE-maintenanceEndTime-Value",
            availability_domain="EXAMPLE-availabilityDomain-Value",
            is_maintenance_window_change_scheduled=False),
        time_scheduled_maintenance_window_update=datetime.strptime(
            "2043-10-01T13:01:00.779Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        is_backup_retention_locked=True,
        time_scheduled_db_version_upgrade=datetime.strptime(
            "2036-10-29T09:08:32.594Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        is_disable_db_version_upgrade_schedule=False,
        is_schedule_db_version_upgrade_to_earliest=False,
        scheduled_operations=[
            oci.database.models.ScheduledOperationDetails(
                day_of_week=oci.database.models.DayOfWeek(
                    name="FRIDAY"),
                scheduled_start_time="EXAMPLE-scheduledStartTime-Value",
                scheduled_stop_time="EXAMPLE-scheduledStopTime-Value")],
        is_auto_scaling_for_storage_enabled=True,
        database_edition="ENTERPRISE_EDITION",
        db_tools_details=[
            oci.database.models.DatabaseTool(
                name="OML",
                is_enabled=False,
                compute_count=6502.785,
                max_idle_time_in_minutes=256)],
        vanity_url_details=oci.database.models.VanityUrlDetails(
            is_disabled=True,
            api_gateway_id="ocid1.test.oc1..<unique_ID>EXAMPLE-apiGatewayId-Value",
            vanity_url_host_name="EXAMPLE-vanityUrlHostName-Value"),
        secret_id="ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value",
        secret_version_number=33,
        encryption_key=oci.database.models.OracleManagedKeyDetails(
            provider="ORACLE_MANAGED"),
        is_disconnect_peer=False,
        local_adg_resource_pool_leader_id="ocid1.test.oc1..<unique_ID>EXAMPLE-localAdgResourcePoolLeaderId-Value"),
    if_match="EXAMPLE-ifMatch-Value",
    opc_request_id="WYFQOCRKUROGIYEN3DUP<unique_ID>",
    opc_dry_run=True)

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