# 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).
from datetime import datetime
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
ingest_sql_plan_lines_response = opsi_client.ingest_sql_plan_lines(
ingest_sql_plan_lines_details=oci.opsi.models.IngestSqlPlanLinesDetails(
items=[
oci.opsi.models.SqlPlanLine(
sql_identifier="EXAMPLE-sqlIdentifier-Value",
plan_hash=184,
time_collected=datetime.strptime(
"2015-01-31T03:53:23.093Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
operation="EXAMPLE-operation-Value",
identifier=88,
version=8061.934,
remark="EXAMPLE-remark-Value",
options="EXAMPLE-options-Value",
object_node="EXAMPLE-objectNode-Value",
object_owner="EXAMPLE-objectOwner-Value",
object_name="EXAMPLE-objectName-Value",
object_alias="EXAMPLE-objectAlias-Value",
object_instance=439,
object_type="EXAMPLE-objectType-Value",
optimizer="EXAMPLE-optimizer-Value",
search_columns=727,
parent_identifier=363,
depth=224,
position=196,
cost=931,
cardinality=814,
bytes=668,
other="EXAMPLE-other-Value",
other_tag="EXAMPLE-otherTag-Value",
partition_start="EXAMPLE-partitionStart-Value",
partition_stop="EXAMPLE-partitionStop-Value",
partition_identifier=236,
distribution="EXAMPLE-distribution-Value",
cpu_cost=131,
io_cost=723,
temp_space=967,
access_predicates="EXAMPLE-accessPredicates-Value",
filter_predicates="EXAMPLE-filterPredicates-Value",
projection="EXAMPLE-projection-Value",
qblock_name="EXAMPLE-qblockName-Value",
elapsed_time_in_sec=226.95004,
other_xml="EXAMPLE-otherXML-Value")]),
compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
database_id="ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value",
id="ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
opc_request_id="SHSALDUYHKU2HNG2XFMJ<unique_ID>",
if_match="EXAMPLE-ifMatch-Value",
opc_retry_token="EXAMPLE-opcRetryToken-Value")
# Get the data from response
print(ingest_sql_plan_lines_response.data)