From 11cd6ec3b06289663e9cd91bc01ba668a0666db3 Mon Sep 17 00:00:00 2001 From: Qiu Jian Date: Mon, 27 Nov 2023 01:24:40 +0800 Subject: [PATCH] fix: cloud account update aliyun billing scope --- pkg/mcclient/options/cloudaccounts.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/mcclient/options/cloudaccounts.go b/pkg/mcclient/options/cloudaccounts.go index 359633f333..85b540d84a 100644 --- a/pkg/mcclient/options/cloudaccounts.go +++ b/pkg/mcclient/options/cloudaccounts.go @@ -684,6 +684,8 @@ type SAliyunCloudAccountUpdateOptions struct { RemoveOptionsBillingBucketAccount bool `help:"remove id of account that can access bucket, blank if this account can access" json:"-"` OptionsBillingFilePrefix string `help:"update prefix of billing file name" json:"-"` RemoveOptionsBillingFilePrefix bool `help:"remove prefix of billing file name" json:"-"` + OptionsBillingScope string `help:"update billing scope" choices:"all|managed" json:"-"` + RemoveOptionsBillingScope bool `help:"remove billing scope" json:"-"` } func (opts *SAliyunCloudAccountUpdateOptions) Params() (jsonutils.JSONObject, error) { @@ -699,6 +701,9 @@ func (opts *SAliyunCloudAccountUpdateOptions) Params() (jsonutils.JSONObject, er if len(opts.OptionsBillingFilePrefix) > 0 { options.Add(jsonutils.NewString(opts.OptionsBillingFilePrefix), "billing_file_prefix") } + if len(opts.OptionsBillingScope) > 0 { + options.Add(jsonutils.NewString(opts.OptionsBillingScope), "billing_scope") + } if options.Size() > 0 { params.Add(options, "options") } @@ -712,6 +717,9 @@ func (opts *SAliyunCloudAccountUpdateOptions) Params() (jsonutils.JSONObject, er if opts.RemoveOptionsBillingFilePrefix { removeOptions = append(removeOptions, "billing_file_prefix") } + if opts.RemoveOptionsBillingScope { + removeOptions = append(removeOptions, "billing_scope") + } if len(removeOptions) > 0 { params.Add(jsonutils.NewStringArray(removeOptions), "remove_options") }