// 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 * as opsi from "oci-opsi";
import common = require("oci-common");
// Create a default authentication provider that uses the DEFAULT
// profile in the configuration file.
// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();
(async () => {
try {
// Create a service client
const client = new opsi.OperationsInsightsClient({ authenticationDetailsProvider: provider });
// Create a request and dependent object(s).
const createExadataInsightDetails = {
entitySource: "MACS_MANAGED_CLOUD_EXADATA", exadataInfraId: "ocid1.test.oc1..<unique_ID>EXAMPLE-exadataInfraId-Value",
memberVmClusterDetails: [{
vmClusterType: "vmCluster", memberDatabaseDetails: [{
entitySource: "MACS_MANAGED_CLOUD_DATABASE", databaseId: "ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value",
managementAgentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-managementAgentId-Value",
connectionDetails: {
hostName: "EXAMPLE-hostName-Value",
protocol: opsi.models.ConnectionDetails.Protocol.Tcp,
port: 42268,
serviceName: "EXAMPLE-serviceName-Value",
}
,
connectionCredentialDetails: {
credentialType: "CREDENTIALS_BY_NAMED_CREDS", namedCredentialId: "ocid1.test.oc1..<unique_ID>EXAMPLE-namedCredentialId-Value",
credentialSourceName: "EXAMPLE-credentialSourceName-Value"
}
,
databaseResourceType: "EXAMPLE-databaseResourceType-Value",
deploymentType: opsi.models.CreateMacsManagedCloudDatabaseInsightDetails.DeploymentType.Exacc,
systemTags: {
EXAMPLE_KEY_prsoV :{
EXAMPLE_KEY_CqiKm :"EXAMPLE--Value"
}
},
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
freeformTags: {
EXAMPLE_KEY_aQA5r :"EXAMPLE_VALUE_qiD22kezsu0y5fxi5b5x"
},
definedTags: {
EXAMPLE_KEY_9W2BQ :{
EXAMPLE_KEY_PwyEX :"EXAMPLE--Value"
}
}
}
],
memberAutonomousDetails: [{
entitySource: "MACS_MANAGED_AUTONOMOUS_DATABASE", databaseId: "ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value",
managementAgentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-managementAgentId-Value",
connectionDetails: {
hostName: "EXAMPLE-hostName-Value",
protocol: opsi.models.ConnectionDetails.Protocol.Tcp,
port: 16539,
serviceName: "EXAMPLE-serviceName-Value",
}
,
connectionCredentialDetails: {
credentialType: "CREDENTIALS_BY_IAM", credentialSourceName: "EXAMPLE-credentialSourceName-Value"
}
,
databaseResourceType: "EXAMPLE-databaseResourceType-Value",
deploymentType: opsi.models.CreateMacsManagedAutonomousDatabaseInsightDetails.DeploymentType.Exacc,
systemTags: {
EXAMPLE_KEY_yl5Rl :{
EXAMPLE_KEY_lUsIs :"EXAMPLE--Value"
}
},
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
freeformTags: {
EXAMPLE_KEY_WbvYC :"EXAMPLE_VALUE_nYp32MtzNIku9jEx3Xzm"
},
definedTags: {
EXAMPLE_KEY_Bbjqe :{
EXAMPLE_KEY_Z5SfP :"EXAMPLE--Value"
}
}
}
],
vmclusterId: "ocid1.test.oc1..<unique_ID>EXAMPLE-vmclusterId-Value",
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"
}
],
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
freeformTags: {
EXAMPLE_KEY_TDD5t :"EXAMPLE_VALUE_M9j9YK9UhAXOyhABDIIJ"
},
definedTags: {
EXAMPLE_KEY_nSIYM :{
EXAMPLE_KEY_mTHEo :"EXAMPLE--Value"
}
}
}
const createExadataInsightRequest: opsi.requests.CreateExadataInsightRequest = {
createExadataInsightDetails: createExadataInsightDetails,
opcRetryToken: "EXAMPLE-opcRetryToken-Value",
opcRequestId: "N1M3JTTX6KOFZ93CSMTB<unique_ID>",
};
// Send request to the Client.
const createExadataInsightResponse = await client.createExadataInsight(createExadataInsightRequest);
}
catch (error) {
console.log("createExadataInsight Failed with error " + error);
}
})();