// 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{TempSpace: common.Int64(88),
ObjectInstance: common.Int64(23),
Optimizer: common.String("EXAMPLE-optimizer-Value"),
PlanHash: common.Int64(146),
Version: common.Float32(8223.821),
Distribution: common.String("EXAMPLE-distribution-Value"),
Other: common.String("EXAMPLE-other-Value"),
PartitionStop: common.String("EXAMPLE-partitionStop-Value"),
Position: common.Int64(407),
Remark: common.String("EXAMPLE-remark-Value"),
SearchColumns: common.Int64(20),
QblockName: common.String("EXAMPLE-qblockName-Value"),
Bytes: common.Int64(82),
Depth: common.Int64(994),
ObjectAlias: common.String("EXAMPLE-objectAlias-Value"),
Options: common.String("EXAMPLE-options-Value"),
ParentIdentifier: common.Int64(807),
Projection: common.String("EXAMPLE-projection-Value"),
Cardinality: common.Int64(662),
ObjectNode: common.String("EXAMPLE-objectNode-Value"),
ObjectOwner: common.String("EXAMPLE-objectOwner-Value"),
Operation: common.String("EXAMPLE-operation-Value"),
TimeCollected: &common.SDKTime{Time: time.Now()},
Cost: common.Int64(184),
ElapsedTimeInSec: common.Float32(1338.514),
ForceMatchingSignature: common.String("EXAMPLE-forceMatchingSignature-Value"),
Identifier: common.Int64(142),
PartitionIdentifier: common.Int64(451),
OtherXML: common.String("EXAMPLE-otherXML-Value"),
AccessPredicates: common.String("EXAMPLE-accessPredicates-Value"),
CpuCost: common.Int64(920),
FilterPredicates: common.String("EXAMPLE-filterPredicates-Value"),
IoCost: common.Int64(431),
ObjectType: common.String("EXAMPLE-objectType-Value"),
OtherTag: common.String("EXAMPLE-otherTag-Value"),
ObjectName: common.String("EXAMPLE-objectName-Value"),
PartitionStart: common.String("EXAMPLE-partitionStart-Value"),
SqlIdentifier: common.String("EXAMPLE-sqlIdentifier-Value"),
TimeGenerated: &common.SDKTime{Time: time.Now()}}}},
OpcRequestId: common.String("13D8Z7XVLDKCN9VZ2KM9<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)
}