# 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
from datetime import datetime

# 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=713,
                time_collected=datetime.strptime(
                    "2016-12-26T16:43:08.054Z",
                    "%Y-%m-%dT%H:%M:%S.%fZ"),
                operation="EXAMPLE-operation-Value",
                identifier=22,
                version=7651.434,
                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=928,
                object_type="EXAMPLE-objectType-Value",
                optimizer="EXAMPLE-optimizer-Value",
                search_columns=894,
                parent_identifier=766,
                depth=229,
                position=532,
                cost=333,
                cardinality=76,
                bytes=738,
                other="EXAMPLE-other-Value",
                other_tag="EXAMPLE-otherTag-Value",
                partition_start="EXAMPLE-partitionStart-Value",
                partition_stop="EXAMPLE-partitionStop-Value",
                partition_identifier=283,
                distribution="EXAMPLE-distribution-Value",
                cpu_cost=156,
                io_cost=151,
                temp_space=813,
                access_predicates="EXAMPLE-accessPredicates-Value",
                filter_predicates="EXAMPLE-filterPredicates-Value",
                projection="EXAMPLE-projection-Value",
                qblock_name="EXAMPLE-qblockName-Value",
                elapsed_time_in_sec=253.6881,
                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="RXFTFYCO0CPRAYX1K41K<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)