// 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.Threading.Tasks;
using Oci.BdsService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Bds
{
public class ChangeShapeExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var changeShapeDetails = new Oci.BdsService.Models.ChangeShapeDetails
{
ClusterAdminPassword = "EXAMPLE-clusterAdminPassword-Value",
SecretId = "ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value",
Nodes = new Oci.BdsService.Models.ChangeShapeNodes
{
Worker = "EXAMPLE-worker-Value",
WorkerShapeConfig = new Oci.BdsService.Models.ShapeConfigDetails
{
Ocpus = 200,
MemoryInGBs = 343,
Nvmes = 3
},
ComputeOnlyWorker = "EXAMPLE-computeOnlyWorker-Value",
ComputeOnlyWorkerShapeConfig = new Oci.BdsService.Models.ShapeConfigDetails
{
Ocpus = 469,
MemoryInGBs = 105,
Nvmes = 1
},
Master = "EXAMPLE-master-Value",
MasterShapeConfig = new Oci.BdsService.Models.ShapeConfigDetails
{
Ocpus = 695,
MemoryInGBs = 413,
Nvmes = 1
},
Utility = "EXAMPLE-utility-Value",
UtilityShapeConfig = new Oci.BdsService.Models.ShapeConfigDetails
{
Ocpus = 709,
MemoryInGBs = 708,
Nvmes = 3
},
Cloudsql = "EXAMPLE-cloudsql-Value",
CloudsqlShapeConfig = new Oci.BdsService.Models.ShapeConfigDetails
{
Ocpus = 531,
MemoryInGBs = 978,
Nvmes = 2
},
Edge = "EXAMPLE-edge-Value",
EdgeShapeConfig = new Oci.BdsService.Models.ShapeConfigDetails
{
Ocpus = 962,
MemoryInGBs = 107,
Nvmes = 2
},
KafkaBroker = "EXAMPLE-kafkaBroker-Value",
KafkaBrokerShapeConfig = new Oci.BdsService.Models.ShapeConfigDetails
{
Ocpus = 494,
MemoryInGBs = 110,
Nvmes = 1
}
}
};
var changeShapeRequest = new Oci.BdsService.Requests.ChangeShapeRequest
{
BdsInstanceId = "ocid1.test.oc1..<unique_ID>EXAMPLE-bdsInstanceId-Value",
ChangeShapeDetails = changeShapeDetails,
OpcRequestId = "WJJAF7VJZEENOCJTYMQV<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 BdsClient(provider, new ClientConfiguration()))
{
var response = await client.ChangeShape(changeShapeRequest);
// Retrieve value from the response.
var versionValue = response.httpResponseMessage.Version;
}
}
catch (Exception e)
{
Console.WriteLine($"ChangeShape Failed with {e.Message}");
throw e;
}
}
}
}