tccli 3.0.1070.1__py2.py3-none-any.whl → 3.0.1072.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/examples/billing/v20180709/DescribeAllocateConditions.md +499 -0
  3. tccli/examples/billing/v20180709/DescribeAllocationBillConditions.md +495 -0
  4. tccli/examples/billing/v20180709/DescribeAllocationBillDetail.md +152 -0
  5. tccli/examples/billing/v20180709/DescribeAllocationMonthOverview.md +384 -0
  6. tccli/examples/billing/v20180709/DescribeAllocationOverview.md +102 -0
  7. tccli/examples/billing/v20180709/DescribeAllocationSummaryByBusiness.md +132 -0
  8. tccli/examples/billing/v20180709/DescribeAllocationSummaryByItem.md +96 -0
  9. tccli/examples/billing/v20180709/DescribeAllocationSummaryByResource.md +82 -0
  10. tccli/examples/billing/v20180709/DescribeAllocationTrendByMonth.md +60 -0
  11. tccli/examples/billing/v20180709/DescribeGatherResource.md +69 -0
  12. tccli/examples/cam/v20190116/GetCustomMFATokenInfo.md +2 -2
  13. tccli/examples/cam/v20190116/ListCollaborators.md +11 -10
  14. tccli/examples/cvm/v20170312/DescribeKeyPairs.md +1 -0
  15. tccli/examples/cvm/v20170312/InquiryPriceRenewInstances.md +3 -3
  16. tccli/examples/cvm/v20170312/InquiryPriceResetInstancesType.md +2 -40
  17. tccli/examples/dts/v20211206/DescribeSyncJobs.md +2 -0
  18. tccli/examples/ess/v20201111/CreateFlowApprovers.md +26 -0
  19. tccli/examples/ess/v20201111/CreateFlowByFiles.md +261 -0
  20. tccli/examples/ess/v20201111/DescribeFlowTemplates.md +6 -1
  21. tccli/examples/essbasic/v20210526/ChannelCreateFlowApprovers.md +34 -0
  22. tccli/examples/essbasic/v20210526/ChannelCreateFlowByFiles.md +257 -0
  23. tccli/examples/essbasic/v20210526/ChannelCreateReleaseFlow.md +35 -0
  24. tccli/examples/mariadb/v20170312/CreateAccount.md +1 -1
  25. tccli/examples/oceanus/v20190422/CreateJob.md +2 -1
  26. tccli/examples/postgres/v20170312/CreateBaseBackup.md +2 -2
  27. tccli/examples/postgres/v20170312/DeleteBaseBackup.md +1 -1
  28. tccli/examples/postgres/v20170312/DescribeBaseBackups.md +2 -2
  29. tccli/examples/postgres/v20170312/ModifyBaseBackupExpireTime.md +2 -2
  30. tccli/examples/sqlserver/v20180328/DescribeDBInstancesAttribute.md +8 -0
  31. tccli/examples/sqlserver/v20180328/ModifyDReadable.md +25 -0
  32. tccli/examples/tdmq/v20200217/DescribeRocketMQMsg.md +12 -12
  33. tccli/examples/tdmq/v20200217/DescribeRocketMQPublicAccessMonitorData.md +39 -0
  34. tccli/examples/teo/v20220901/CreateAccelerationDomain.md +1 -1
  35. tccli/examples/vpc/v20170312/DescribeVpnGateways.md +43 -65
  36. tccli/services/antiddos/v20200309/api.json +27 -16
  37. tccli/services/batch/v20170312/api.json +26 -26
  38. tccli/services/billing/billing_client.py +610 -80
  39. tccli/services/billing/v20180709/api.json +9519 -4207
  40. tccli/services/billing/v20180709/examples.json +80 -0
  41. tccli/services/cam/v20190116/api.json +35 -30
  42. tccli/services/cam/v20190116/examples.json +3 -3
  43. tccli/services/cdwdoris/v20211228/api.json +20 -0
  44. tccli/services/cvm/v20170312/api.json +81 -78
  45. tccli/services/cvm/v20170312/examples.json +9 -9
  46. tccli/services/dcdb/v20180411/api.json +25 -25
  47. tccli/services/dts/v20211206/api.json +53 -11
  48. tccli/services/dts/v20211206/examples.json +1 -1
  49. tccli/services/ess/v20201111/api.json +72 -4
  50. tccli/services/ess/v20201111/examples.json +13 -1
  51. tccli/services/essbasic/v20210526/api.json +20 -2
  52. tccli/services/essbasic/v20210526/examples.json +18 -0
  53. tccli/services/goosefs/v20220519/api.json +9 -0
  54. tccli/services/lighthouse/v20200324/api.json +61 -0
  55. tccli/services/mariadb/v20170312/api.json +36 -36
  56. tccli/services/mariadb/v20170312/examples.json +1 -1
  57. tccli/services/mrs/v20200910/api.json +18 -0
  58. tccli/services/oceanus/v20190422/api.json +28 -0
  59. tccli/services/oceanus/v20190422/examples.json +1 -1
  60. tccli/services/postgres/v20170312/api.json +79 -74
  61. tccli/services/postgres/v20170312/examples.json +7 -7
  62. tccli/services/rce/v20201103/api.json +25 -25
  63. tccli/services/sqlserver/sqlserver_client.py +53 -0
  64. tccli/services/sqlserver/v20180328/api.json +237 -34
  65. tccli/services/sqlserver/v20180328/examples.json +9 -1
  66. tccli/services/tdmq/tdmq_client.py +110 -57
  67. tccli/services/tdmq/v20200217/api.json +222 -4
  68. tccli/services/tdmq/v20200217/examples.json +10 -2
  69. tccli/services/teo/v20220901/api.json +1 -1
  70. tccli/services/teo/v20220901/examples.json +1 -1
  71. tccli/services/trtc/v20190722/api.json +4 -4
  72. tccli/services/vpc/v20170312/api.json +32 -24
  73. tccli/services/vpc/v20170312/examples.json +7 -7
  74. {tccli-3.0.1070.1.dist-info → tccli-3.0.1072.1.dist-info}/METADATA +2 -2
  75. {tccli-3.0.1070.1.dist-info → tccli-3.0.1072.1.dist-info}/RECORD +78 -66
  76. {tccli-3.0.1070.1.dist-info → tccli-3.0.1072.1.dist-info}/WHEEL +0 -0
  77. {tccli-3.0.1070.1.dist-info → tccli-3.0.1072.1.dist-info}/entry_points.txt +0 -0
  78. {tccli-3.0.1070.1.dist-info → tccli-3.0.1072.1.dist-info}/license_files/LICENSE +0 -0
@@ -17,6 +17,58 @@ from tencentcloud.billing.v20180709 import models as models_v20180709
17
17
  from jmespath import search
