// 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 addExadataInsightMembersDetails = {
entitySource: "MACS_MANAGED_CLOUD_EXADATA", memberEntityDetails: [{
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: 55503,
serviceName: "EXAMPLE-serviceName-Value",
}
,
connectionCredentialDetails: {
credentialType: "CREDENTIALS_BY_VAULT", userName: "EXAMPLE-userName-Value",
passwordSecretId: "ocid1.test.oc1..<unique_ID>EXAMPLE-passwordSecretId-Value",
walletSecretId: "ocid1.test.oc1..<unique_ID>EXAMPLE-walletSecretId-Value",
role: opsi.models.CredentialByVault.Role.Normal,
credentialSourceName: "EXAMPLE-credentialSourceName-Value"
}
,
databaseResourceType: "EXAMPLE-databaseResourceType-Value",
deploymentType: opsi.models.CreateMacsManagedCloudDatabaseInsightDetails.DeploymentType.Exacc,
systemTags: {
EXAMPLE_KEY_HtA9V :{
EXAMPLE_KEY_tK8DP :"EXAMPLE--Value"
}
},
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
freeformTags: {
EXAMPLE_KEY_xASld :"EXAMPLE_VALUE_Anok7tVLMSiqkjaVX24n"
},
definedTags: {
EXAMPLE_KEY_JWexd :{
EXAMPLE_KEY_r8BBv :"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: 21453,
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_ScSlY :{
EXAMPLE_KEY_sH5kQ :"EXAMPLE--Value"
}
},
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
freeformTags: {
EXAMPLE_KEY_xo5nP :"EXAMPLE_VALUE_xLxlIc73AhiOXqY6qaTk"
},
definedTags: {
EXAMPLE_KEY_8vGo8 :{
EXAMPLE_KEY_uBPT8 :"EXAMPLE--Value"
}
}
}
],
vmclusterId: "ocid1.test.oc1..<unique_ID>EXAMPLE-vmclusterId-Value",
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"
}
]
}
const addExadataInsightMembersRequest: opsi.requests.AddExadataInsightMembersRequest = {
addExadataInsightMembersDetails: addExadataInsightMembersDetails,
exadataInsightId: "ocid1.test.oc1..<unique_ID>EXAMPLE-exadataInsightId-Value",
ifMatch: "EXAMPLE-ifMatch-Value",
opcRequestId: "IBHR0H4L4ZICZNPHCQ5A<unique_ID>",
opcRetryToken: "EXAMPLE-opcRetryToken-Value",
};
// Send request to the Client.
const addExadataInsightMembersResponse = await client.addExadataInsightMembers(addExadataInsightMembersRequest);
}
catch (error) {
console.log("addExadataInsightMembers Failed with error " + error);
}
})();