mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
增加climc zone-update-status命令
This commit is contained in:
@@ -126,4 +126,21 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type ZoneStatusOptions struct {
|
||||
ID string `help:"ID or name of zone"`
|
||||
STATUS string `help:"zone status" choices:"enable|disable|soldout"`
|
||||
REASON string `help:"why update status"`
|
||||
}
|
||||
R(&ZoneStatusOptions{}, "zone-update-status", "Update zone status", func(s *mcclient.ClientSession, args *ZoneStatusOptions) error {
|
||||
params := jsonutils.NewDict()
|
||||
params.Set("status", jsonutils.NewString(args.STATUS))
|
||||
params.Set("reason", jsonutils.NewString(args.REASON))
|
||||
result, err := modules.Zones.PerformAction(s, args.ID, "status", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user