forked from Azure/aks-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
disk.go
34 lines (27 loc) · 964 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
28
29
30
31
32
33
34
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
package azurestack
import (
"context"
"github.com/Azure/aks-engine/pkg/armhelpers"
)
// 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.WaitForCompletionRef(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 armhelpers.DiskListPage, err error) {
page, err := az.disksClient.ListByResourceGroup(ctx, resourceGroupName)
return &DiskListPageClient{
dlp: page,
err: err,
}, err
}