// 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)7651.434,
SqlIdentifier = "EXAMPLE-sqlIdentifier-Value",
PlanHash = 713,
TimeCollected = DateTime.Parse("12/26/2016 16:43:08"),
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 = 928,
ObjectType = "EXAMPLE-objectType-Value",
Optimizer = "EXAMPLE-optimizer-Value",
SearchColumns = 894,
Identifier = 22,
ParentIdentifier = 766,
Depth = 229,
Position = 532,
Cost = 333,
Cardinality = 76,
Bytes = 738,
Other = "EXAMPLE-other-Value",
OtherTag = "EXAMPLE-otherTag-Value",
PartitionStart = "EXAMPLE-partitionStart-Value",
PartitionStop = "EXAMPLE-partitionStop-Value",
PartitionIdentifier = 283,
Distribution = "EXAMPLE-distribution-Value",
CpuCost = 156,
IoCost = 151,
TempSpace = 813,
AccessPredicates = "EXAMPLE-accessPredicates-Value",
FilterPredicates = "EXAMPLE-filterPredicates-Value",
Projection = "EXAMPLE-projection-Value",
QblockName = "EXAMPLE-qblockName-Value",
ElapsedTimeInSec = (float)253.6881,
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 = "RXFTFYCO0CPRAYX1K41K<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;
}
}
}
}