18
18
  import time
19
19
 
20
+ def doDescribeAllocationBillConditions(args, parsed_globals):
21
+ g_param = parse_global_arg(parsed_globals)
22
+
23
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
24
+ cred = credential.CVMRoleCredential()
25
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
26
+ cred = credential.STSAssumeRoleCredential(
27
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
28
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
29
+ )
30
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
31
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
32
+ else:
33
+ cred = credential.Credential(
34
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
35
+ )
36
+ http_profile = HttpProfile(
37
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
38
+ reqMethod="POST",
39
+ endpoint=g_param[OptionsDefine.Endpoint],
40
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
41
+ )
42
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
43
+ if g_param[OptionsDefine.Language]:
44
+ profile.language = g_param[OptionsDefine.Language]
45
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
46
+ client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
47
+ client._sdkVersion += ("_CLI_" + __version__)
48
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
49
+ model = models.DescribeAllocationBillConditionsRequest()
50
+ model.from_json_string(json.dumps(args))
51
+ start_time = time.time()
52
+ while True:
53
+ rsp = client.DescribeAllocationBillConditions(model)
54
+ result = rsp.to_json_string()
55
+ try:
56
+ json_obj = json.loads(result)
57
+ except TypeError as e:
58
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
59
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
60
+ break
61
+ cur_time = time.time()
62
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
63
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
64
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
65
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
66
+ else:
67
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
68
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
69
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
70
+
71
+
20
72
  def doDescribeCostSummaryByResource(args, parsed_globals):
21
73
  g_param = parse_global_arg(parsed_globals)
22
74
 
@@ -46,11 +98,375 @@ def doDescribeCostSummaryByResource(args, parsed_globals):
46
98
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
47
99
  client._sdkVersion += ("_CLI_" + __version__)
48
100
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
49
- model = models.DescribeCostSummaryByResourceRequest()
101
+ model = models.DescribeCostSummaryByResourceRequest()
102
+ model.from_json_string(json.dumps(args))
103
+ start_time = time.time()
104
+ while True:
105
+ rsp = client.DescribeCostSummaryByResource(model)
106
+ result = rsp.to_json_string()
107
+ try:
108
+ json_obj = json.loads(result)
109
+ except TypeError as e:
110
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
111
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
112
+ break
113
+ cur_time = time.time()
114
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
115
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
116
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
117
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
118
+ else:
119
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
120
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
121
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
122
+
123
+
124
+ def doDescribeBillList(args, parsed_globals):
125
+ g_param = parse_global_arg(parsed_globals)
126
+
127
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
128
+ cred = credential.CVMRoleCredential()
129
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
130
+ cred = credential.STSAssumeRoleCredential(
131
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
132
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
133
+ )
134
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
135
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
136
+ else:
137
+ cred = credential.Credential(
138
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
139
+ )
140
+ http_profile = HttpProfile(
141
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
142
+ reqMethod="POST",
143
+ endpoint=g_param[OptionsDefine.Endpoint],
144
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
145
+ )
146
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
147
+ if g_param[OptionsDefine.Language]:
148
+ profile.language = g_param[OptionsDefine.Language]
149
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
150
+ client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
151
+ client._sdkVersion += ("_CLI_" + __version__)
152
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
153
+ model = models.DescribeBillListRequest()
154
+ model.from_json_string(json.dumps(args))
155
+ start_time = time.time()
156
+ while True:
157
+ rsp = client.DescribeBillList(model)
158
+ result = rsp.to_json_string()
159
+ try:
160
+ json_obj = json.loads(result)
161
+ except TypeError as e:
162
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
163
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
164
+ break
165
+ cur_time = time.time()
166
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
167
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
168
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
169
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
170
+ else:
171
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
172
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
173
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
174
+
175
+
176
+ def doDescribeDealsByCond(args, parsed_globals):
177
+ g_param = parse_global_arg(parsed_globals)
178
+
179
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
180
+ cred = credential.CVMRoleCredential()
181
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
182
+ cred = credential.STSAssumeRoleCredential(
183
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
184
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
185
+ )
186
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
187
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
188
+ else:
189
+ cred = credential.Credential(
190
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
191
+ )
192
+ http_profile = HttpProfile(
193
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
194
+ reqMethod="POST",
195
+ endpoint=g_param[OptionsDefine.Endpoint],
196
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
197
+ )
198
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
199
+ if g_param[OptionsDefine.Language]:
200
+ profile.language = g_param[OptionsDefine.Language]
201
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
202
+ client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
203
+ client._sdkVersion += ("_CLI_" + __version__)
204
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
205
+ model = models.DescribeDealsByCondRequest()
206
+ model.from_json_string(json.dumps(args))
207
+ start_time = time.time()
208
+ while True:
209
+ rsp = client.DescribeDealsByCond(model)
210
+ result = rsp.to_json_string()
211
+ try:
212
+ json_obj = json.loads(result)
213
+ except TypeError as e:
214
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
215
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
216
+ break
217
+ cur_time = time.time()
218
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
219
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
220
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
221
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
222
+ else:
223
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
224
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
225
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
226
+
227
+
228
+ def doDescribeAllocationSummaryByResource(args, parsed_globals):
229
+ g_param = parse_global_arg(parsed_globals)
230
+
231
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
232
+ cred = credential.CVMRoleCredential()
233
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
234
+ cred = credential.STSAssumeRoleCredential(
235
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
236
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
237
+ )
238
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
239
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
240
+ else:
241
+ cred = credential.Credential(
242
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
243
+ )
244
+ http_profile = HttpProfile(
245
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
246
+ reqMethod="POST",
247
+ endpoint=g_param[OptionsDefine.Endpoint],
248
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
249
+ )
250
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
251
+ if g_param[OptionsDefine.Language]:
252
+ profile.language = g_param[OptionsDefine.Language]
253
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
254
+ client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
255
+ client._sdkVersion += ("_CLI_" + __version__)
256
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
257
+ model = models.DescribeAllocationSummaryByResourceRequest()
258
+ model.from_json_string(json.dumps(args))
259
+ start_time = time.time()
260
+ while True:
261
+ rsp = client.DescribeAllocationSummaryByResource(model)
262
+ result = rsp.to_json_string()
263
+ try:
264
+ json_obj = json.loads(result)
265
+ except TypeError as e:
266
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
267
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
268
+ break
269
+ cur_time = time.time()
270
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
271
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
272
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
273
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
274
+ else:
275
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
276
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
277
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
278
+
279
+
280
+ def doDescribeBillResourceSummary(args, parsed_globals):
281
+ g_param = parse_global_arg(parsed_globals)
282
+
283
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
284
+ cred = credential.CVMRoleCredential()
285
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
286
+ cred = credential.STSAssumeRoleCredential(
287
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
288
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
289
+ )
290
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
291
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
292
+ else:
293
+ cred = credential.Credential(
294
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
295
+ )
296
+ http_profile = HttpProfile(
297
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
298
+ reqMethod="POST",
299
+ endpoint=g_param[OptionsDefine.Endpoint],
300
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
301
+ )
302
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
303
+ if g_param[OptionsDefine.Language]:
304
+ profile.language = g_param[OptionsDefine.Language]
305
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
306
+ client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
307
+ client._sdkVersion += ("_CLI_" + __version__)
308
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
309
+ model = models.DescribeBillResourceSummaryRequest()
310
+ model.from_json_string(json.dumps(args))
311
+ start_time = time.time()
312
+ while True:
313
+ rsp = client.DescribeBillResourceSummary(model)
314
+ result = rsp.to_json_string()
315
+ try:
316
+ json_obj = json.loads(result)
317
+ except TypeError as e:
318
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
319
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
320
+ break
321
+ cur_time = time.time()
322
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
323
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
324
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
325
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
326
+ else:
327
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
328
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
329
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
330
+
331
+
332
+ def doDescribeAllocationSummaryByBusiness(args, parsed_globals):
333
+ g_param = parse_global_arg(parsed_globals)
334
+
335
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
336
+ cred = credential.CVMRoleCredential()
337
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
338
+ cred = credential.STSAssumeRoleCredential(
339
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
340
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
341
+ )
342
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
343
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
344
+ else:
345
+ cred = credential.Credential(
346
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
347
+ )
348
+ http_profile = HttpProfile(
349
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
350
+ reqMethod="POST",
351
+ endpoint=g_param[OptionsDefine.Endpoint],
352
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
353
+ )
354
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
355
+ if g_param[OptionsDefine.Language]:
356
+ profile.language = g_param[OptionsDefine.Language]
357
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
358
+ client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
359
+ client._sdkVersion += ("_CLI_" + __version__)
360
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
361
+ model = models.DescribeAllocationSummaryByBusinessRequest()
362
+ model.from_json_string(json.dumps(args))
363
+ start_time = time.time()
364
+ while True:
365
+ rsp = client.DescribeAllocationSummaryByBusiness(model)
366
+ result = rsp.to_json_string()
367
+ try:
368
+ json_obj = json.loads(result)
369
+ except TypeError as e:
370
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
371
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
372
+ break
373
+ cur_time = time.time()
374
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
375
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
376
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
377
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
378
+ else:
379
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
380
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
381
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
382
+
383
+
384
+ def doDescribeAllocateConditions(args, parsed_globals):
385
+ g_param = parse_global_arg(parsed_globals)
386
+
387
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
388
+ cred = credential.CVMRoleCredential()
389
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
390
+ cred = credential.STSAssumeRoleCredential(
391
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
392
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
393
+ )
394
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
395
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
396
+ else:
397
+ cred = credential.Credential(
398
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
399
+ )
400
+ http_profile = HttpProfile(
401
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
402
+ reqMethod="POST",
403
+ endpoint=g_param[OptionsDefine.Endpoint],
404
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
405
+ )
406
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
407
+ if g_param[OptionsDefine.Language]:
408
+ profile.language = g_param[OptionsDefine.Language]
409
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
410
+ client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
411
+ client._sdkVersion += ("_CLI_" + __version__)
412
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
413
+ model = models.DescribeAllocateConditionsRequest()
414
+ model.from_json_string(json.dumps(args))
415
+ start_time = time.time()
416
+ while True:
417
+ rsp = client.DescribeAllocateConditions(model)
418
+ result = rsp.to_json_string()
419
+ try:
420
+ json_obj = json.loads(result)
421
+ except TypeError as e:
422
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
423
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
424
+ break
425
+ cur_time = time.time()
426
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
427
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
428
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
429
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
430
+ else:
431
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
432
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
433
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
434
+
435
+
436
+ def doDescribeSavingPlanOverview(args, parsed_globals):
437
+ g_param = parse_global_arg(parsed_globals)
438
+
439
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
440
+ cred = credential.CVMRoleCredential()
441
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
442
+ cred = credential.STSAssumeRoleCredential(
443
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
444
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
445
+ )
446
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
447
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
448
+ else:
449
+ cred = credential.Credential(
450
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
451
+ )
452
+ http_profile = HttpProfile(
453
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
454
+ reqMethod="POST",
455
+ endpoint=g_param[OptionsDefine.Endpoint],
456
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
457
+ )
458
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
459
+ if g_param[OptionsDefine.Language]:
460
+ profile.language = g_param[OptionsDefine.Language]
461
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
462
+ client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
463
+ client._sdkVersion += ("_CLI_" + __version__)
464
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
465
+ model = models.DescribeSavingPlanOverviewRequest()
50
466
  model.from_json_string(json.dumps(args))
