tccli 3.0.1393.1__py2.py3-none-any.whl → 3.0.1394.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tccli/__init__.py +1 -1
- tccli/services/__init__.py +2 -1
- tccli/services/ai3d/v20250513/api.json +4 -4
- tccli/services/apm/apm_client.py +53 -0
- tccli/services/apm/v20210622/api.json +354 -0
- tccli/services/apm/v20210622/examples.json +8 -0
- tccli/services/billing/billing_client.py +326 -8
- tccli/services/billing/v20180709/api.json +2120 -187
- tccli/services/billing/v20180709/examples.json +48 -0
- tccli/services/ccc/v20200210/api.json +88 -10
- tccli/services/cvm/cvm_client.py +0 -212
- tccli/services/cvm/v20170312/api.json +80 -842
- tccli/services/cvm/v20170312/examples.json +24 -56
- tccli/services/gs/gs_client.py +216 -4
- tccli/services/gs/v20191118/api.json +201 -0
- tccli/services/gs/v20191118/examples.json +32 -0
- tccli/services/iai/v20180301/api.json +33 -24
- tccli/services/iai/v20180301/examples.json +4 -4
- tccli/services/lke/v20231130/api.json +34 -1
- tccli/services/lkeap/v20240522/api.json +1 -1
- tccli/services/mna/v20210119/api.json +10 -1
- tccli/services/mna/v20210119/examples.json +1 -1
- tccli/services/ocr/v20181119/api.json +2 -2
- tccli/services/redis/v20180412/api.json +1 -1
- tccli/services/sqlserver/v20180328/api.json +15 -5
- tccli/services/sqlserver/v20180328/examples.json +1 -1
- tccli/services/trocket/v20230308/api.json +4 -4
- tccli/services/tsf/v20180326/api.json +2 -2
- tccli/services/vod/v20180717/api.json +1 -1
- tccli/services/vpc/v20170312/api.json +3 -3
- tccli/services/vtc/v20240223/api.json +1 -1
- tccli/services/waf/v20180125/api.json +8 -8
- tccli/services/waf/v20180125/examples.json +1 -1
- tccli/services/wedata/v20250806/api.json +13645 -0
- tccli/services/wedata/v20250806/examples.json +621 -0
- tccli/services/wedata/wedata_client.py +5031 -1157
- {tccli-3.0.1393.1.dist-info → tccli-3.0.1394.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1393.1.dist-info → tccli-3.0.1394.1.dist-info}/RECORD +41 -39
- {tccli-3.0.1393.1.dist-info → tccli-3.0.1394.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1393.1.dist-info → tccli-3.0.1394.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1393.1.dist-info → tccli-3.0.1394.1.dist-info}/license_files/LICENSE +0 -0
@@ -589,6 +589,110 @@ def doDescribeAllocateConditions(args, parsed_globals):
|
|
589
589
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
590
590
|
|
591
591
|
|
592
|
+
def doCreateBudget(args, parsed_globals):
|
593
|
+
g_param = parse_global_arg(parsed_globals)
|
594
|
+
|
595
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
596
|
+
cred = credential.CVMRoleCredential()
|
597
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
598
|
+
cred = credential.STSAssumeRoleCredential(
|
599
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
600
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
601
|
+
)
|
602
|
+
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):
|
603
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
604
|
+
else:
|
605
|
+
cred = credential.Credential(
|
606
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
607
|
+
)
|
608
|
+
http_profile = HttpProfile(
|
609
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
610
|
+
reqMethod="POST",
|
611
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
612
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
613
|
+
)
|
614
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
615
|
+
if g_param[OptionsDefine.Language]:
|
616
|
+
profile.language = g_param[OptionsDefine.Language]
|
617
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
618
|
+
client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
|
619
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
620
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
621
|
+
model = models.CreateBudgetRequest()
|
622
|
+
model.from_json_string(json.dumps(args))
|
623
|
+
start_time = time.time()
|
624
|
+
while True:
|
625
|
+
rsp = client.CreateBudget(model)
|
626
|
+
result = rsp.to_json_string()
|
627
|
+
try:
|
628
|
+
json_obj = json.loads(result)
|
629
|
+
except TypeError as e:
|
630
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
631
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
632
|
+
break
|
633
|
+
cur_time = time.time()
|
634
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
635
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
636
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
637
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
638
|
+
else:
|
639
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
640
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
641
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
642
|
+
|
643
|
+
|
644
|
+
def doDescribeBillSummaryByPayMode(args, parsed_globals):
|
645
|
+
g_param = parse_global_arg(parsed_globals)
|
646
|
+
|
647
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
648
|
+
cred = credential.CVMRoleCredential()
|
649
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
650
|
+
cred = credential.STSAssumeRoleCredential(
|
651
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
652
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
653
|
+
)
|
654
|
+
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):
|
655
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
656
|
+
else:
|
657
|
+
cred = credential.Credential(
|
658
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
659
|
+
)
|
660
|
+
http_profile = HttpProfile(
|
661
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
662
|
+
reqMethod="POST",
|
663
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
664
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
665
|
+
)
|
666
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
667
|
+
if g_param[OptionsDefine.Language]:
|
668
|
+
profile.language = g_param[OptionsDefine.Language]
|
669
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
670
|
+
client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
|
671
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
672
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
673
|
+
model = models.DescribeBillSummaryByPayModeRequest()
|
674
|
+
model.from_json_string(json.dumps(args))
|
675
|
+
start_time = time.time()
|
676
|
+
while True:
|
677
|
+
rsp = client.DescribeBillSummaryByPayMode(model)
|
678
|
+
result = rsp.to_json_string()
|
679
|
+
try:
|
680
|
+
json_obj = json.loads(result)
|
681
|
+
except TypeError as e:
|
682
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
683
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
684
|
+
break
|
685
|
+
cur_time = time.time()
|
686
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
687
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
688
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
689
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
690
|
+
else:
|
691
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
692
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
693
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
694
|
+
|
695
|
+
|
592
696
|
def doDescribeAllocationOverview(args, parsed_globals):
|
593
697
|
g_param = parse_global_arg(parsed_globals)
|
594
698
|
|
@@ -797,6 +901,58 @@ def doCreateAllocationTag(args, parsed_globals):
|
|
797
901
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
798
902
|
|
799
903
|
|
904
|
+
def doDeleteBudget(args, parsed_globals):
|
905
|
+
g_param = parse_global_arg(parsed_globals)
|
906
|
+
|
907
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
908
|
+
cred = credential.CVMRoleCredential()
|
909
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
910
|
+
cred = credential.STSAssumeRoleCredential(
|
911
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
912
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
913
|
+
)
|
914
|
+
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):
|
915
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
916
|
+
else:
|
917
|
+
cred = credential.Credential(
|
918
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
919
|
+
)
|
920
|
+
http_profile = HttpProfile(
|
921
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
922
|
+
reqMethod="POST",
|
923
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
924
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
925
|
+
)
|
926
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
927
|
+
if g_param[OptionsDefine.Language]:
|
928
|
+
profile.language = g_param[OptionsDefine.Language]
|
929
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
930
|
+
client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
|
931
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
932
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
933
|
+
model = models.DeleteBudgetRequest()
|
934
|
+
model.from_json_string(json.dumps(args))
|
935
|
+
start_time = time.time()
|
936
|
+
while True:
|
937
|
+
rsp = client.DeleteBudget(model)
|
938
|
+
result = rsp.to_json_string()
|
939
|
+
try:
|
940
|
+
json_obj = json.loads(result)
|
941
|
+
except TypeError as e:
|
942
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
943
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
944
|
+
break
|
945
|
+
cur_time = time.time()
|
946
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
947
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
948
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
949
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
950
|
+
else:
|
951
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
952
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
953
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
954
|
+
|
955
|
+
|
800
956
|
def doPayDeals(args, parsed_globals):
|
801
957
|
g_param = parse_global_arg(parsed_globals)
|
802
958
|
|
@@ -1161,7 +1317,7 @@ def doDeleteAllocationRule(args, parsed_globals):
|
|
1161
1317
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1162
1318
|
|
1163
1319
|
|
1164
|
-
def
|
1320
|
+
def doDescribeBudgetRemindRecordList(args, parsed_globals):
|
1165
1321
|
g_param = parse_global_arg(parsed_globals)
|
1166
1322
|
|
1167
1323
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1190,11 +1346,11 @@ def doDescribeBillSummaryByPayMode(args, parsed_globals):
|
|
1190
1346
|
client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
|
1191
1347
|
client._sdkVersion += ("_CLI_" + __version__)
|
1192
1348
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1193
|
-
model = models.
|
1349
|
+
model = models.DescribeBudgetRemindRecordListRequest()
|
1194
1350
|
model.from_json_string(json.dumps(args))
|
1195
1351
|
start_time = time.time()
|
1196
1352
|
while True:
|
1197
|
-
rsp = client.
|
1353
|
+
rsp = client.DescribeBudgetRemindRecordList(model)
|
1198
1354
|
result = rsp.to_json_string()
|
1199
1355
|
try:
|
1200
1356
|
json_obj = json.loads(result)
|
@@ -1577,6 +1733,58 @@ def doDescribeBillDetailForOrganization(args, parsed_globals):
|
|
1577
1733
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1578
1734
|
|
1579
1735
|
|
1736
|
+
def doModifyBudget(args, parsed_globals):
|
1737
|
+
g_param = parse_global_arg(parsed_globals)
|
1738
|
+
|
1739
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1740
|
+
cred = credential.CVMRoleCredential()
|
1741
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1742
|
+
cred = credential.STSAssumeRoleCredential(
|
1743
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1744
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1745
|
+
)
|
1746
|
+
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):
|
1747
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1748
|
+
else:
|
1749
|
+
cred = credential.Credential(
|
1750
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1751
|
+
)
|
1752
|
+
http_profile = HttpProfile(
|
1753
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1754
|
+
reqMethod="POST",
|
1755
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1756
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1757
|
+
)
|
1758
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1759
|
+
if g_param[OptionsDefine.Language]:
|
1760
|
+
profile.language = g_param[OptionsDefine.Language]
|
1761
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1762
|
+
client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
|
1763
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1764
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1765
|
+
model = models.ModifyBudgetRequest()
|
1766
|
+
model.from_json_string(json.dumps(args))
|
1767
|
+
start_time = time.time()
|
1768
|
+
while True:
|
1769
|
+
rsp = client.ModifyBudget(model)
|
1770
|
+
result = rsp.to_json_string()
|
1771
|
+
try:
|
1772
|
+
json_obj = json.loads(result)
|
1773
|
+
except TypeError as e:
|
1774
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1775
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1776
|
+
break
|
1777
|
+
cur_time = time.time()
|
1778
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1779
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1780
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1781
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1782
|
+
else:
|
1783
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1784
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1785
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1786
|
+
|
1787
|
+
|
1580
1788
|
def doDescribeAccountBalance(args, parsed_globals):
|
1581
1789
|
g_param = parse_global_arg(parsed_globals)
|
1582
1790
|
|
@@ -1837,6 +2045,58 @@ def doDescribeAllocationUnitDetail(args, parsed_globals):
|
|
1837
2045
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1838
2046
|
|
1839
2047
|
|
2048
|
+
def doDescribeBudget(args, parsed_globals):
|
2049
|
+
g_param = parse_global_arg(parsed_globals)
|
2050
|
+
|
2051
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2052
|
+
cred = credential.CVMRoleCredential()
|
2053
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2054
|
+
cred = credential.STSAssumeRoleCredential(
|
2055
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2056
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2057
|
+
)
|
2058
|
+
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):
|
2059
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2060
|
+
else:
|
2061
|
+
cred = credential.Credential(
|
2062
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2063
|
+
)
|
2064
|
+
http_profile = HttpProfile(
|
2065
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2066
|
+
reqMethod="POST",
|
2067
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2068
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2069
|
+
)
|
2070
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2071
|
+
if g_param[OptionsDefine.Language]:
|
2072
|
+
profile.language = g_param[OptionsDefine.Language]
|
2073
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2074
|
+
client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
|
2075
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2076
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2077
|
+
model = models.DescribeBudgetRequest()
|
2078
|
+
model.from_json_string(json.dumps(args))
|
2079
|
+
start_time = time.time()
|
2080
|
+
while True:
|
2081
|
+
rsp = client.DescribeBudget(model)
|
2082
|
+
result = rsp.to_json_string()
|
2083
|
+
try:
|
2084
|
+
json_obj = json.loads(result)
|
2085
|
+
except TypeError as e:
|
2086
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2087
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2088
|
+
break
|
2089
|
+
cur_time = time.time()
|
2090
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2091
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2092
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2093
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2094
|
+
else:
|
2095
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2096
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2097
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2098
|
+
|
2099
|
+
|
1840
2100
|
def doDescribeBillAdjustInfo(args, parsed_globals):
|
1841
2101
|
g_param = parse_global_arg(parsed_globals)
|
1842
2102
|
|
@@ -2461,7 +2721,7 @@ def doModifyGatherRule(args, parsed_globals):
|
|
2461
2721
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2462
2722
|
|
2463
2723
|
|
2464
|
-
def
|
2724
|
+
def doDescribeBudgetOperationLog(args, parsed_globals):
|
2465
2725
|
g_param = parse_global_arg(parsed_globals)
|
2466
2726
|
|
2467
2727
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2490,11 +2750,11 @@ def doDescribeCostSummaryByProduct(args, parsed_globals):
|
|
2490
2750
|
client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
|
2491
2751
|
client._sdkVersion += ("_CLI_" + __version__)
|
2492
2752
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2493
|
-
model = models.
|
2753
|
+
model = models.DescribeBudgetOperationLogRequest()
|
2494
2754
|
model.from_json_string(json.dumps(args))
|
2495
2755
|
start_time = time.time()
|
2496
2756
|
while True:
|
2497
|
-
rsp = client.
|
2757
|
+
rsp = client.DescribeBudgetOperationLog(model)
|
2498
2758
|
result = rsp.to_json_string()
|
2499
2759
|
try:
|
2500
2760
|
json_obj = json.loads(result)
|
@@ -2669,6 +2929,58 @@ def doDescribeCostDetail(args, parsed_globals):
|
|
2669
2929
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2670
2930
|
|
2671
2931
|
|
2932
|
+
def doDescribeCostSummaryByProduct(args, parsed_globals):
|
2933
|
+
g_param = parse_global_arg(parsed_globals)
|
2934
|
+
|
2935
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2936
|
+
cred = credential.CVMRoleCredential()
|
2937
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2938
|
+
cred = credential.STSAssumeRoleCredential(
|
2939
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2940
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2941
|
+
)
|
2942
|
+
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):
|
2943
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2944
|
+
else:
|
2945
|
+
cred = credential.Credential(
|
2946
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2947
|
+
)
|
2948
|
+
http_profile = HttpProfile(
|
2949
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2950
|
+
reqMethod="POST",
|
2951
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2952
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2953
|
+
)
|
2954
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2955
|
+
if g_param[OptionsDefine.Language]:
|
2956
|
+
profile.language = g_param[OptionsDefine.Language]
|
2957
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2958
|
+
client = mod.BillingClient(cred, g_param[OptionsDefine.Region], profile)
|
2959
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2960
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2961
|
+
model = models.DescribeCostSummaryByProductRequest()
|
2962
|
+
model.from_json_string(json.dumps(args))
|
2963
|
+
start_time = time.time()
|
2964
|
+
while True:
|
2965
|
+
rsp = client.DescribeCostSummaryByProduct(model)
|
2966
|
+
result = rsp.to_json_string()
|
2967
|
+
try:
|
2968
|
+
json_obj = json.loads(result)
|
2969
|
+
except TypeError as e:
|
2970
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2971
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2972
|
+
break
|
2973
|
+
cur_time = time.time()
|
2974
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2975
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2976
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2977
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2978
|
+
else:
|
2979
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2980
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2981
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2982
|
+
|
2983
|
+
|
2672
2984
|
def doDescribeAllocationSummaryByItem(args, parsed_globals):
|
2673
2985
|
g_param = parse_global_arg(parsed_globals)
|
2674
2986
|
|
@@ -2951,10 +3263,13 @@ ACTION_MAP = {
|
|
2951
3263
|
"DescribeBillResourceSummary": doDescribeBillResourceSummary,
|
2952
3264
|
"DeleteAllocationUnit": doDeleteAllocationUnit,
|
2953
3265
|
"DescribeAllocateConditions": doDescribeAllocateConditions,
|
3266
|
+
"CreateBudget": doCreateBudget,
|
3267
|
+
"DescribeBillSummaryByPayMode": doDescribeBillSummaryByPayMode,
|
2954
3268
|
"DescribeAllocationOverview": doDescribeAllocationOverview,
|
2955
3269
|
"DescribeDosageDetailList": doDescribeDosageDetailList,
|
2956
3270
|
"CreateAllocationUnit": doCreateAllocationUnit,
|
2957
3271
|
"CreateAllocationTag": doCreateAllocationTag,
|
3272
|
+
"DeleteBudget": doDeleteBudget,
|
2958
3273
|
"PayDeals": doPayDeals,
|
2959
3274
|
"DescribeCostSummaryByProject": doDescribeCostSummaryByProject,
|
2960
3275
|
"DescribeVoucherInfo": doDescribeVoucherInfo,
|
@@ -2962,7 +3277,7 @@ ACTION_MAP = {
|
|
2962
3277
|
"DescribeBillDetail": doDescribeBillDetail,
|
2963
3278
|
"DescribeBillSummary": doDescribeBillSummary,
|
2964
3279
|
"DeleteAllocationRule": doDeleteAllocationRule,
|
2965
|
-
"
|
3280
|
+
"DescribeBudgetRemindRecordList": doDescribeBudgetRemindRecordList,
|
2966
3281
|
"DescribeAllocationRuleDetail": doDescribeAllocationRuleDetail,
|
2967
3282
|
"DescribeCostSummaryByRegion": doDescribeCostSummaryByRegion,
|
2968
3283
|
"DescribeAllocationTrendByMonth": doDescribeAllocationTrendByMonth,
|
@@ -2970,11 +3285,13 @@ ACTION_MAP = {
|
|
2970
3285
|
"DescribeDosageCosDetailByDate": doDescribeDosageCosDetailByDate,
|
2971
3286
|
"CreateGatherRule": doCreateGatherRule,
|
2972
3287
|
"DescribeBillDetailForOrganization": doDescribeBillDetailForOrganization,
|
3288
|
+
"ModifyBudget": doModifyBudget,
|
2973
3289
|
"DescribeAccountBalance": doDescribeAccountBalance,
|
2974
3290
|
"DescribeGatherRuleDetail": doDescribeGatherRuleDetail,
|
2975
3291
|
"DescribeDosageDetailByDate": doDescribeDosageDetailByDate,
|
2976
3292
|
"DescribeAllocationTree": doDescribeAllocationTree,
|
2977
3293
|
"DescribeAllocationUnitDetail": doDescribeAllocationUnitDetail,
|
3294
|
+
"DescribeBudget": doDescribeBudget,
|
2978
3295
|
"DescribeBillAdjustInfo": doDescribeBillAdjustInfo,
|
2979
3296
|
"DescribeVoucherUsageDetails": doDescribeVoucherUsageDetails,
|
2980
3297
|
"DescribeBillSummaryByRegion": doDescribeBillSummaryByRegion,
|
@@ -2987,10 +3304,11 @@ ACTION_MAP = {
|
|
2987
3304
|
"DescribeSavingPlanResourceInfo": doDescribeSavingPlanResourceInfo,
|
2988
3305
|
"DescribeTagList": doDescribeTagList,
|
2989
3306
|
"ModifyGatherRule": doModifyGatherRule,
|
2990
|
-
"
|
3307
|
+
"DescribeBudgetOperationLog": doDescribeBudgetOperationLog,
|
2991
3308
|
"ModifyAllocationUnit": doModifyAllocationUnit,
|
2992
3309
|
"DescribeAllocationSummaryByBusiness": doDescribeAllocationSummaryByBusiness,
|
2993
3310
|
"DescribeCostDetail": doDescribeCostDetail,
|
3311
|
+
"DescribeCostSummaryByProduct": doDescribeCostSummaryByProduct,
|
2994
3312
|
"DescribeAllocationSummaryByItem": doDescribeAllocationSummaryByItem,
|
2995
3313
|
"DescribeBillSummaryByProduct": doDescribeBillSummaryByProduct,
|
2996
3314
|
"ModifyAllocationRule": doModifyAllocationRule,
|