// 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).
package main
import (
"context"
"fmt"
"time"
"github.com/oracle/oci-go-sdk/v65/common"
"github.com/oracle/oci-go-sdk/v65/example/helpers"
"github.com/oracle/oci-go-sdk/v65/opsi"
)
func ExampleIngestSqlPlanLines() {
// 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.
client, err := opsi.NewOperationsInsightsClientWithConfigurationProvider(common.DefaultConfigProvider())
helpers.FatalIfError(err)
// Create a request and dependent object(s).
req := opsi.IngestSqlPlanLinesRequest{CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
DatabaseId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value"),
Id: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value"),
IfMatch: common.String("EXAMPLE-ifMatch-Value"),
IngestSqlPlanLinesDetails: opsi.IngestSqlPlanLinesDetails{Items: []opsi.SqlPlanLine{opsi.SqlPlanLine{ObjectNode: common.String("EXAMPLE-objectNode-Value"),
OtherTag: common.String("EXAMPLE-otherTag-Value"),
PartitionStop: common.String("EXAMPLE-partitionStop-Value"),
Position: common.Int64(68),
Projection: common.String("EXAMPLE-projection-Value"),
Cardinality: common.Int64(818),
Depth: common.Int64(508),
Operation: common.String("EXAMPLE-operation-Value"),
Remark: common.String("EXAMPLE-remark-Value"),
Distribution: common.String("EXAMPLE-distribution-Value"),
ForceMatchingSignature: common.String("EXAMPLE-forceMatchingSignature-Value"),
Identifier: common.Int64(780),
ObjectInstance: common.Int64(151),
Options: common.String("EXAMPLE-options-Value"),
OtherXML: common.String("EXAMPLE-otherXML-Value"),
Version: common.Float32(9193.822),
ObjectAlias: common.String("EXAMPLE-objectAlias-Value"),
ObjectOwner: common.String("EXAMPLE-objectOwner-Value"),
Optimizer: common.String("EXAMPLE-optimizer-Value"),
SqlIdentifier: common.String("EXAMPLE-sqlIdentifier-Value"),
AccessPredicates: common.String("EXAMPLE-accessPredicates-Value"),
Cost: common.Int64(532),
ObjectName: common.String("EXAMPLE-objectName-Value"),
Other: common.String("EXAMPLE-other-Value"),
PartitionIdentifier: common.Int64(230),
PartitionStart: common.String("EXAMPLE-partitionStart-Value"),
TimeCollected: &common.SDKTime{Time: time.Now()},
TimeGenerated: &common.SDKTime{Time: time.Now()},
CpuCost: common.Int64(116),
TempSpace: common.Int64(111),
ElapsedTimeInSec: common.Float32(3940.3672),
FilterPredicates: common.String("EXAMPLE-filterPredicates-Value"),
ObjectType: common.String("EXAMPLE-objectType-Value"),
ParentIdentifier: common.Int64(312),
PlanHash: common.Int64(461),
SearchColumns: common.Int64(199),
Bytes: common.Int64(77),
IoCost: common.Int64(948),
QblockName: common.String("EXAMPLE-qblockName-Value")}}},
OpcRequestId: common.String("0KJREU9D8OKVENKZFTZI<unique_ID>"),
OpcRetryToken: common.String("EXAMPLE-opcRetryToken-Value")}
// Send the request using the service client
resp, err := client.IngestSqlPlanLines(context.Background(), req)
helpers.FatalIfError(err)
// Retrieve value from the response.
fmt.Println(resp)
}