51
467
  start_time = time.time()
52
468
  while True:
53
- rsp = client.DescribeCostSummaryByResource(model)
469
+ rsp = client.DescribeSavingPlanOverview(model)
54
470
  result = rsp.to_json_string()
55
471
  try:
56
472
  json_obj = json.loads(result)
@@ -69,7 +485,7 @@ def doDescribeCostSummaryByResource(args, parsed_globals):
69
485
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
70
486
 
71
487
 
72
- def doDescribeCostSummaryByRegion(args, parsed_globals):
488
+ def doDescribeAllocationOverview(args, parsed_globals):
73
489
  g_param = parse_global_arg(parsed_globals)
74
490
 
75
491
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -98,11 +514,11 @@ def doDescribeCostSummaryByRegion(args, parsed_globals):
98
514
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
99
515
  client._sdkVersion += ("_CLI_" + __version__)
100
516
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
101
- model = models.DescribeCostSummaryByRegionRequest()
517
+ model = models.DescribeAllocationOverviewRequest()
102
518
  model.from_json_string(json.dumps(args))
103
519
  start_time = time.time()
104
520
  while True:
105
- rsp = client.DescribeCostSummaryByRegion(model)
521
+ rsp = client.DescribeAllocationOverview(model)
106
522
  result = rsp.to_json_string()
107
523
  try:
108
524
  json_obj = json.loads(result)
@@ -121,7 +537,7 @@ def doDescribeCostSummaryByRegion(args, parsed_globals):
121
537
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
122
538
 
123
539
 
124
- def doDescribeDealsByCond(args, parsed_globals):
540
+ def doDescribeDosageDetailList(args, parsed_globals):
125
541
  g_param = parse_global_arg(parsed_globals)
126
542
 
127
543
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -150,11 +566,11 @@ def doDescribeDealsByCond(args, parsed_globals):
150
566
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
151
567
  client._sdkVersion += ("_CLI_" + __version__)
