# 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
add_exadata_insight_members_response = opsi_client.add_exadata_insight_members(
    add_exadata_insight_members_details=oci.opsi.models.AddMacsManagedCloudExadataInsightMembersDetails(
        entity_source="MACS_MANAGED_CLOUD_EXADATA",
        member_entity_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=6186,
                            service_name="EXAMPLE-serviceName-Value"),
                        connection_credential_details=oci.opsi.models.CredentialsBySource(
                            credential_type="CREDENTIALS_BY_SOURCE",
                            credential_source_name="EXAMPLE-credentialSourceName-Value"),
                        database_resource_type="EXAMPLE-databaseResourceType-Value",
                        deployment_type="EXACS",
                        freeform_tags={
                            'EXAMPLE_KEY_Ghqr3': 'EXAMPLE_VALUE_0ZKez1kCMKathPPwtGLO'},
                        defined_tags={
                            'EXAMPLE_KEY_TjpJF': {
                                'EXAMPLE_KEY_GewiN': 'EXAMPLE--Value'}},
                        system_tags={
                            'EXAMPLE_KEY_h52dB': {
                                'EXAMPLE_KEY_4GCLS': '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="TCP",
                            port=6668,
                            service_name="EXAMPLE-serviceName-Value"),
                        connection_credential_details=oci.opsi.models.CredentialsBySource(
                            credential_type="CREDENTIALS_BY_SOURCE",
                            credential_source_name="EXAMPLE-credentialSourceName-Value"),
                        database_resource_type="EXAMPLE-databaseResourceType-Value",
                        deployment_type="EXACC",
                        freeform_tags={
                            'EXAMPLE_KEY_rf97b': 'EXAMPLE_VALUE_PvEwd22rXj1P961ralwn'},
                        defined_tags={
                            'EXAMPLE_KEY_1xBc0': {
                                'EXAMPLE_KEY_WsJ4X': 'EXAMPLE--Value'}},
                        system_tags={
                            'EXAMPLE_KEY_uC4P6': {
                                'EXAMPLE_KEY_Z0dkK': 'EXAMPLE--Value'}})])]),
    exadata_insight_id="ocid1.test.oc1..<unique_ID>EXAMPLE-exadataInsightId-Value",
    if_match="EXAMPLE-ifMatch-Value",
    opc_request_id="SZUNP2QXYHXUMALF8JC2<unique_ID>",
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

# Get the data from response
print(add_exadata_insight_members_response.headers)