// 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.DatabaseService;
using Oci.Common;
using Oci.Common.Auth;

namespace Oci.Sdk.DotNet.Example.Database
{
    public class CreateExadbVmClusterExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
			var createExadbVmClusterDetails = new Oci.DatabaseService.Models.CreateExadbVmClusterDetails
			{
				CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
				AvailabilityDomain = "EXAMPLE-availabilityDomain-Value",
				SubnetId = "ocid1.test.oc1..<unique_ID>EXAMPLE-subnetId-Value",
				BackupSubnetId = "ocid1.test.oc1..<unique_ID>EXAMPLE-backupSubnetId-Value",
				ClusterName = "EXAMPLE-clusterName-Value",
				DisplayName = "EXAMPLE-displayName-Value",
				Hostname = "EXAMPLE-hostname-Value",
				Domain = "EXAMPLE-domain-Value",
				SshPublicKeys = new List<string>
				{
					"EXAMPLE--Value"
				},
				LicenseModel = Oci.DatabaseService.Models.CreateExadbVmClusterDetails.LicenseModelEnum.LicenseIncluded,
				TimeZone = "EXAMPLE-timeZone-Value",
				ScanListenerPortTcp = 978,
				ScanListenerPortTcpSsl = 355,
				PrivateZoneId = "ocid1.test.oc1..<unique_ID>EXAMPLE-privateZoneId-Value",
				Shape = "EXAMPLE-shape-Value",
				NodeCount = 647,
				TotalECpuCount = 748,
				EnabledECpuCount = 346,
				VmFileSystemStorage = new Oci.DatabaseService.Models.ExadbVmClusterStorageDetails
				{
					TotalSizeInGbs = 151
				},
				ExascaleDbStorageVaultId = "ocid1.test.oc1..<unique_ID>EXAMPLE-exascaleDbStorageVaultId-Value",
				NsgIds = new List<string>
				{
					"EXAMPLE--Value"
				},
				BackupNetworkNsgIds = new List<string>
				{
					"EXAMPLE--Value"
				},
				GridImageId = "ocid1.test.oc1..<unique_ID>EXAMPLE-gridImageId-Value",
				SystemVersion = "EXAMPLE-systemVersion-Value",
				FreeformTags = new Dictionary<string, string>()
				{
					{
						"EXAMPLE_KEY_nhgIG", 
						"EXAMPLE_VALUE_CFcmayE8NY5UXuUdZXAL"
					}
				},
				DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_l9NE0", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_Fs3qx", 
								"EXAMPLE--Value"
							}
						}
					}
				},
				SecurityAttributes = new Dictionary<string, Dictionary<string, Object>>()
				{
					{
						"EXAMPLE_KEY_zQ7jC", 
						new Dictionary<string, Object>()
						{
							{
								"EXAMPLE_KEY_Iwke4", 
								"EXAMPLE--Value"
							}
						}
					}
				},
				DataCollectionOptions = new Oci.DatabaseService.Models.DataCollectionOptions
				{
					IsDiagnosticsEventsEnabled = false,
					IsHealthMonitoringEnabled = false,
					IsIncidentLogsEnabled = true
				},
				SubscriptionId = "ocid1.test.oc1..<unique_ID>EXAMPLE-subscriptionId-Value"
			};
			var createExadbVmClusterRequest = new Oci.DatabaseService.Requests.CreateExadbVmClusterRequest
			{
				CreateExadbVmClusterDetails = createExadbVmClusterDetails,
				OpcRetryToken = "EXAMPLE-opcRetryToken-Value",
				OpcRequestId = "2OL0UM01RXB1LQT9PYY3<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 DatabaseClient(provider, new ClientConfiguration()))
				{
					var response = await client.CreateExadbVmCluster(createExadbVmClusterRequest);
					// Retrieve value from the response.
					var id = response.ExadbVmCluster.Id;
				}
            }
            catch (Exception e)
            {
                Console.WriteLine($"CreateExadbVmCluster Failed with {e.Message}");
                throw e;
            }
        }

    }
}