152
568
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
153
- model = models.DescribeDealsByCondRequest()
569
+ model = models.DescribeDosageDetailListRequest()
154
570
  model.from_json_string(json.dumps(args))
155
571
  start_time = time.time()
156
572
  while True:
157
- rsp = client.DescribeDealsByCond(model)
573
+ rsp = client.DescribeDosageDetailList(model)
158
574
  result = rsp.to_json_string()
159
575
  try:
160
576
  json_obj = json.loads(result)
@@ -173,7 +589,7 @@ def doDescribeDealsByCond(args, parsed_globals):
173
589
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
174
590
 
175
591
 
176
- def doDescribeBillResourceSummary(args, parsed_globals):
592
+ def doCreateAllocationTag(args, parsed_globals):
177
593
  g_param = parse_global_arg(parsed_globals)
178
594
 
179
595
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -202,11 +618,11 @@ def doDescribeBillResourceSummary(args, parsed_globals):
202
618
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
203
619
  client._sdkVersion += ("_CLI_" + __version__)
204
620
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
205
- model = models.DescribeBillResourceSummaryRequest()
621
+ model = models.CreateAllocationTagRequest()
206
622
  model.from_json_string(json.dumps(args))
207
623
  start_time = time.time()
208
624
  while True:
209
- rsp = client.DescribeBillResourceSummary(model)
625
+ rsp = client.CreateAllocationTag(model)
210
626
  result = rsp.to_json_string()
211
627
  try:
212
628
  json_obj = json.loads(result)
@@ -225,7 +641,7 @@ def doDescribeBillResourceSummary(args, parsed_globals):
225
641
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
226
642
 
227
643
 
228
- def doDescribeSavingPlanOverview(args, parsed_globals):
644
+ def doPayDeals(args, parsed_globals):
229
645
  g_param = parse_global_arg(parsed_globals)
230
646
 
231
647
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -254,11 +670,11 @@ def doDescribeSavingPlanOverview(args, parsed_globals):
254
670
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
255
671
  client._sdkVersion += ("_CLI_" + __version__)
256
672
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
257
- model = models.DescribeSavingPlanOverviewRequest()
673
+ model = models.PayDealsRequest()
258
674
  model.from_json_string(json.dumps(args))
259
675
  start_time = time.time()
260
676
  while True:
261
- rsp = client.DescribeSavingPlanOverview(model)
677
+ rsp = client.PayDeals(model)
262
678
  result = rsp.to_json_string()
263
679
  try:
264
680
  json_obj = json.loads(result)
@@ -277,7 +693,7 @@ def doDescribeSavingPlanOverview(args, parsed_globals):
277
693
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
278
694
 
279
695
 
280
- def doDescribeDosageDetailList(args, parsed_globals):
696
+ def doDescribeCostSummaryByProject(args, parsed_globals):
281
697
  g_param = parse_global_arg(parsed_globals)
282
698
 
283
699
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -306,11 +722,11 @@ def doDescribeDosageDetailList(args, parsed_globals):
306
722
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
307
723
  client._sdkVersion += ("_CLI_" + __version__)
308
724
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
309
- model = models.DescribeDosageDetailListRequest()
725
+ model = models.DescribeCostSummaryByProjectRequest()
310
726
  model.from_json_string(json.dumps(args))
311
727
  start_time = time.time()
312
728
  while True:
313
- rsp = client.DescribeDosageDetailList(model)
729
+ rsp = client.DescribeCostSummaryByProject(model)
314
730
  result = rsp.to_json_string()
315
731
  try:
316
732
  json_obj = json.loads(result)
@@ -329,7 +745,7 @@ def doDescribeDosageDetailList(args, parsed_globals):
329
745
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
330
746
 
331
747
 
332
- def doCreateAllocationTag(args, parsed_globals):
748
+ def doDescribeVoucherInfo(args, parsed_globals):
333
749
  g_param = parse_global_arg(parsed_globals)
334
750
 
335
751
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -358,11 +774,11 @@ def doCreateAllocationTag(args, parsed_globals):
358
774
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
359
775
  client._sdkVersion += ("_CLI_" + __version__)
360
776
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
361
- model = models.CreateAllocationTagRequest()
777
+ model = models.DescribeVoucherInfoRequest()
362
778
  model.from_json_string(json.dumps(args))
363
779
  start_time = time.time()
364
780
  while True:
365
- rsp = client.CreateAllocationTag(model)
781
+ rsp = client.DescribeVoucherInfo(model)
366
782
  result = rsp.to_json_string()
367
783
  try:
368
784
  json_obj = json.loads(result)
@@ -381,7 +797,7 @@ def doCreateAllocationTag(args, parsed_globals):
381
797
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
382
798
 
383
799
 
384
- def doPayDeals(args, parsed_globals):
800
+ def doDescribeBillResourceSummaryForOrganization(args, parsed_globals):
385
801
  g_param = parse_global_arg(parsed_globals)
386
802
 
387
803
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -410,11 +826,11 @@ def doPayDeals(args, parsed_globals):
410
826
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
411
827
  client._sdkVersion += ("_CLI_" + __version__)
412
828
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
413
- model = models.PayDealsRequest()
829
+ model = models.DescribeBillResourceSummaryForOrganizationRequest()
414
830
  model.from_json_string(json.dumps(args))
415
831
  start_time = time.time()
416
832
  while True:
417
- rsp = client.PayDeals(model)
833
+ rsp = client.DescribeBillResourceSummaryForOrganization(model)
418
834
  result = rsp.to_json_string()
419
835
  try:
420
836
  json_obj = json.loads(result)
@@ -433,7 +849,7 @@ def doPayDeals(args, parsed_globals):
433
849
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
434
850
 
435
851
 
436
- def doDescribeCostSummaryByProject(args, parsed_globals):
852
+ def doDescribeBillDetail(args, parsed_globals):
437
853
  g_param = parse_global_arg(parsed_globals)
438
854
 
439
855
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -462,11 +878,11 @@ def doDescribeCostSummaryByProject(args, parsed_globals):
462
878
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
463
879
  client._sdkVersion += ("_CLI_" + __version__)
464
880
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
465
- model = models.DescribeCostSummaryByProjectRequest()
881
+ model = models.DescribeBillDetailRequest()
466
882
  model.from_json_string(json.dumps(args))
467
883
  start_time = time.time()
468
884
  while True:
469
- rsp = client.DescribeCostSummaryByProject(model)
885
+ rsp = client.DescribeBillDetail(model)
470
886
  result = rsp.to_json_string()
471
887
  try:
472
888
  json_obj = json.loads(result)
@@ -485,7 +901,7 @@ def doDescribeCostSummaryByProject(args, parsed_globals):
485
901
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
486
902
 
