-
Notifications
You must be signed in to change notification settings - Fork 12
/
VolumeGroups_Create.go
81 lines (78 loc) · 4.4 KB
/
VolumeGroups_Create.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package armnetapp_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-09-01/examples/VolumeGroups_Create.json
func ExampleVolumeGroupsClient_BeginCreate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewVolumeGroupsClient().BeginCreate(ctx, "myRG", "account1", "group1", armnetapp.VolumeGroupDetails{
Location: to.Ptr("westus"),
Properties: &armnetapp.VolumeGroupProperties{
GroupMetaData: &armnetapp.VolumeGroupMetaData{
ApplicationIdentifier: to.Ptr("DEV"),
ApplicationType: to.Ptr(armnetapp.ApplicationTypeSAPHANA),
DeploymentSpecID: to.Ptr("20542149-bfca-5618-1879-9863dc6767f1"),
GroupDescription: to.Ptr("Volume group"),
},
Volumes: []*armnetapp.VolumeGroupVolumeProperties{
{
Name: to.Ptr("test-data-mnt00001"),
Properties: &armnetapp.VolumeProperties{
CapacityPoolResourceID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"),
CreationToken: to.Ptr("test-data-mnt00001"),
ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"),
ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium),
SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"),
ThroughputMibps: to.Ptr[float32](10),
UsageThreshold: to.Ptr[int64](107374182400),
VolumeSpecName: to.Ptr("data"),
},
},
{
Name: to.Ptr("test-log-mnt00001"),
Properties: &armnetapp.VolumeProperties{
CapacityPoolResourceID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"),
CreationToken: to.Ptr("test-log-mnt00001"),
ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"),
ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium),
SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"),
ThroughputMibps: to.Ptr[float32](10),
UsageThreshold: to.Ptr[int64](107374182400),
VolumeSpecName: to.Ptr("log"),
},
},
{
Name: to.Ptr("test-shared"),
Properties: &armnetapp.VolumeProperties{
CapacityPoolResourceID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"),
CreationToken: to.Ptr("test-shared"),
ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"),
ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium),
SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"),
ThroughputMibps: to.Ptr[float32](10),
UsageThreshold: to.Ptr[int64](107374182400),
VolumeSpecName: to.Ptr("shared"),
},
}},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}