// 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.CoreService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Core
{
public class UpdateVtapExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var updateVtapDetails = new Oci.CoreService.Models.UpdateVtapDetails
{
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_LDxFg",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_S8LBO",
"EXAMPLE--Value"
}
}
}
},
DisplayName = "EXAMPLE-displayName-Value",
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_EHXlT",
"EXAMPLE_VALUE_SwrS1WhqXWBbP1x18DvR"
}
},
SourceId = "ocid1.test.oc1..<unique_ID>EXAMPLE-sourceId-Value",
TargetId = "ocid1.test.oc1..<unique_ID>EXAMPLE-targetId-Value",
TargetIp = "EXAMPLE-targetIp-Value",
CaptureFilterId = "ocid1.test.oc1..<unique_ID>EXAMPLE-captureFilterId-Value",
EncapsulationProtocol = Oci.CoreService.Models.UpdateVtapDetails.EncapsulationProtocolEnum.Vxlan,
VxlanNetworkIdentifier = 205,
IsVtapEnabled = false,
TrafficMode = Oci.CoreService.Models.UpdateVtapDetails.TrafficModeEnum.Priority,
MaxPacketSize = 474,
SourcePrivateEndpointIp = "EXAMPLE-sourcePrivateEndpointIp-Value",
SourcePrivateEndpointSubnetId = "ocid1.test.oc1..<unique_ID>EXAMPLE-sourcePrivateEndpointSubnetId-Value",
TargetType = Oci.CoreService.Models.UpdateVtapDetails.TargetTypeEnum.IpAddress,
SourceType = Oci.CoreService.Models.UpdateVtapDetails.SourceTypeEnum.ExadataVmCluster
};
var updateVtapRequest = new Oci.CoreService.Requests.UpdateVtapRequest
{
VtapId = "ocid1.test.oc1..<unique_ID>EXAMPLE-vtapId-Value",
UpdateVtapDetails = updateVtapDetails,
IfMatch = "EXAMPLE-ifMatch-Value",
OpcRequestId = "UG7YJEX5UOTG5B7I4GQU<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 VirtualNetworkClient(provider, new ClientConfiguration()))
{
var response = await client.UpdateVtap(updateVtapRequest);
// Retrieve value from the response.
var id = response.Vtap.Id;
}
}
catch (Exception e)
{
Console.WriteLine($"UpdateVtap Failed with {e.Message}");
throw e;
}
}
}
}