487
903
 
488
- def doDescribeVoucherInfo(args, parsed_globals):
904
+ def doDescribeBillSummary(args, parsed_globals):
489
905
  g_param = parse_global_arg(parsed_globals)
490
906
 
491
907
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -514,11 +930,11 @@ def doDescribeVoucherInfo(args, parsed_globals):
514
930
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
515
931
  client._sdkVersion += ("_CLI_" + __version__)
516
932
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
517
- model = models.DescribeVoucherInfoRequest()
933
+ model = models.DescribeBillSummaryRequest()
518
934
  model.from_json_string(json.dumps(args))
519
935
  start_time = time.time()
520
936
  while True:
521
- rsp = client.DescribeVoucherInfo(model)
937
+ rsp = client.DescribeBillSummary(model)
522
938
  result = rsp.to_json_string()
523
939
  try:
524
940
  json_obj = json.loads(result)
@@ -537,7 +953,7 @@ def doDescribeVoucherInfo(args, parsed_globals):
537
953
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
538
954
 
539
955
 
540
- def doDescribeBillResourceSummaryForOrganization(args, parsed_globals):
956
+ def doDescribeBillSummaryByPayMode(args, parsed_globals):
541
957
  g_param = parse_global_arg(parsed_globals)
542
958
 
543
959
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -566,11 +982,11 @@ def doDescribeBillResourceSummaryForOrganization(args, parsed_globals):
566
982
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
567
983
  client._sdkVersion += ("_CLI_" + __version__)
568
984
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
569
- model = models.DescribeBillResourceSummaryForOrganizationRequest()
985
+ model = models.DescribeBillSummaryByPayModeRequest()
570
986
  model.from_json_string(json.dumps(args))
571
987
  start_time = time.time()
572
988
  while True:
573
- rsp = client.DescribeBillResourceSummaryForOrganization(model)
989
+ rsp = client.DescribeBillSummaryByPayMode(model)
574
990
  result = rsp.to_json_string()
575
991
  try:
576
992
  json_obj = json.loads(result)
@@ -589,7 +1005,7 @@ def doDescribeBillResourceSummaryForOrganization(args, parsed_globals):
589
1005
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
590
1006
 
591
1007
 
592
- def doDescribeBillDetail(args, parsed_globals):
1008
+ def doDescribeCostSummaryByRegion(args, parsed_globals):
593
1009
  g_param = parse_global_arg(parsed_globals)
594
1010
 
595
1011
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -618,11 +1034,11 @@ def doDescribeBillDetail(args, parsed_globals):
618
1034
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
619
1035
  client._sdkVersion += ("_CLI_" + __version__)
620
1036
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
621
- model = models.DescribeBillDetailRequest()
1037
+ model = models.DescribeCostSummaryByRegionRequest()
622
1038
  model.from_json_string(json.dumps(args))
623
1039
  start_time = time.time()
624
1040
  while True:
625
- rsp = client.DescribeBillDetail(model)
1041
+ rsp = client.DescribeCostSummaryByRegion(model)
626
1042
  result = rsp.to_json_string()
627
1043
  try:
628
1044
  json_obj = json.loads(result)
@@ -641,7 +1057,7 @@ def doDescribeBillDetail(args, parsed_globals):
641
1057
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
642
1058
 
643
1059
 
644
- def doDescribeBillSummary(args, parsed_globals):
1060
+ def doDescribeAllocationTrendByMonth(args, parsed_globals):
645
1061
  g_param = parse_global_arg(parsed_globals)
646
1062
 
647
1063
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -670,11 +1086,11 @@ def doDescribeBillSummary(args, parsed_globals):
670
1086
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
671
1087
  client._sdkVersion += ("_CLI_" + __version__)
672
1088
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
673
- model = models.DescribeBillSummaryRequest()
1089
+ model = models.DescribeAllocationTrendByMonthRequest()
674
1090
  model.from_json_string(json.dumps(args))
675
1091
  start_time = time.time()
676
1092
  while True:
677
- rsp = client.DescribeBillSummary(model)
1093
+ rsp = client.DescribeAllocationTrendByMonth(model)
678
1094
  result = rsp.to_json_string()
679
1095
  try:
680
1096
  json_obj = json.loads(result)
@@ -693,7 +1109,7 @@ def doDescribeBillSummary(args, parsed_globals):
693
1109
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
694
1110
 
695
1111
 
696
- def doDescribeBillSummaryByPayMode(args, parsed_globals):
1112
+ def doDescribeBillDownloadUrl(args, parsed_globals):
697
1113
  g_param = parse_global_arg(parsed_globals)
698
1114
 
699
1115
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -722,11 +1138,11 @@ def doDescribeBillSummaryByPayMode(args, parsed_globals):
722
1138
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
723
1139
  client._sdkVersion += ("_CLI_" + __version__)
724
1140
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
725
- model = models.DescribeBillSummaryByPayModeRequest()
1141
+ model = models.DescribeBillDownloadUrlRequest()
726
1142
  model.from_json_string(json.dumps(args))
727
1143
  start_time = time.time()
728
1144
  while True:
729
- rsp = client.DescribeBillSummaryByPayMode(model)
1145
+ rsp = client.DescribeBillDownloadUrl(model)
730
1146
  result = rsp.to_json_string()
731
1147
  try:
732
1148
  json_obj = json.loads(result)
@@ -745,7 +1161,7 @@ def doDescribeBillSummaryByPayMode(args, parsed_globals):
745
1161
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
746
1162
 
747
1163
 
748
- def doDescribeBillList(args, parsed_globals):
1164
+ def doDescribeDosageCosDetailByDate(args, parsed_globals):
749
1165
  g_param = parse_global_arg(parsed_globals)
750
1166
 
751
1167
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -774,11 +1190,11 @@ def doDescribeBillList(args, parsed_globals):
774
1190
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
775
1191
  client._sdkVersion += ("_CLI_" + __version__)
776
1192
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
777
- model = models.DescribeBillListRequest()
1193
+ model = models.DescribeDosageCosDetailByDateRequest()
778
1194
  model.from_json_string(json.dumps(args))
779
1195
  start_time = time.time()
780
1196
  while True:
781
- rsp = client.DescribeBillList(model)
1197
+ rsp = client.DescribeDosageCosDetailByDate(model)
782
1198
  result = rsp.to_json_string()
783
1199
  try:
784
1200
  json_obj = json.loads(result)
@@ -797,7 +1213,7 @@ def doDescribeBillList(args, parsed_globals):
797
1213
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
798
1214
 
799
1215
 
800
- def doDescribeBillDownloadUrl(args, parsed_globals):
1216
+ def doDescribeBillDetailForOrganization(args, parsed_globals):
801
1217
  g_param = parse_global_arg(parsed_globals)
