// 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 ingestSqlPlanLinesDetails = {
items: [{
version: 7457.1855,
sqlIdentifier: "EXAMPLE-sqlIdentifier-Value",
planHash: 245,
forceMatchingSignature: "EXAMPLE-forceMatchingSignature-Value",
timeGenerated: new Date("Wed Jun 03 10:13:37 UTC 2015"),
timeCollected: new Date("Wed Oct 04 02:50:31 UTC 2028"),
operation: "EXAMPLE-operation-Value",
remark: "EXAMPLE-remark-Value",
options: "EXAMPLE-options-Value",
objectNode: "EXAMPLE-objectNode-Value",
objectOwner: "EXAMPLE-objectOwner-Value",
objectName: "EXAMPLE-objectName-Value",
objectAlias: "EXAMPLE-objectAlias-Value",
objectInstance: 532,
objectType: "EXAMPLE-objectType-Value",
optimizer: "EXAMPLE-optimizer-Value",
searchColumns: 366,
identifier: 741,
parentIdentifier: 987,
depth: 752,
position: 225,
cost: 205,
cardinality: 379,
bytes: 76,
other: "EXAMPLE-other-Value",
otherTag: "EXAMPLE-otherTag-Value",
partitionStart: "EXAMPLE-partitionStart-Value",
partitionStop: "EXAMPLE-partitionStop-Value",
partitionIdentifier: 377,
distribution: "EXAMPLE-distribution-Value",
cpuCost: 937,
ioCost: 594,
tempSpace: 924,
accessPredicates: "EXAMPLE-accessPredicates-Value",
filterPredicates: "EXAMPLE-filterPredicates-Value",
projection: "EXAMPLE-projection-Value",
qblockName: "EXAMPLE-qblockName-Value",
elapsedTimeInSec: 5803.93,
otherXML: "EXAMPLE-otherXML-Value",
}
],
}
const ingestSqlPlanLinesRequest: opsi.requests.IngestSqlPlanLinesRequest = {
ingestSqlPlanLinesDetails: ingestSqlPlanLinesDetails,
compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
databaseId: "ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value",
id: "ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
opcRequestId: "ELMNN8IM6PYUSCXGXGLN<unique_ID>",
ifMatch: "EXAMPLE-ifMatch-Value",
opcRetryToken: "EXAMPLE-opcRetryToken-Value",
};
// Send request to the Client.
const ingestSqlPlanLinesResponse = await client.ingestSqlPlanLines(ingestSqlPlanLinesRequest);
}
catch (error) {
console.log("ingestSqlPlanLines Failed with error " + error);
}
})();