From 56a3d9c05d7a3f0972e229f8446f7c91361755c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=97=AD?= Date: Wed, 12 Feb 2020 16:59:30 +0800 Subject: [PATCH] update account bucket options --- cmd/climc/shell/cloudaccounts.go | 21 +++++++++++++++------ pkg/mcclient/options/cloudaccounts.go | 9 ++++++--- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/cmd/climc/shell/cloudaccounts.go b/cmd/climc/shell/cloudaccounts.go index 340187a267..1aa62ea1f9 100644 --- a/cmd/climc/shell/cloudaccounts.go +++ b/cmd/climc/shell/cloudaccounts.go @@ -99,6 +99,9 @@ func init() { if len(args.OptionsBillingBucketAccount) > 0 { options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account") } + if len(args.OptionsBillingFilePrefix) > 0 { + options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix") + } if options.Size() > 0 { params.(*jsonutils.JSONDict).Add(options, "options") } @@ -164,8 +167,8 @@ func init() { if len(args.OptionsBillingBucketAccount) > 0 { options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account") } - if len(args.OptionsBillingFileAccount) > 0 { - options.Add(jsonutils.NewString(args.OptionsBillingFileAccount), "billing_file_account") + if len(args.OptionsBillingFilePrefix) > 0 { + options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix") } if options.Size() > 0 { params.Add(options, "options") @@ -308,6 +311,9 @@ func init() { if len(args.OptionsBillingBucketAccount) > 0 { options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account") } + if len(args.OptionsBillingFilePrefix) > 0 { + options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix") + } if options.Size() > 0 { params.Add(options, "options") } @@ -318,6 +324,9 @@ func init() { if args.RemoveOptionsBillingBucketAccount { removeOptions = append(removeOptions, "billing_bucket_account") } + if args.RemoveOptionsBillingFilePrefix { + removeOptions = append(removeOptions, "billing_file_prefix") + } if len(removeOptions) > 0 { params.Add(jsonutils.NewStringArray(removeOptions), "remove_options") } @@ -382,8 +391,8 @@ func init() { if len(args.OptionsBillingBucketAccount) > 0 { options.Add(jsonutils.NewString(args.OptionsBillingBucketAccount), "billing_bucket_account") } - if len(args.OptionsBillingFileAccount) > 0 { - options.Add(jsonutils.NewString(args.OptionsBillingFileAccount), "billing_file_account") + if len(args.OptionsBillingFilePrefix) > 0 { + options.Add(jsonutils.NewString(args.OptionsBillingFilePrefix), "billing_file_prefix") } if options.Size() > 0 { params.Add(options, "options") @@ -395,8 +404,8 @@ func init() { if args.RemoveOptionsBillingBucketAccount { removeOptions = append(removeOptions, "billing_bucket_account") } - if args.RemoveOptionsBillingFileAccount { - removeOptions = append(removeOptions, "billing_file_account") + if args.RemoveOptionsBillingFilePrefix { + removeOptions = append(removeOptions, "billing_file_prefix") } if len(removeOptions) > 0 { params.Add(jsonutils.NewStringArray(removeOptions), "remove_options") diff --git a/pkg/mcclient/options/cloudaccounts.go b/pkg/mcclient/options/cloudaccounts.go index 487740afdf..acf3039d92 100644 --- a/pkg/mcclient/options/cloudaccounts.go +++ b/pkg/mcclient/options/cloudaccounts.go @@ -96,6 +96,7 @@ type SAliyunCloudAccountCreateOptions struct { OptionsBillingReportBucket string `help:"bucket that stores billing report" json:"-"` OptionsBillingBucketAccount string `help:"id of account that can access bucket, blank if this account can access" json:"-"` + OptionsBillingFilePrefix string `help:"prefix of billing file name" json:"-"` } type SAzureCloudAccountCreateOptions struct { @@ -119,7 +120,7 @@ type SAWSCloudAccountCreateOptions struct { OptionsBillingReportBucket string `help:"bucket that stores billing report" json:"-"` OptionsBillingBucketAccount string `help:"id of account that can access bucket, blank if this account can access" json:"-"` - OptionsBillingFileAccount string `help:"account number, prefix of billing file name, blank if this account number is prefix" json:"-"` + OptionsBillingFilePrefix string `help:"prefix of billing file name" json:"-"` } type SOpenStackCloudAccountCreateOptions struct { @@ -243,6 +244,8 @@ type SAliyunCloudAccountUpdateOptions struct { RemoveOptionsBillingReportBucket bool `help:"remove Aliyun S3 bucket that stores account billing report" json:"-"` OptionsBillingBucketAccount string `help:"update id of account that can access bucket, blank if this account can access" json:"-"` 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:"-"` } type SAzureCloudAccountUpdateOptions struct { @@ -263,8 +266,8 @@ type SAWSCloudAccountUpdateOptions struct { RemoveOptionsBillingReportBucket bool `help:"remove AWS S3 bucket that stores account billing report" json:"-"` OptionsBillingBucketAccount string `help:"update id of account that can access bucket, blank if this account can access" json:"-"` RemoveOptionsBillingBucketAccount bool `help:"remove id of account that can access bucket, blank if this account can access" json:"-"` - OptionsBillingFileAccount string `help:"update account number, prefix of billing file name, blank if this account number is prefix" json:"-"` - RemoveOptionsBillingFileAccount bool `help:"remove account number, prefix of billing file name, blank if this account number is prefix" json:"-"` + OptionsBillingFilePrefix string `help:"update prefix of billing file name" json:"-"` + RemoveOptionsBillingFilePrefix bool `help:"remove prefix of billing file name" json:"-"` } type SOpenStackCloudAccountUpdateOptions struct {