802
1218
 
803
1219
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -826,11 +1242,11 @@ def doDescribeBillDownloadUrl(args, parsed_globals):
826
1242
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
827
1243
  client._sdkVersion += ("_CLI_" + __version__)
828
1244
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
829
- model = models.DescribeBillDownloadUrlRequest()
1245
+ model = models.DescribeBillDetailForOrganizationRequest()
830
1246
  model.from_json_string(json.dumps(args))
831
1247
  start_time = time.time()
832
1248
  while True:
833
- rsp = client.DescribeBillDownloadUrl(model)
1249
+ rsp = client.DescribeBillDetailForOrganization(model)
834
1250
  result = rsp.to_json_string()
835
1251
  try:
836
1252
  json_obj = json.loads(result)
@@ -849,7 +1265,7 @@ def doDescribeBillDownloadUrl(args, parsed_globals):
849
1265
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
850
1266
 
851
1267
 
852
- def doDescribeDosageCosDetailByDate(args, parsed_globals):
1268
+ def doDescribeAccountBalance(args, parsed_globals):
853
1269
  g_param = parse_global_arg(parsed_globals)
854
1270
 
855
1271
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -878,11 +1294,11 @@ def doDescribeDosageCosDetailByDate(args, parsed_globals):
878
1294
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
879
1295
  client._sdkVersion += ("_CLI_" + __version__)
880
1296
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
881
- model = models.DescribeDosageCosDetailByDateRequest()
1297
+ model = models.DescribeAccountBalanceRequest()
882
1298
  model.from_json_string(json.dumps(args))
883
1299
  start_time = time.time()
884
1300
  while True:
885
- rsp = client.DescribeDosageCosDetailByDate(model)
1301
+ rsp = client.DescribeAccountBalance(model)
886
1302
  result = rsp.to_json_string()
887
1303
  try:
888
1304
  json_obj = json.loads(result)
@@ -901,7 +1317,7 @@ def doDescribeDosageCosDetailByDate(args, parsed_globals):
901
1317
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
902
1318
 
903
1319
 
904
- def doDescribeBillDetailForOrganization(args, parsed_globals):
1320
+ def doDescribeDosageDetailByDate(args, parsed_globals):
905
1321
  g_param = parse_global_arg(parsed_globals)
906
1322
 
907
1323
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -930,11 +1346,11 @@ def doDescribeBillDetailForOrganization(args, parsed_globals):
930
1346
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
931
1347
  client._sdkVersion += ("_CLI_" + __version__)
932
1348
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
933
- model = models.DescribeBillDetailForOrganizationRequest()
1349
+ model = models.DescribeDosageDetailByDateRequest()
934
1350
  model.from_json_string(json.dumps(args))
935
1351
  start_time = time.time()
936
1352
  while True:
937
- rsp = client.DescribeBillDetailForOrganization(model)
1353
+ rsp = client.DescribeDosageDetailByDate(model)
938
1354
  result = rsp.to_json_string()
939
1355
  try:
940
1356
  json_obj = json.loads(result)
@@ -953,7 +1369,7 @@ def doDescribeBillDetailForOrganization(args, parsed_globals):
953
1369
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
954
1370
 
955
1371
 
956
- def doDescribeAccountBalance(args, parsed_globals):
1372
+ def doDescribeSavingPlanUsage(args, parsed_globals):
957
1373
  g_param = parse_global_arg(parsed_globals)
958
1374
 
959
1375
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -982,11 +1398,11 @@ def doDescribeAccountBalance(args, parsed_globals):
982
1398
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
983
1399
  client._sdkVersion += ("_CLI_" + __version__)
984
1400
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
985
- model = models.DescribeAccountBalanceRequest()
1401
+ model = models.DescribeSavingPlanUsageRequest()
986
1402
  model.from_json_string(json.dumps(args))
987
1403
  start_time = time.time()
988
1404
  while True:
989
- rsp = client.DescribeAccountBalance(model)
1405
+ rsp = client.DescribeSavingPlanUsage(model)
990
1406
  result = rsp.to_json_string()
991
1407
  try:
992
1408
  json_obj = json.loads(result)
@@ -1005,7 +1421,7 @@ def doDescribeAccountBalance(args, parsed_globals):
1005
1421
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1006
1422
 
1007
1423
 
1008
- def doDescribeDosageDetailByDate(args, parsed_globals):
1424
+ def doDescribeAllocationBillDetail(args, parsed_globals):
1009
1425
  g_param = parse_global_arg(parsed_globals)
1010
1426
 
1011
1427
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1034,11 +1450,11 @@ def doDescribeDosageDetailByDate(args, parsed_globals):
1034
1450
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
1035
1451
  client._sdkVersion += ("_CLI_" + __version__)
1036
1452
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1037
- model = models.DescribeDosageDetailByDateRequest()
1453
+ model = models.DescribeAllocationBillDetailRequest()
1038
1454
  model.from_json_string(json.dumps(args))
1039
1455
  start_time = time.time()
1040
1456
  while True:
1041
- rsp = client.DescribeDosageDetailByDate(model)
1457
+ rsp = client.DescribeAllocationBillDetail(model)
1042
1458
  result = rsp.to_json_string()
1043
1459
  try:
1044
1460
  json_obj = json.loads(result)
@@ -1057,7 +1473,7 @@ def doDescribeDosageDetailByDate(args, parsed_globals):
1057
1473
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1058
1474
 
1059
1475
 
1060
- def doDescribeSavingPlanUsage(args, parsed_globals):
1476
+ def doDescribeBillSummaryByRegion(args, parsed_globals):
1061
1477
  g_param = parse_global_arg(parsed_globals)
1062
1478
 
1063
1479
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1086,11 +1502,11 @@ def doDescribeSavingPlanUsage(args, parsed_globals):
1086
1502
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
1087
1503
  client._sdkVersion += ("_CLI_" + __version__)
1088
1504
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1089
- model = models.DescribeSavingPlanUsageRequest()
1505
+ model = models.DescribeBillSummaryByRegionRequest()
1090
1506
  model.from_json_string(json.dumps(args))
1091
1507
  start_time = time.time()
1092
1508
  while True:
1093
- rsp = client.DescribeSavingPlanUsage(model)
1509
+ rsp = client.DescribeBillSummaryByRegion(model)
1094
1510
  result = rsp.to_json_string()
1095
1511
  try:
1096
1512
  json_obj = json.loads(result)
@@ -1109,7 +1525,7 @@ def doDescribeSavingPlanUsage(args, parsed_globals):
1109
1525
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1110
1526
 
1111
1527
 
