// 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.DisasterrecoveryService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Disasterrecovery
{
public class UpdateDrProtectionGroupExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var updateDrProtectionGroupDetails = new Oci.DisasterrecoveryService.Models.UpdateDrProtectionGroupDetails
{
DisplayName = "EXAMPLE-displayName-Value",
LogLocation = new Oci.DisasterrecoveryService.Models.UpdateObjectStorageLogLocationDetails
{
Namespace = "EXAMPLE-namespace-Value",
Bucket = "EXAMPLE-bucket-Value"
},
Members = new List<Oci.DisasterrecoveryService.Models.UpdateDrProtectionGroupMemberDetails>
{
new Oci.DisasterrecoveryService.Models.UpdateDrProtectionGroupMemberComputeInstanceNonMovableDetails
{
IsStartStopEnabled = false,
FileSystemOperations = new List<Oci.DisasterrecoveryService.Models.UpdateComputeInstanceNonMovableFileSystemOperationDetails>
{
new Oci.DisasterrecoveryService.Models.UpdateComputeInstanceNonMovableFileSystemOperationDetails
{
ExportPath = "EXAMPLE-exportPath-Value",
MountPoint = "EXAMPLE-mountPoint-Value",
MountTargetId = "ocid1.test.oc1..<unique_ID>EXAMPLE-mountTargetId-Value"
}
},
BlockVolumeOperations = new List<Oci.DisasterrecoveryService.Models.UpdateComputeInstanceNonMovableBlockVolumeOperationDetails>
{
new Oci.DisasterrecoveryService.Models.UpdateComputeInstanceNonMovableBlockVolumeOperationDetails
{
BlockVolumeId = "ocid1.test.oc1..<unique_ID>EXAMPLE-blockVolumeId-Value",
AttachmentDetails = new Oci.DisasterrecoveryService.Models.UpdateBlockVolumeAttachmentDetails
{
VolumeAttachmentReferenceInstanceId = "ocid1.test.oc1..<unique_ID>EXAMPLE-volumeAttachmentReferenceInstanceId-Value"
},
MountDetails = new Oci.DisasterrecoveryService.Models.UpdateBlockVolumeMountDetails
{
MountPoint = "EXAMPLE-mountPoint-Value"
}
}
},
BlockVolumeAttachAndMountOperations = new Oci.DisasterrecoveryService.Models.UpdateComputeInstanceNonMovableBlockVolumeAttachAndMountOperationsDetails
{
Attachments = new List<Oci.DisasterrecoveryService.Models.UpdateComputeInstanceNonMovableBlockVolumeAttachOperationDetails>
{
new Oci.DisasterrecoveryService.Models.UpdateComputeInstanceNonMovableBlockVolumeAttachOperationDetails
{
BlockVolumeId = "ocid1.test.oc1..<unique_ID>EXAMPLE-blockVolumeId-Value",
VolumeAttachmentReferenceInstanceId = "ocid1.test.oc1..<unique_ID>EXAMPLE-volumeAttachmentReferenceInstanceId-Value"
}
},
Mounts = new List<Oci.DisasterrecoveryService.Models.UpdateComputeInstanceNonMovableBlockVolumeMountOperationDetails>
{
new Oci.DisasterrecoveryService.Models.UpdateComputeInstanceNonMovableBlockVolumeMountOperationDetails
{
MountPoint = "EXAMPLE-mountPoint-Value"
}
}
},
MemberId = "ocid1.test.oc1..<unique_ID>EXAMPLE-memberId-Value"
}
},
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_qXCEh",
"EXAMPLE_VALUE_zEfLhXWYljnlJtXUCklk"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_gqTjx",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_23d4K",
"EXAMPLE--Value"
}
}
}
}
};
var updateDrProtectionGroupRequest = new Oci.DisasterrecoveryService.Requests.UpdateDrProtectionGroupRequest
{
UpdateDrProtectionGroupDetails = updateDrProtectionGroupDetails,
DrProtectionGroupId = "ocid1.test.oc1..<unique_ID>EXAMPLE-drProtectionGroupId-Value",
IfMatch = "EXAMPLE-ifMatch-Value",
OpcRequestId = "QEAGZOPTSCHBDLOTZPFE<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 DisasterRecoveryClient(provider, new ClientConfiguration()))
{
var response = await client.UpdateDrProtectionGroup(updateDrProtectionGroupRequest);
// Retrieve value from the response.
var versionValue = response.httpResponseMessage.Version;
}
}
catch (Exception e)
{
Console.WriteLine($"UpdateDrProtectionGroup Failed with {e.Message}");
throw e;
}
}
}
}