mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(climc): support set bill report for azure account (#19449)
This commit is contained in:
@@ -749,6 +749,9 @@ type SAzureCloudAccountUpdateOptions struct {
|
||||
|
||||
OptionsBalanceKey string `help:"update cloud balance account key, such as Azure EA key" json:"-"`
|
||||
RemoveOptionsBalanceKey bool `help:"remove cloud blance account key" json:"-"`
|
||||
|
||||
OptionsBillingReportBucket string `help:"update Azure bucket that stores account billing report" json:"-"`
|
||||
RemoveOptionsBillingReportBucket bool `help:"remove Azure bucket that stores account billing report" json:"-"`
|
||||
}
|
||||
|
||||
func (opts *SAzureCloudAccountUpdateOptions) Params() (jsonutils.JSONObject, error) {
|
||||
@@ -758,6 +761,9 @@ func (opts *SAzureCloudAccountUpdateOptions) Params() (jsonutils.JSONObject, err
|
||||
if len(opts.OptionsBalanceKey) > 0 {
|
||||
options.Add(jsonutils.NewString(opts.OptionsBalanceKey), "balance_key")
|
||||
}
|
||||
if len(opts.OptionsBillingReportBucket) > 0 {
|
||||
options.Add(jsonutils.NewString(opts.OptionsBillingReportBucket), "billing_report_bucket")
|
||||
}
|
||||
if options.Size() > 0 {
|
||||
params.Add(options, "options")
|
||||
}
|
||||
@@ -765,6 +771,9 @@ func (opts *SAzureCloudAccountUpdateOptions) Params() (jsonutils.JSONObject, err
|
||||
if opts.RemoveOptionsBalanceKey {
|
||||
removeOptions = append(removeOptions, "balance_key")
|
||||
}
|
||||
if opts.RemoveOptionsBillingReportBucket {
|
||||
removeOptions = append(removeOptions, "billing_report_bucket")
|
||||
}
|
||||
if len(removeOptions) > 0 {
|
||||
params.Add(jsonutils.NewStringArray(removeOptions), "remove_options")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user