// 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 CreateExadataInsightExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var createExadataInsightDetails = new Oci.OpsiService.Models.CreatePeComanagedExadataInsightDetails
{
ExadataInfraId = "ocid1.test.oc1..<unique_ID>EXAMPLE-exadataInfraId-Value",
MemberVmClusterDetails = new List<Oci.OpsiService.Models.CreatePeComanagedExadataVmclusterDetails>
{
new Oci.OpsiService.Models.CreatePeComanagedExadataVmclusterDetails
{
VmclusterId = "ocid1.test.oc1..<unique_ID>EXAMPLE-vmclusterId-Value",
OpsiPrivateEndpointId = "ocid1.test.oc1..<unique_ID>EXAMPLE-opsiPrivateEndpointId-Value",
DbmPrivateEndpointId = "ocid1.test.oc1..<unique_ID>EXAMPLE-dbmPrivateEndpointId-Value",
MemberDatabaseDetails = new List<Oci.OpsiService.Models.CreatePeComanagedDatabaseInsightDetails>
{
new Oci.OpsiService.Models.CreatePeComanagedDatabaseInsightDetails
{
DatabaseId = "ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value",
DatabaseResourceType = "EXAMPLE-databaseResourceType-Value",
OpsiPrivateEndpointId = "ocid1.test.oc1..<unique_ID>EXAMPLE-opsiPrivateEndpointId-Value",
DbmPrivateEndpointId = "ocid1.test.oc1..<unique_ID>EXAMPLE-dbmPrivateEndpointId-Value",
ServiceName = "EXAMPLE-serviceName-Value",
CredentialDetails = new Oci.OpsiService.Models.CredentialByNamedCredentials
{
NamedCredentialId = "ocid1.test.oc1..<unique_ID>EXAMPLE-namedCredentialId-Value",
CredentialSourceName = "EXAMPLE-credentialSourceName-Value"
},
ConnectionDetails = new Oci.OpsiService.Models.PeComanagedDatabaseConnectionDetails
{
Hosts = new List<Oci.OpsiService.Models.PeComanagedDatabaseHostDetails>
{
new Oci.OpsiService.Models.PeComanagedDatabaseHostDetails
{
HostIp = "EXAMPLE-hostIp-Value",
Port = 7261
}
},
Protocol = Oci.OpsiService.Models.PeComanagedDatabaseConnectionDetails.ProtocolEnum.Tcps,
ServiceName = "EXAMPLE-serviceName-Value"
},
DeploymentType = Oci.OpsiService.Models.CreatePeComanagedDatabaseInsightDetails.DeploymentTypeEnum.Exacs,
SystemTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_4Tr8o",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_6dYhT",
"EXAMPLE--Value"
}
}
}
},
CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_5fjTO",
"EXAMPLE_VALUE_miDYDB8c5H1BzMaiq5JQ"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_91GpZ",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_5Soi3",
"EXAMPLE--Value"
}
}
}
}
}
},
VmClusterType = Oci.OpsiService.Models.ExadataVmClusterType.AutonomousVmCluster,
MemberAutonomousDetails = new List<Oci.OpsiService.Models.CreateAutonomousDatabaseInsightDetails>
{
new Oci.OpsiService.Models.CreateAutonomousDatabaseInsightDetails
{
DatabaseId = "ocid1.test.oc1..<unique_ID>EXAMPLE-databaseId-Value",
DatabaseResourceType = "EXAMPLE-databaseResourceType-Value",
IsAdvancedFeaturesEnabled = false,
ConnectionDetails = new Oci.OpsiService.Models.ConnectionDetails
{
HostName = "EXAMPLE-hostName-Value",
Protocol = Oci.OpsiService.Models.ConnectionDetails.ProtocolEnum.Tcps,
Port = 48498,
ServiceName = "EXAMPLE-serviceName-Value"
},
CredentialDetails = new Oci.OpsiService.Models.CredentialByIam
{
CredentialSourceName = "EXAMPLE-credentialSourceName-Value"
},
OpsiPrivateEndpointId = "ocid1.test.oc1..<unique_ID>EXAMPLE-opsiPrivateEndpointId-Value",
SystemTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_o4rgG",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_uyvtM",
"EXAMPLE--Value"
}
}
}
},
CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_3zbFR",
"EXAMPLE_VALUE_0vgNlZ7uO0rNJ1rNKhDl"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_aXA6r",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_WAdqJ",
"EXAMPLE--Value"
}
}
}
}
}
},
CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"
}
},
CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_h0X6Y",
"EXAMPLE_VALUE_Ulyx5cCj15u0Sz600XiC"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_cJarD",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_6EqxD",
"EXAMPLE--Value"
}
}
}
}
};
var createExadataInsightRequest = new Oci.OpsiService.Requests.CreateExadataInsightRequest
{
CreateExadataInsightDetails = createExadataInsightDetails,
OpcRetryToken = "EXAMPLE-opcRetryToken-Value",
OpcRequestId = "5DQIFTNFGEH7QEPCPDBJ<unique_ID>"
};
// 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.CreateExadataInsight(createExadataInsightRequest);
// Retrieve value from the response.
var id = response.ExadataInsight.Id;
}
}
catch (Exception e)
{
Console.WriteLine($"CreateExadataInsight Failed with {e.Message}");
throw e;
}
}
}
}