// 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).
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Oci.OpsiService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Opsi
{
public class IngestSqlPlanLinesExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var ingestSqlPlanLinesDetails = new Oci.OpsiService.Models.IngestSqlPlanLinesDetails
{
Items = new List<Oci.OpsiService.Models.SqlPlanLine>
{
new Oci.OpsiService.Models.SqlPlanLine
{
Version = (float)630.2524,
SqlIdentifier = "EXAMPLE-sqlIdentifier-Value",
PlanHash = 580,
ForceMatchingSignature = "EXAMPLE-forceMatchingSignature-Value",
TimeGenerated = DateTime.Parse("08/29/2048 19:24:18"),
TimeCollected = DateTime.Parse("07/02/2033 17:01:43"),
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 = 100,
ObjectType = "EXAMPLE-objectType-Value",
Optimizer = "EXAMPLE-optimizer-Value",
SearchColumns = 940,
Identifier = 853,
ParentIdentifier = 113,
Depth = 289,
Position = 361,
Cost = 944,
Cardinality = 444,
Bytes = 439,
Other = "EXAMPLE-other-Value",
OtherTag = "EXAMPLE-otherTag-Value",
PartitionStart = "EXAMPLE-partitionStart-Value",
PartitionStop = "EXAMPLE-partitionStop-Value",
PartitionIdentifier = 968,
Distribution = "EXAMPLE-distribution-Value",
CpuCost = 132,
IoCost = 616,
TempSpace = 486,
AccessPredicates = "EXAMPLE-accessPredicates-Value",
FilterPredicates = "EXAMPLE-filterPredicates-Value",
Projection = "EXAMPLE-projection-Value",
QblockName = "EXAMPLE-qblockName-Value",
ElapsedTimeInSec = (float)8876.393,
OtherXML = "EXAMPLE-otherXML-Value"
}
}
};
var ingestSqlPlanLinesRequest = new Oci.OpsiService.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 = "7VATJ9XXQZDB0XFQ4CN5<unique_ID>",
IfMatch = "EXAMPLE-ifMatch-Value",
OpcRetryToken = "EXAMPLE-opcRetryToken-Value"
};
// 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.
var provider = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
try
{
// Create a service client and send the request.
using (var client = new OperationsInsightsClient(provider, new ClientConfiguration()))
{
var response = await client.IngestSqlPlanLines(ingestSqlPlanLinesRequest);
// Retrieve value from the response.
var messageValue = response.IngestSqlPlanLinesResponseDetails.Message;
}
}
catch (Exception e)
{
Console.WriteLine($"IngestSqlPlanLines Failed with {e.Message}");
throw e;
}
}
}
}