Categorygithub.com/hashicorp/go-azure-sdk/resource-managerrecoveryservicessiterecovery2023-01-01replicationprotecteditems
package
0.20240715.1103416
Repository: https://github.com/hashicorp/go-azure-sdk.git
Documentation: pkg.go.dev
# README
github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicessiterecovery/2023-01-01/replicationprotecteditems
Documentation
The replicationprotecteditems
SDK allows for interaction with the Azure Resource Manager Service recoveryservicessiterecovery
(API Version 2023-01-01
).
This readme covers example usages, but further information on using this SDK can be found in the project root.
Import Path
import "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicessiterecovery/2023-01-01/replicationprotecteditems"
Client Initialization
client := replicationprotecteditems.NewReplicationProtectedItemsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer
Example Usage: ReplicationProtectedItemsClient.AddDisks
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
payload := replicationprotecteditems.AddDisksInput{
// ...
}
if err := client.AddDisksThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.ApplyRecoveryPoint
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
payload := replicationprotecteditems.ApplyRecoveryPointInput{
// ...
}
if err := client.ApplyRecoveryPointThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.Create
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
payload := replicationprotecteditems.EnableProtectionInput{
// ...
}
if err := client.CreateThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.Delete
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
payload := replicationprotecteditems.DisableProtectionInput{
// ...
}
if err := client.DeleteThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.FailoverCancel
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
if err := client.FailoverCancelThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.FailoverCommit
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
if err := client.FailoverCommitThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.Get
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
read, err := client.Get(ctx, id)
if err != nil {
// handle the error
}
if model := read.Model; model != nil {
// do something with the model/response object
}
Example Usage: ReplicationProtectedItemsClient.List
ctx := context.TODO()
id := replicationprotecteditems.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue")
// alternatively `client.List(ctx, id, replicationprotecteditems.DefaultListOperationOptions())` can be used to do batched pagination
items, err := client.ListComplete(ctx, id, replicationprotecteditems.DefaultListOperationOptions())
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: ReplicationProtectedItemsClient.ListByReplicationProtectionContainers
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectionContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue")
// alternatively `client.ListByReplicationProtectionContainers(ctx, id)` can be used to do batched pagination
items, err := client.ListByReplicationProtectionContainersComplete(ctx, id)
if err != nil {
// handle the error
}
for _, item := range items {
// do something
}
Example Usage: ReplicationProtectedItemsClient.PlannedFailover
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
payload := replicationprotecteditems.PlannedFailoverInput{
// ...
}
if err := client.PlannedFailoverThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.Purge
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
if err := client.PurgeThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.RemoveDisks
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
payload := replicationprotecteditems.RemoveDisksInput{
// ...
}
if err := client.RemoveDisksThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.RepairReplication
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
if err := client.RepairReplicationThenPoll(ctx, id); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.Reprotect
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
payload := replicationprotecteditems.ReverseReplicationInput{
// ...
}
if err := client.ReprotectThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.ResolveHealthErrors
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
payload := replicationprotecteditems.ResolveHealthInput{
// ...
}
if err := client.ResolveHealthErrorsThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.SwitchProvider
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
payload := replicationprotecteditems.SwitchProviderInput{
// ...
}
if err := client.SwitchProviderThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.TestFailover
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
payload := replicationprotecteditems.TestFailoverInput{
// ...
}
if err := client.TestFailoverThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.TestFailoverCleanup
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
payload := replicationprotecteditems.TestFailoverCleanupInput{
// ...
}
if err := client.TestFailoverCleanupThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.UnplannedFailover
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
payload := replicationprotecteditems.UnplannedFailoverInput{
// ...
}
if err := client.UnplannedFailoverThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.Update
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
payload := replicationprotecteditems.UpdateReplicationProtectedItemInput{
// ...
}
if err := client.UpdateThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.UpdateAppliance
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
payload := replicationprotecteditems.UpdateApplianceForReplicationProtectedItemInput{
// ...
}
if err := client.UpdateApplianceThenPoll(ctx, id, payload); err != nil {
// handle the error
}
Example Usage: ReplicationProtectedItemsClient.UpdateMobilityService
ctx := context.TODO()
id := replicationprotecteditems.NewReplicationProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "replicationFabricValue", "replicationProtectionContainerValue", "replicationProtectedItemValue")
payload := replicationprotecteditems.UpdateMobilityServiceRequest{
// ...
}
if err := client.UpdateMobilityServiceThenPoll(ctx, id, payload); err != nil {
// handle the error
}