1112
- def doDescribeVoucherUsageDetails(args, parsed_globals):
1528
+ def doDescribeBillSummaryByProject(args, parsed_globals):
1113
1529
  g_param = parse_global_arg(parsed_globals)
1114
1530
 
1115
1531
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1138,11 +1554,11 @@ def doDescribeVoucherUsageDetails(args, parsed_globals):
1138
1554
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
1139
1555
  client._sdkVersion += ("_CLI_" + __version__)
1140
1556
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1141
- model = models.DescribeVoucherUsageDetailsRequest()
1557
+ model = models.DescribeBillSummaryByProjectRequest()
1142
1558
  model.from_json_string(json.dumps(args))
1143
1559
  start_time = time.time()
1144
1560
  while True:
1145
- rsp = client.DescribeVoucherUsageDetails(model)
1561
+ rsp = client.DescribeBillSummaryByProject(model)
1146
1562
  result = rsp.to_json_string()
1147
1563
  try:
1148
1564
  json_obj = json.loads(result)
@@ -1161,7 +1577,7 @@ def doDescribeVoucherUsageDetails(args, parsed_globals):
1161
1577
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1162
1578
 
1163
1579
 
1164
- def doDescribeBillSummaryByRegion(args, parsed_globals):
1580
+ def doDescribeAllocationMonthOverview(args, parsed_globals):
1165
1581
  g_param = parse_global_arg(parsed_globals)
1166
1582
 
1167
1583
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1190,11 +1606,11 @@ def doDescribeBillSummaryByRegion(args, parsed_globals):
1190
1606
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
1191
1607
  client._sdkVersion += ("_CLI_" + __version__)
1192
1608
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1193
- model = models.DescribeBillSummaryByRegionRequest()
1609
+ model = models.DescribeAllocationMonthOverviewRequest()
1194
1610
  model.from_json_string(json.dumps(args))
1195
1611
  start_time = time.time()
1196
1612
  while True:
1197
- rsp = client.DescribeBillSummaryByRegion(model)
1613
+ rsp = client.DescribeAllocationMonthOverview(model)
1198
1614
  result = rsp.to_json_string()
1199
1615
  try:
1200
1616
  json_obj = json.loads(result)
@@ -1213,7 +1629,7 @@ def doDescribeBillSummaryByRegion(args, parsed_globals):
1213
1629
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1214
1630
 
1215
1631
 
1216
- def doDescribeBillSummaryByProject(args, parsed_globals):
1632
+ def doDescribeCostExplorerSummary(args, parsed_globals):
1217
1633
  g_param = parse_global_arg(parsed_globals)
1218
1634
 
1219
1635
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1242,11 +1658,11 @@ def doDescribeBillSummaryByProject(args, parsed_globals):
1242
1658
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
1243
1659
  client._sdkVersion += ("_CLI_" + __version__)
1244
1660
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1245
- model = models.DescribeBillSummaryByProjectRequest()
1661
+ model = models.DescribeCostExplorerSummaryRequest()
1246
1662
  model.from_json_string(json.dumps(args))
1247
1663
  start_time = time.time()
1248
1664
  while True:
1249
- rsp = client.DescribeBillSummaryByProject(model)
1665
+ rsp = client.DescribeCostExplorerSummary(model)
1250
1666
  result = rsp.to_json_string()
1251
1667
  try:
1252
1668
  json_obj = json.loads(result)
@@ -1265,7 +1681,7 @@ def doDescribeBillSummaryByProject(args, parsed_globals):
1265
1681
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1266
1682
 
1267
1683
 
1268
- def doDescribeCostExplorerSummary(args, parsed_globals):
1684
+ def doDescribeBillSummaryForOrganization(args, parsed_globals):
1269
1685
  g_param = parse_global_arg(parsed_globals)
1270
1686
 
1271
1687
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1294,11 +1710,11 @@ def doDescribeCostExplorerSummary(args, parsed_globals):
1294
1710
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
1295
1711
  client._sdkVersion += ("_CLI_" + __version__)
1296
1712
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1297
- model = models.DescribeCostExplorerSummaryRequest()
1713
+ model = models.DescribeBillSummaryForOrganizationRequest()
1298
1714
  model.from_json_string(json.dumps(args))
1299
1715
  start_time = time.time()
1300
1716
  while True:
1301
- rsp = client.DescribeCostExplorerSummary(model)
1717
+ rsp = client.DescribeBillSummaryForOrganization(model)
1302
1718
  result = rsp.to_json_string()
1303
1719
  try:
1304
1720
  json_obj = json.loads(result)
@@ -1317,7 +1733,7 @@ def doDescribeCostExplorerSummary(args, parsed_globals):
1317
1733
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1318
1734
 
1319
1735
 
1320
- def doDescribeBillSummaryForOrganization(args, parsed_globals):
1736
+ def doDescribeGatherResource(args, parsed_globals):
1321
1737
  g_param = parse_global_arg(parsed_globals)
1322
1738
 
1323
1739
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1346,11 +1762,11 @@ def doDescribeBillSummaryForOrganization(args, parsed_globals):
1346
1762
  client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
1347
1763
  client._sdkVersion += ("_CLI_" + __version__)
1348
1764
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1349
- model = models.DescribeBillSummaryForOrganizationRequest()
1765
+ model = models.DescribeGatherResourceRequest()
1350
1766
  model.from_json_string(json.dumps(args))
1351
1767
  start_time = time.time()
1352
1768
  while True:
1353
- rsp = client.DescribeBillSummaryForOrganization(model)
1769
+ rsp = client.DescribeGatherResource(model)
1354
1770
  result = rsp.to_json_string()
1355
1771
  try:
1356
1772
  json_obj = json.loads(result)
@@ -1473,6 +1889,58 @@ def doDescribeTagList(args, parsed_globals):
1473
1889
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1474
1890
 
1475
1891
 
1892
+ def doDescribeVoucherUsageDetails(args, parsed_globals):
1893
+ g_param = parse_global_arg(parsed_globals)
1894
+
1895
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1896
+ cred = credential.CVMRoleCredential()
1897
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1898
+ cred = credential.STSAssumeRoleCredential(
1899
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1900
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1901
+ )
1902
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
1903
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1904
+ else:
1905
+ cred = credential.Credential(
1906
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1907
+ )
1908
+ http_profile = HttpProfile(
1909
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1910
+ reqMethod="POST",
1911
+ endpoint=g_param[OptionsDefine.Endpoint],
1912
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1913
+ )
1914
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1915
+ if g_param[OptionsDefine.Language]:
1916
+ profile.language = g_param[OptionsDefine.Language]
1917
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1918
+ client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
1919
+ client._sdkVersion += ("_CLI_" + __version__)
1920
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1921
+ model = models.DescribeVoucherUsageDetailsRequest()
1922
+ model.from_json_string(json.dumps(args))
1923
+ start_time = time.time()
1924
+ while True:
1925
+ rsp = client.DescribeVoucherUsageDetails(model)
1926
+ result = rsp.to_json_string()
1927
+ try:
1928
+ json_obj = json.loads(result)
1929
+ except TypeError as e:
1930
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1931
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1932
+ break
1933
+ cur_time = time.time()
1934
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1935
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1936
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1937
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1938
+ else:
1939
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1940
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1941
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1942
+
1943
+
1476
1944
  def doCreateSavingPlanOrder(args, parsed_globals):
