Merge pull request #5096 from bistuzx/automated-cherry-pick-of-#5092-upstream-release-3.1

Automated cherry pick of #5092: update account bucket options
This commit is contained in:
yunion-ci-robot
2020-02-13 03:48:04 +08:00
committed by GitHub
2 changed files with 21 additions and 9 deletions
+15 -6
View File
@@ -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")
+6 -3
View File
@@ -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 {