# 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
opsi_client = oci.opsi.OperationsInsightsClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
create_exadata_insight_response = opsi_client.create_exadata_insight(
    create_exadata_insight_details=oci.opsi.models.CreateMacsManagedCloudExadataInsightDetails(
        entity_source="MACS_MANAGED_CLOUD_EXADATA",
        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
        exadata_infra_id="ocid1.test.oc1..<unique_ID>EXAMPLE-exadataInfraId-Value",
        freeform_tags={
            'EXAMPLE_KEY_cSKYw': 'EXAMPLE_VALUE_mq0kKpv912UOWW22y029'},
        defined_tags={
            'EXAMPLE_KEY_JTlIP': {
                'EXAMPLE_KEY_4d52C': 'EXAMPLE--Value'}},
        member_vm_cluster_details=[
            oci.opsi.models.CreateMacsManagedCloudExadataVmclusterDetails(
                vm_cluster_type="vmCluster",
                vmcluster_id="ocid1.test.oc1..<unique_ID>EXAMPLE-vmclusterId-Value",
                compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
                member_database_details=[
                                oci.opsi.models.CreateMacsManagedCloudDatabaseInsightDetails(
                                    entity_source="MACS_MANAGED_CLOUD_DATABASE",
                                    compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
                                    database_id="ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value",
                                    management_agent_id="ocid1.test.oc1..<unique_ID>EXAMPLE-managementAgentId-Value",
                                    connection_details=oci.opsi.models.ConnectionDetails(
                                        host_name="EXAMPLE-hostName-Value",
                                        protocol="TCPS",
                                        port=55865,
                                        service_name="EXAMPLE-serviceName-Value"),
                                    connection_credential_details=oci.opsi.models.CredentialByVault(
                                        credential_type="CREDENTIALS_BY_VAULT",
                                        credential_source_name="EXAMPLE-credentialSourceName-Value",
                                        user_name="EXAMPLE-userName-Value",
                                        password_secret_id="ocid1.test.oc1..<unique_ID>EXAMPLE-passwordSecretId-Value",
                                        wallet_secret_id="ocid1.test.oc1..<unique_ID>EXAMPLE-walletSecretId-Value",
                                        role="NORMAL"),
                                    database_resource_type="EXAMPLE-databaseResourceType-Value",
                                    deployment_type="BARE_METAL",
                                    freeform_tags={
                                        'EXAMPLE_KEY_6dA8t': 'EXAMPLE_VALUE_LFJLc2sHB4ZZOWrkUhHU'},
                                    defined_tags={
                                        'EXAMPLE_KEY_dvYky': {
                                            'EXAMPLE_KEY_Z4Z4N': 'EXAMPLE--Value'}},
                                    system_tags={
                                        'EXAMPLE_KEY_XhBts': {
                                            'EXAMPLE_KEY_W1brF': 'EXAMPLE--Value'}})],
                member_autonomous_details=[
                                oci.opsi.models.CreateMacsManagedAutonomousDatabaseInsightDetails(
                                    entity_source="MACS_MANAGED_AUTONOMOUS_DATABASE",
                                    compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
                                    database_id="ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value",
                                    management_agent_id="ocid1.test.oc1..<unique_ID>EXAMPLE-managementAgentId-Value",
                                    connection_details=oci.opsi.models.ConnectionDetails(
                                        host_name="EXAMPLE-hostName-Value",
                                        protocol="TCPS",
                                        port=45591,
                                        service_name="EXAMPLE-serviceName-Value"),
                                    connection_credential_details=oci.opsi.models.CredentialByNamedCredentials(
                                        credential_type="CREDENTIALS_BY_NAMED_CREDS",
                                        credential_source_name="EXAMPLE-credentialSourceName-Value",
                                        named_credential_id="ocid1.test.oc1..<unique_ID>EXAMPLE-namedCredentialId-Value"),
                                    database_resource_type="EXAMPLE-databaseResourceType-Value",
                                    deployment_type="EXACC",
                                    freeform_tags={
                                        'EXAMPLE_KEY_l7QED': 'EXAMPLE_VALUE_1gulsykmShivU6dyYcer'},
                                    defined_tags={
                                        'EXAMPLE_KEY_TTD11': {
                                            'EXAMPLE_KEY_TLLyE': 'EXAMPLE--Value'}},
                                    system_tags={
                                        'EXAMPLE_KEY_0GEFG': {
                                            'EXAMPLE_KEY_R9XOt': 'EXAMPLE--Value'}})])]),
    opc_retry_token="EXAMPLE-opcRetryToken-Value",
    opc_request_id="N8SMUNVJMUMUCYIRB8JG<unique_ID>")

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

Was this article helpful?