# 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
globally_distributed_database_client = oci.globally_distributed_database.ShardedDatabaseServiceClient(
    config)


# Send the request to service, some parameters are not required, see API
# doc for more info
prevalidate_sharded_database_response = globally_distributed_database_client.prevalidate_sharded_database(
    compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
    prevalidate_sharded_database_details=oci.globally_distributed_database.models.PrevalidateShardedDatabaseDetails(
        prevalidate_sharded_database_details=oci.globally_distributed_database.models.PrevalidateCreatePayload(
            operation="CREATE",
            prevalidate_payload=oci.globally_distributed_database.models.CreateDedicatedShardedDatabase(
                db_deployment_type="DEDICATED",
                compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
                display_name="EXAMPLE-displayName-Value",
                db_workload="DW",
                sharding_method="SYSTEM",
                db_version="EXAMPLE-dbVersion-Value",
                character_set="EXAMPLE-characterSet-Value",
                ncharacter_set="EXAMPLE-ncharacterSet-Value",
                listener_port=10712,
                listener_port_tls=7922,
                ons_port_local=20200,
                ons_port_remote=34012,
                prefix="j65",
                shard_details=[
                    oci.globally_distributed_database.models.CreateDedicatedShardDetail(
                        admin_password="EXAMPLE-adminPassword-Value",
                        compute_count=9261.014,
                        data_storage_size_in_gbs=3263.235,
                        is_auto_scaling_enabled=True,
                        cloud_autonomous_vm_cluster_id="ocid1.test.oc1..<unique_ID>EXAMPLE-cloudAutonomousVmClusterId-Value",
                        encryption_key_details=oci.globally_distributed_database.models.DedicatedShardOrCatalogEncryptionKeyDetails(
                            vault_id="ocid1.test.oc1..<unique_ID>EXAMPLE-vaultId-Value",
                            kms_key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
                            kms_key_version_id="ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value"),
                        shard_space="EXAMPLE-shardSpace-Value",
                        peer_cloud_autonomous_vm_cluster_id="ocid1.test.oc1..<unique_ID>EXAMPLE-peerCloudAutonomousVmClusterId-Value")],
                catalog_details=[
                    oci.globally_distributed_database.models.CreateDedicatedCatalogDetail(
                        admin_password="EXAMPLE-adminPassword-Value",
                        compute_count=2200.2463,
                        data_storage_size_in_gbs=660.9106,
                        is_auto_scaling_enabled=False,
                        cloud_autonomous_vm_cluster_id="ocid1.test.oc1..<unique_ID>EXAMPLE-cloudAutonomousVmClusterId-Value",
                        encryption_key_details=oci.globally_distributed_database.models.DedicatedShardOrCatalogEncryptionKeyDetails(
                            vault_id="ocid1.test.oc1..<unique_ID>EXAMPLE-vaultId-Value",
                            kms_key_id="ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyId-Value",
                            kms_key_version_id="ocid1.test.oc1..<unique_ID>EXAMPLE-kmsKeyVersionId-Value"),
                        peer_cloud_autonomous_vm_cluster_id="ocid1.test.oc1..<unique_ID>EXAMPLE-peerCloudAutonomousVmClusterId-Value")],
                freeform_tags={
                    'EXAMPLE_KEY_QdhSN': 'EXAMPLE_VALUE_b53JDkmW9vNV6ngmAZGM'},
                defined_tags={
                    'EXAMPLE_KEY_FAZcT': {
                        'EXAMPLE_KEY_EaeZ5': 'EXAMPLE--Value'}},
                replication_method="RAFT",
                replication_factor=4,
                replication_unit=114,
                cluster_certificate_common_name="EXAMPLE-clusterCertificateCommonName-Value",
                chunks=392))),
    opc_retry_token="EXAMPLE-opcRetryToken-Value",
    opc_request_id="T5I2ALIOPTWFMBIAY8LM<unique_ID>")

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

Was this article helpful?