forked from Azure/acs-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
disk.go
27 lines (21 loc) · 825 Bytes
/
disk.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
package armhelpers
import (
"context"
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute"
)
// DeleteManagedDisk deletes a managed disk.
func (az *AzureClient) DeleteManagedDisk(ctx context.Context, resourceGroupName string, diskName string) error {
future, err := az.disksClient.Delete(ctx, resourceGroupName, diskName)
if err != nil {
return err
}
if err = future.WaitForCompletion(ctx, az.disksClient.Client); err != nil {
return err
}
_, err = future.Result(az.disksClient)
return err
}
// ListManagedDisksByResourceGroup lists managed disks in a resource group.
func (az *AzureClient) ListManagedDisksByResourceGroup(ctx context.Context, resourceGroupName string) (result compute.DiskListPage, err error) {
return az.disksClient.ListByResourceGroup(ctx, resourceGroupName)
}