mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-08-31 01:35:56 +08:00
fix: qcloud rds set renew flag
This commit is contained in:
@@ -640,7 +640,10 @@ func (self *SRegion) ModifyMySQLAutoRenewFlag(ids []string, autoRenew bool) erro
|
||||
for idx, id := range ids {
|
||||
params[fmt.Sprintf("InstanceIds.%d", idx)] = id
|
||||
}
|
||||
params["AutoRenew"] = fmt.Sprintf("%v", autoRenew)
|
||||
params["AutoRenew"] = "0"
|
||||
if autoRenew {
|
||||
params["AutoRenew"] = "1"
|
||||
}
|
||||
_, err := self.cdbRequest("ModifyAutoRenewFlag", params)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -129,6 +129,15 @@ func init() {
|
||||
MONTH int `choices:"1|2|3|4|5|6|7|8|9|10|11|12|24|36"`
|
||||
}
|
||||
|
||||
type MySQLAutoRenewOptions struct {
|
||||
MySQLInstanceIdOptions
|
||||
AutoRenew bool
|
||||
}
|
||||
|
||||
shellutils.R(&MySQLAutoRenewOptions{}, "mysql-instance-set-auto-renew", "Set Auto Renew for mysql instance", func(cli *qcloud.SRegion, args *MySQLAutoRenewOptions) error {
|
||||
return cli.ModifyMySQLAutoRenewFlag([]string{args.ID}, args.AutoRenew)
|
||||
})
|
||||
|
||||
shellutils.R(&MySQLRenewOptions{}, "mysql-instance-renew", "Renew mysql instance", func(cli *qcloud.SRegion, args *MySQLRenewOptions) error {
|
||||
return cli.RenewMySQLDBInstance(args.ID, args.MONTH)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user