1477
1945
  g_param = parse_global_arg(parsed_globals)
1478
1946
 
@@ -1681,6 +2149,58 @@ def doDescribeCostSummaryByProduct(args, parsed_globals):
1681
2149
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1682
2150
 
1683
2151
 
2152
+ def doDescribeAllocationSummaryByItem(args, parsed_globals):
2153
+ g_param = parse_global_arg(parsed_globals)
2154
+
2155
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
2156
+ cred = credential.CVMRoleCredential()
2157
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
2158
+ cred = credential.STSAssumeRoleCredential(
2159
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
2160
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
2161
+ )
2162
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
2163
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
2164
+ else:
2165
+ cred = credential.Credential(
2166
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
2167
+ )
2168
+ http_profile = HttpProfile(
2169
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
2170
+ reqMethod="POST",
2171
+ endpoint=g_param[OptionsDefine.Endpoint],
2172
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
2173
+ )
2174
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
2175
+ if g_param[OptionsDefine.Language]:
2176
+ profile.language = g_param[OptionsDefine.Language]
2177
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
2178
+ client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
2179
+ client._sdkVersion += ("_CLI_" + __version__)
2180
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
2181
+ model = models.DescribeAllocationSummaryByItemRequest()
2182
+ model.from_json_string(json.dumps(args))
2183
+ start_time = time.time()
2184
+ while True:
2185
+ rsp = client.DescribeAllocationSummaryByItem(model)
2186
+ result = rsp.to_json_string()
2187
+ try:
2188
+ json_obj = json.loads(result)
2189
+ except TypeError as e:
2190
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
2191
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
2192
+ break
2193
+ cur_time = time.time()
2194
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
2195
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
2196
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
2197
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
2198
+ else:
2199
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
2200
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
2201
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
2202
+
2203
+
1684
2204
  def doDescribeBillSummaryByProduct(args, parsed_globals):
1685
2205
  g_param = parse_global_arg(parsed_globals)
1686
2206
 
@@ -1848,11 +2368,16 @@ MODELS_MAP = {
1848
2368
  }
1849
2369
 
1850
2370
  ACTION_MAP = {
2371
+ "DescribeAllocationBillConditions": doDescribeAllocationBillConditions,
1851
2372
  "DescribeCostSummaryByResource": doDescribeCostSummaryByResource,
1852
- "DescribeCostSummaryByRegion": doDescribeCostSummaryByRegion,
2373
+ "DescribeBillList": doDescribeBillList,
1853
2374
  "DescribeDealsByCond": doDescribeDealsByCond,
2375
+ "DescribeAllocationSummaryByResource": doDescribeAllocationSummaryByResource,
1854
2376
  "DescribeBillResourceSummary": doDescribeBillResourceSummary,
2377
+ "DescribeAllocationSummaryByBusiness": doDescribeAllocationSummaryByBusiness,
2378
+ "DescribeAllocateConditions": doDescribeAllocateConditions,
1855
2379
  "DescribeSavingPlanOverview": doDescribeSavingPlanOverview,
2380
+ "DescribeAllocationOverview": doDescribeAllocationOverview,
1856
2381
  "DescribeDosageDetailList": doDescribeDosageDetailList,
1857
2382
  "CreateAllocationTag": doCreateAllocationTag,
1858
2383
  "PayDeals": doPayDeals,
@@ -1862,24 +2387,29 @@ ACTION_MAP = {
1862
2387
  "DescribeBillDetail": doDescribeBillDetail,
1863
2388
  "DescribeBillSummary": doDescribeBillSummary,
1864
2389
  "DescribeBillSummaryByPayMode": doDescribeBillSummaryByPayMode,
1865
- "DescribeBillList": doDescribeBillList,
2390
+ "DescribeCostSummaryByRegion": doDescribeCostSummaryByRegion,
2391
+ "DescribeAllocationTrendByMonth": doDescribeAllocationTrendByMonth,
1866
2392
  "DescribeBillDownloadUrl": doDescribeBillDownloadUrl,
1867
2393
  "DescribeDosageCosDetailByDate": doDescribeDosageCosDetailByDate,
1868
2394
  "DescribeBillDetailForOrganization": doDescribeBillDetailForOrganization,
1869
2395
  "DescribeAccountBalance": doDescribeAccountBalance,
1870
2396
  "DescribeDosageDetailByDate": doDescribeDosageDetailByDate,
1871
2397
  "DescribeSavingPlanUsage": doDescribeSavingPlanUsage,
1872
- "DescribeVoucherUsageDetails": doDescribeVoucherUsageDetails,
2398
+ "DescribeAllocationBillDetail": doDescribeAllocationBillDetail,
1873
2399
  "DescribeBillSummaryByRegion": doDescribeBillSummaryByRegion,
1874
2400
  "DescribeBillSummaryByProject": doDescribeBillSummaryByProject,
2401
+ "DescribeAllocationMonthOverview": doDescribeAllocationMonthOverview,
1875
2402
  "DescribeCostExplorerSummary": doDescribeCostExplorerSummary,
1876
2403
  "DescribeBillSummaryForOrganization": doDescribeBillSummaryForOrganization,
2404
+ "DescribeGatherResource": doDescribeGatherResource,
1877
2405
  "DescribeSavingPlanResourceInfo": doDescribeSavingPlanResourceInfo,
1878
2406
  "DescribeTagList": doDescribeTagList,
2407
+ "DescribeVoucherUsageDetails": doDescribeVoucherUsageDetails,
1879
2408
  "CreateSavingPlanOrder": doCreateSavingPlanOrder,
1880
2409
  "DeleteAllocationTag": doDeleteAllocationTag,
1881
2410
  "DescribeSavingPlanCoverage": doDescribeSavingPlanCoverage,
1882
2411
  "DescribeCostSummaryByProduct": doDescribeCostSummaryByProduct,
2412
+ "DescribeAllocationSummaryByItem": doDescribeAllocationSummaryByItem,
1883
2413
  "DescribeBillSummaryByProduct": doDescribeBillSummaryByProduct,
1884
2414
  "DescribeBillSummaryByTag": doDescribeBillSummaryByTag,
1885
2415
  "DescribeCostDetail": doDescribeCostDetail,