Automatic merge from release/2.2.0 -> release/2.3.0

* commit '0f8f7e570ea1c99431a03193d55addef5f360830':
  add snapshot details
This commit is contained in:
李泽玺
2018-10-15 11:02:09 +08:00
7 changed files with 64 additions and 13 deletions
+6 -2
View File
@@ -208,12 +208,16 @@ func init() {
return nil
})
type DiskResetOptions struct {
DISK string `help:"ID or name of disk"`
SNAPSHOT string `help:"snapshots ID of disk`
DISK string `help:"ID or name of disk"`
SNAPSHOT string `help:"snapshots ID of disk`
AutoStart bool `help:"Autostart guest"`
}
R(&DiskResetOptions{}, "disk-reset", "Resize a disk", func(s *mcclient.ClientSession, args *DiskResetOptions) error {
params := jsonutils.NewDict()
params.Add(jsonutils.NewString(args.SNAPSHOT), "snapshot_id")
if args.AutoStart {
params.Add(jsonutils.JSONTrue, "auto_start")
}
disk, err := modules.Disks.PerformAction(s, args.DISK, "disk-reset", params)
if err != nil {
return err