mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-11-05 15:31:49 +08:00
32 lines
700 B
Go
32 lines
700 B
Go
package shell
|
|
|
|
import (
|
|
"yunion.io/x/onecloud/pkg/util/huawei"
|
|
"yunion.io/x/onecloud/pkg/util/shellutils"
|
|
)
|
|
|
|
func init() {
|
|
type DiskListOptions struct {
|
|
Zone string `help:"Zone ID"`
|
|
}
|
|
shellutils.R(&DiskListOptions{}, "disk-list", "List disks", func(cli *huawei.SRegion, args *DiskListOptions) error {
|
|
disks, e := cli.GetDisks(args.Zone)
|
|
if e != nil {
|
|
return e
|
|
}
|
|
printList(disks, 0, 0, 0, nil)
|
|
return nil
|
|
})
|
|
|
|
type DiskDeleteOptions struct {
|
|
ID string `help:"Disk ID"`
|
|
}
|
|
shellutils.R(&DiskDeleteOptions{}, "disk-delete", "List disks", func(cli *huawei.SRegion, args *DiskDeleteOptions) error {
|
|
e := cli.DeleteDisk(args.ID)
|
|
if e != nil {
|
|
return e
|
|
}
|
|
return nil
|
|
})
|
|
}
|