// 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 UpdateVmClusterExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var updateVmClusterDetails = new Oci.DatabaseService.Models.UpdateVmClusterDetails
{
CpuCoreCount = 501,
OcpuCount = (float)9001.561,
MemorySizeInGBs = 567,
DbNodeStorageSizeInGBs = 649,
DataStorageSizeInTBs = 618.847,
DataStorageSizeInGBs = 8949.667,
LicenseModel = Oci.DatabaseService.Models.UpdateVmClusterDetails.LicenseModelEnum.BringYourOwnLicense,
SshPublicKeys = new List<string>
{
"EXAMPLE--Value"
},
Version = new Oci.DatabaseService.Models.PatchDetails
{
PatchId = "ocid1.test.oc1..<unique_ID>EXAMPLE-patchId-Value",
DatabaseSoftwareImageId = "ocid1.test.oc1..<unique_ID>EXAMPLE-databaseSoftwareImageId-Value",
Action = Oci.DatabaseService.Models.PatchDetails.ActionEnum.Apply
},
UpdateDetails = new Oci.DatabaseService.Models.VmClusterUpdateDetails
{
UpdateId = "ocid1.test.oc1..<unique_ID>EXAMPLE-updateId-Value",
UpdateAction = Oci.DatabaseService.Models.VmClusterUpdateDetails.UpdateActionEnum.Precheck,
GiSoftwareImageId = "ocid1.test.oc1..<unique_ID>EXAMPLE-giSoftwareImageId-Value"
},
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_fhIlt",
"EXAMPLE_VALUE_lYUuc5j5xm3WsRAHdtrG"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_CHofs",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_536va",
"EXAMPLE--Value"
}
}
}
},
DataCollectionOptions = new Oci.DatabaseService.Models.DataCollectionOptions
{
IsDiagnosticsEventsEnabled = false,
IsHealthMonitoringEnabled = true,
IsIncidentLogsEnabled = true
},
FileSystemConfigurationDetails = new List<Oci.DatabaseService.Models.FileSystemConfigurationDetail>
{
new Oci.DatabaseService.Models.FileSystemConfigurationDetail
{
MountPoint = "EXAMPLE-mountPoint-Value",
FileSystemSizeGb = 684
}
}
};
var updateVmClusterRequest = new Oci.DatabaseService.Requests.UpdateVmClusterRequest
{
VmClusterId = "ocid1.test.oc1..<unique_ID>EXAMPLE-vmClusterId-Value",
UpdateVmClusterDetails = updateVmClusterDetails,
IfMatch = "EXAMPLE-ifMatch-Value",
OpcRequestId = "S6RXAZ2JA2UR3PRYVGRG<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.UpdateVmCluster(updateVmClusterRequest);
// Retrieve value from the response.
var id = response.VmCluster.Id;
}
}
catch (Exception e)
{
Console.WriteLine($"UpdateVmCluster Failed with {e.Message}");
throw e;
}
}
}
}