-
Notifications
You must be signed in to change notification settings - Fork 13
/
SBAliasFailOver.go
30 lines (27 loc) · 1.07 KB
/
SBAliasFailOver.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package armservicebus_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasFailOver.json
func ExampleDisasterRecoveryConfigsClient_FailOver() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
client, err := armservicebus.NewDisasterRecoveryConfigsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = client.FailOver(ctx,
"ardsouzatestRG",
"sdk-Namespace-8860",
"sdk-DisasterRecovery-3814",
&armservicebus.DisasterRecoveryConfigsClientFailOverOptions{Parameters: nil})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}