// 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.DataccService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Datacc
{
public class UpdateVmClusterNetworkExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var updateVmClusterNetworkDetails = new Oci.DataccService.Models.UpdateVmClusterNetworkDetails
{
DisplayName = "EXAMPLE-displayName-Value",
Scans = new List<Oci.DataccService.Models.ScanDetails>
{
new Oci.DataccService.Models.ScanDetails
{
Hostname = "EXAMPLE-hostname-Value",
Ips = new List<string>
{
"EXAMPLE--Value"
}
}
},
ListenerPort = 5285,
ListenerPortSsl = 3878,
DnsServers = new List<string>
{
"EXAMPLE--Value"
},
NtpServers = new List<string>
{
"EXAMPLE--Value"
},
VmNetworks = new List<Oci.DataccService.Models.VmNetworkDetails>
{
new Oci.DataccService.Models.VmNetworkDetails
{
VlanId = "ocid1.test.oc1..<unique_ID>EXAMPLE-vlanId-Value",
NetworkType = Oci.DataccService.Models.VmClusterNetworkType.Client,
Netmask = "EXAMPLE-netmask-Value",
Gateway = "EXAMPLE-gateway-Value",
DomainName = "EXAMPLE-domainName-Value",
Prefix = "EXAMPLE-prefix-Value",
Nodes = new List<Oci.DataccService.Models.NodeDetails>
{
new Oci.DataccService.Models.NodeDetails
{
Hostname = "EXAMPLE-hostname-Value",
Ip = "EXAMPLE-ip-Value",
VipHostname = "EXAMPLE-vipHostname-Value",
Vip = "EXAMPLE-vip-Value"
}
}
}
},
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_nWiqJ",
"EXAMPLE_VALUE_voeiFeMuDMV9EmODcixR"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_QHrSG",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_2g2Ue",
"EXAMPLE--Value"
}
}
}
}
};
var updateVmClusterNetworkRequest = new Oci.DataccService.Requests.UpdateVmClusterNetworkRequest
{
UpdateVmClusterNetworkDetails = updateVmClusterNetworkDetails,
VmClusterNetworkId = "ocid1.test.oc1..<unique_ID>EXAMPLE-vmClusterNetworkId-Value",
IfMatch = "EXAMPLE-ifMatch-Value",
OpcRequestId = "DNPIZLMI7KYITBVLEMZE<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 BaseinfraClient(provider, new ClientConfiguration()))
{
var response = await client.UpdateVmClusterNetwork(updateVmClusterNetworkRequest);
// Retrieve value from the response.
var id = response.VmClusterNetwork.Id;
}
}
catch (Exception e)
{
Console.WriteLine($"UpdateVmClusterNetwork Failed with {e.Message}");
throw e;
}
}
}
}