// 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.VnmonitoringService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Vnmonitoring
{
public class UpdatePathAnalyzerTestExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var updatePathAnalyzerTestDetails = new Oci.VnmonitoringService.Models.UpdatePathAnalyzerTestDetails
{
DisplayName = "EXAMPLE-displayName-Value",
Protocol = 165,
SourceEndpoint = new Oci.VnmonitoringService.Models.NetworkLoadBalancerListenerEndpoint
{
ListenerId = "ocid1.test.oc1..<unique_ID>EXAMPLE-listenerId-Value",
NetworkLoadBalancerId = "ocid1.test.oc1..<unique_ID>EXAMPLE-networkLoadBalancerId-Value"
},
DestinationEndpoint = new Oci.VnmonitoringService.Models.VlanEndpoint
{
Address = "EXAMPLE-address-Value",
VlanId = "ocid1.test.oc1..<unique_ID>EXAMPLE-vlanId-Value"
},
ProtocolParameters = new Oci.VnmonitoringService.Models.TcpProtocolParameters
{
SourcePort = 64456,
DestinationPort = 23412
},
QueryOptions = new Oci.VnmonitoringService.Models.QueryOptions
{
IsBiDirectionalAnalysis = true
},
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_6hWzk",
"EXAMPLE_VALUE_UpdDUAnl1HzcrOatKqsY"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_sTnJ2",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_H5DMP",
"EXAMPLE--Value"
}
}
}
}
};
var updatePathAnalyzerTestRequest = new Oci.VnmonitoringService.Requests.UpdatePathAnalyzerTestRequest
{
PathAnalyzerTestId = "ocid1.test.oc1..<unique_ID>EXAMPLE-pathAnalyzerTestId-Value",
UpdatePathAnalyzerTestDetails = updatePathAnalyzerTestDetails,
IfMatch = "EXAMPLE-ifMatch-Value",
OpcRequestId = "VE9VY3ETO9BENW7SDBDX<unique_ID>",
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 VnMonitoringClient(provider, new ClientConfiguration()))
{
var response = await client.UpdatePathAnalyzerTest(updatePathAnalyzerTestRequest);
// Retrieve value from the response.
var id = response.PathAnalyzerTest.Id;
}
}
catch (Exception e)
{
Console.WriteLine($"UpdatePathAnalyzerTest Failed with {e.Message}");
throw e;
}
}
}
}