tccli 3.0.1239.1__py2.py3-none-any.whl → 3.0.1241.1__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- tccli/__init__.py +1 -1
- tccli/services/apm/v20210622/api.json +66 -69
- tccli/services/apm/v20210622/examples.json +26 -26
- tccli/services/autoscaling/v20180419/api.json +12 -1
- tccli/services/batch/v20170312/api.json +11 -11
- tccli/services/billing/v20180709/api.json +20 -0
- tccli/services/cam/v20190116/api.json +1 -1
- tccli/services/car/v20220110/api.json +1 -1
- tccli/services/car/v20220110/examples.json +3 -3
- tccli/services/cdb/v20170320/api.json +582 -579
- tccli/services/cdb/v20170320/examples.json +9 -9
- tccli/services/cdwdoris/v20211228/api.json +40 -0
- tccli/services/cfg/v20210820/api.json +11 -0
- tccli/services/chdfs/v20201112/api.json +10 -10
- tccli/services/chdfs/v20201112/examples.json +1 -1
- tccli/services/cls/v20201016/api.json +1 -1
- tccli/services/cmq/v20190304/api.json +77 -77
- tccli/services/csip/csip_client.py +281 -16
- tccli/services/csip/v20221121/api.json +1631 -101
- tccli/services/csip/v20221121/examples.json +40 -0
- tccli/services/cvm/cvm_client.py +60 -325
- tccli/services/cvm/v20170312/api.json +618 -1401
- tccli/services/cvm/v20170312/examples.json +8 -48
- tccli/services/cwp/cwp_client.py +0 -53
- tccli/services/cwp/v20180228/api.json +0 -34
- tccli/services/cwp/v20180228/examples.json +0 -8
- tccli/services/cynosdb/v20190107/api.json +452 -458
- tccli/services/cynosdb/v20190107/examples.json +23 -23
- tccli/services/dbbrain/v20191016/api.json +16 -4
- tccli/services/dbbrain/v20191016/examples.json +5 -5
- tccli/services/dbbrain/v20210527/api.json +44 -44
- tccli/services/dbbrain/v20210527/examples.json +8 -8
- tccli/services/dts/v20180330/api.json +30 -30
- tccli/services/dts/v20180330/examples.json +4 -4
- tccli/services/dts/v20211206/api.json +19 -9
- tccli/services/dts/v20211206/examples.json +5 -5
- tccli/services/ecm/v20190719/api.json +55 -48
- tccli/services/ecm/v20190719/examples.json +7 -7
- tccli/services/emr/emr_client.py +493 -16
- tccli/services/emr/v20190103/api.json +1323 -246
- tccli/services/emr/v20190103/examples.json +72 -0
- tccli/services/ess/v20201111/api.json +15 -6
- tccli/services/ess/v20201111/examples.json +12 -0
- tccli/services/essbasic/v20210526/api.json +11 -2
- tccli/services/essbasic/v20210526/examples.json +12 -0
- tccli/services/faceid/v20180301/api.json +3 -3
- tccli/services/gaap/v20180529/api.json +181 -183
- tccli/services/gaap/v20180529/examples.json +31 -37
- tccli/services/gs/v20191118/api.json +3 -3
- tccli/services/gs/v20191118/examples.json +3 -3
- tccli/services/iai/iai_client.py +53 -0
- tccli/services/iai/v20200303/api.json +80 -0
- tccli/services/iai/v20200303/examples.json +14 -0
- tccli/services/iotexplorer/v20190423/api.json +10 -0
- tccli/services/keewidb/v20220308/api.json +188 -190
- tccli/services/live/v20180801/api.json +323 -222
- tccli/services/live/v20180801/examples.json +79 -79
- tccli/services/mna/v20210119/api.json +20 -20
- tccli/services/mps/v20190612/api.json +40 -0
- tccli/services/oceanus/v20190422/api.json +407 -39
- tccli/services/oceanus/v20190422/examples.json +1 -1
- tccli/services/ocr/v20181119/api.json +50 -0
- tccli/services/sms/v20190711/api.json +81 -81
- tccli/services/sms/v20190711/examples.json +8 -8
- tccli/services/sms/v20210111/api.json +39 -39
- tccli/services/sqlserver/v20180328/api.json +235 -139
- tccli/services/sqlserver/v20180328/examples.json +2 -2
- tccli/services/ssl/v20191205/api.json +777 -779
- tccli/services/ssl/v20191205/examples.json +8 -8
- tccli/services/tbaas/v20180416/api.json +118 -82
- tccli/services/tbaas/v20180416/examples.json +7 -7
- tccli/services/tcb/v20180608/api.json +18 -18
- tccli/services/tcb/v20180608/examples.json +2 -2
- tccli/services/tcm/v20210413/api.json +6 -6
- tccli/services/tcm/v20210413/examples.json +1 -1
- tccli/services/tcr/v20190924/api.json +17 -12
- tccli/services/tdmq/v20200217/api.json +18 -0
- tccli/services/tem/v20210701/api.json +439 -280
- tccli/services/tem/v20210701/examples.json +39 -39
- tccli/services/tke/v20180525/api.json +50 -39
- tccli/services/tke/v20180525/examples.json +51 -21
- tccli/services/trro/v20220325/api.json +27 -27
- tccli/services/trro/v20220325/examples.json +1 -1
- tccli/services/tse/v20201207/api.json +46 -9
- tccli/services/tse/v20201207/examples.json +31 -31
- tccli/services/tsf/v20180326/api.json +448 -434
- tccli/services/tsf/v20180326/examples.json +122 -122
- tccli/services/tts/v20190823/api.json +1 -1
- tccli/services/vpc/v20170312/api.json +278 -37
- tccli/services/vpc/v20170312/examples.json +56 -8
- tccli/services/vpc/vpc_client.py +159 -0
- tccli/services/waf/v20180125/api.json +303 -4
- tccli/services/waf/v20180125/examples.json +25 -1
- tccli/services/waf/waf_client.py +163 -4
- {tccli-3.0.1239.1.dist-info → tccli-3.0.1241.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1239.1.dist-info → tccli-3.0.1241.1.dist-info}/RECORD +99 -99
- {tccli-3.0.1239.1.dist-info → tccli-3.0.1241.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1239.1.dist-info → tccli-3.0.1241.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1239.1.dist-info → tccli-3.0.1241.1.dist-info}/license_files/LICENSE +0 -0
tccli/services/emr/emr_client.py
CHANGED
@@ -797,6 +797,162 @@ def doScaleOutInstance(args, parsed_globals):
|
|
797
797
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
798
798
|
|
799
799
|
|
800
|
+
def doAttachDisks(args, parsed_globals):
|
801
|
+
g_param = parse_global_arg(parsed_globals)
|
802
|
+
|
803
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
804
|
+
cred = credential.CVMRoleCredential()
|
805
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
806
|
+
cred = credential.STSAssumeRoleCredential(
|
807
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
808
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
809
|
+
)
|
810
|
+
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):
|
811
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
812
|
+
else:
|
813
|
+
cred = credential.Credential(
|
814
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
815
|
+
)
|
816
|
+
http_profile = HttpProfile(
|
817
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
818
|
+
reqMethod="POST",
|
819
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
820
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
821
|
+
)
|
822
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
823
|
+
if g_param[OptionsDefine.Language]:
|
824
|
+
profile.language = g_param[OptionsDefine.Language]
|
825
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
826
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
827
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
828
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
829
|
+
model = models.AttachDisksRequest()
|
830
|
+
model.from_json_string(json.dumps(args))
|
831
|
+
start_time = time.time()
|
832
|
+
while True:
|
833
|
+
rsp = client.AttachDisks(model)
|
834
|
+
result = rsp.to_json_string()
|
835
|
+
try:
|
836
|
+
json_obj = json.loads(result)
|
837
|
+
except TypeError as e:
|
838
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
839
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
840
|
+
break
|
841
|
+
cur_time = time.time()
|
842
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
843
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
844
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
845
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
846
|
+
else:
|
847
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
848
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
849
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
850
|
+
|
851
|
+
|
852
|
+
def doSetNodeResourceConfigDefault(args, parsed_globals):
|
853
|
+
g_param = parse_global_arg(parsed_globals)
|
854
|
+
|
855
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
856
|
+
cred = credential.CVMRoleCredential()
|
857
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
858
|
+
cred = credential.STSAssumeRoleCredential(
|
859
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
860
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
861
|
+
)
|
862
|
+
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):
|
863
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
864
|
+
else:
|
865
|
+
cred = credential.Credential(
|
866
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
867
|
+
)
|
868
|
+
http_profile = HttpProfile(
|
869
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
870
|
+
reqMethod="POST",
|
871
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
872
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
873
|
+
)
|
874
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
875
|
+
if g_param[OptionsDefine.Language]:
|
876
|
+
profile.language = g_param[OptionsDefine.Language]
|
877
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
878
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
879
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
880
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
881
|
+
model = models.SetNodeResourceConfigDefaultRequest()
|
882
|
+
model.from_json_string(json.dumps(args))
|
883
|
+
start_time = time.time()
|
884
|
+
while True:
|
885
|
+
rsp = client.SetNodeResourceConfigDefault(model)
|
886
|
+
result = rsp.to_json_string()
|
887
|
+
try:
|
888
|
+
json_obj = json.loads(result)
|
889
|
+
except TypeError as e:
|
890
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
891
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
892
|
+
break
|
893
|
+
cur_time = time.time()
|
894
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
895
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
896
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
897
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
898
|
+
else:
|
899
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
900
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
901
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
902
|
+
|
903
|
+
|
904
|
+
def doDescribeSLInstance(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.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
931
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
932
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
933
|
+
model = models.DescribeSLInstanceRequest()
|
934
|
+
model.from_json_string(json.dumps(args))
|
935
|
+
start_time = time.time()
|
936
|
+
while True:
|
937
|
+
rsp = client.DescribeSLInstance(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 doDescribeStarRocksQueryInfo(args, parsed_globals):
|
801
957
|
g_param = parse_global_arg(parsed_globals)
|
802
958
|
|
@@ -1421,6 +1577,58 @@ def doDeleteUserManagerUserList(args, parsed_globals):
|
|
1421
1577
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1422
1578
|
|
1423
1579
|
|
1580
|
+
def doDeleteNodeResourceConfig(args, parsed_globals):
|
1581
|
+
g_param = parse_global_arg(parsed_globals)
|
1582
|
+
|
1583
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1584
|
+
cred = credential.CVMRoleCredential()
|
1585
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1586
|
+
cred = credential.STSAssumeRoleCredential(
|
1587
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1588
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1589
|
+
)
|
1590
|
+
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):
|
1591
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1592
|
+
else:
|
1593
|
+
cred = credential.Credential(
|
1594
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1595
|
+
)
|
1596
|
+
http_profile = HttpProfile(
|
1597
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1598
|
+
reqMethod="POST",
|
1599
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1600
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1601
|
+
)
|
1602
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1603
|
+
if g_param[OptionsDefine.Language]:
|
1604
|
+
profile.language = g_param[OptionsDefine.Language]
|
1605
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1606
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
1607
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1608
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1609
|
+
model = models.DeleteNodeResourceConfigRequest()
|
1610
|
+
model.from_json_string(json.dumps(args))
|
1611
|
+
start_time = time.time()
|
1612
|
+
while True:
|
1613
|
+
rsp = client.DeleteNodeResourceConfig(model)
|
1614
|
+
result = rsp.to_json_string()
|
1615
|
+
try:
|
1616
|
+
json_obj = json.loads(result)
|
1617
|
+
except TypeError as e:
|
1618
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1619
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1620
|
+
break
|
1621
|
+
cur_time = time.time()
|
1622
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1623
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1624
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1625
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1626
|
+
else:
|
1627
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1628
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1629
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1630
|
+
|
1631
|
+
|
1424
1632
|
def doTerminateSLInstance(args, parsed_globals):
|
1425
1633
|
g_param = parse_global_arg(parsed_globals)
|
1426
1634
|
|
@@ -2097,6 +2305,58 @@ def doModifyResourceScheduler(args, parsed_globals):
|
|
2097
2305
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2098
2306
|
|
2099
2307
|
|
2308
|
+
def doDescribeNodeResourceConfigFast(args, parsed_globals):
|
2309
|
+
g_param = parse_global_arg(parsed_globals)
|
2310
|
+
|
2311
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2312
|
+
cred = credential.CVMRoleCredential()
|
2313
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2314
|
+
cred = credential.STSAssumeRoleCredential(
|
2315
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2316
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2317
|
+
)
|
2318
|
+
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):
|
2319
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2320
|
+
else:
|
2321
|
+
cred = credential.Credential(
|
2322
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2323
|
+
)
|
2324
|
+
http_profile = HttpProfile(
|
2325
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2326
|
+
reqMethod="POST",
|
2327
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2328
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2329
|
+
)
|
2330
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2331
|
+
if g_param[OptionsDefine.Language]:
|
2332
|
+
profile.language = g_param[OptionsDefine.Language]
|
2333
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2334
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
2335
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2336
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2337
|
+
model = models.DescribeNodeResourceConfigFastRequest()
|
2338
|
+
model.from_json_string(json.dumps(args))
|
2339
|
+
start_time = time.time()
|
2340
|
+
while True:
|
2341
|
+
rsp = client.DescribeNodeResourceConfigFast(model)
|
2342
|
+
result = rsp.to_json_string()
|
2343
|
+
try:
|
2344
|
+
json_obj = json.loads(result)
|
2345
|
+
except TypeError as e:
|
2346
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2347
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2348
|
+
break
|
2349
|
+
cur_time = time.time()
|
2350
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2351
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2352
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2353
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2354
|
+
else:
|
2355
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2356
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2357
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2358
|
+
|
2359
|
+
|
2100
2360
|
def doDescribeResourceScheduleDiffDetail(args, parsed_globals):
|
2101
2361
|
g_param = parse_global_arg(parsed_globals)
|
2102
2362
|
|
@@ -2149,7 +2409,7 @@ def doDescribeResourceScheduleDiffDetail(args, parsed_globals):
|
|
2149
2409
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2150
2410
|
|
2151
2411
|
|
2152
|
-
def
|
2412
|
+
def doSyncPodState(args, parsed_globals):
|
2153
2413
|
g_param = parse_global_arg(parsed_globals)
|
2154
2414
|
|
2155
2415
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2178,11 +2438,11 @@ def doDescribeSLInstance(args, parsed_globals):
|
|
2178
2438
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
2179
2439
|
client._sdkVersion += ("_CLI_" + __version__)
|
2180
2440
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2181
|
-
model = models.
|
2441
|
+
model = models.SyncPodStateRequest()
|
2182
2442
|
model.from_json_string(json.dumps(args))
|
2183
2443
|
start_time = time.time()
|
2184
2444
|
while True:
|
2185
|
-
rsp = client.
|
2445
|
+
rsp = client.SyncPodState(model)
|
2186
2446
|
result = rsp.to_json_string()
|
2187
2447
|
try:
|
2188
2448
|
json_obj = json.loads(result)
|
@@ -2305,6 +2565,58 @@ def doCreateInstance(args, parsed_globals):
|
|
2305
2565
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2306
2566
|
|
2307
2567
|
|
2568
|
+
def doModifyResource(args, parsed_globals):
|
2569
|
+
g_param = parse_global_arg(parsed_globals)
|
2570
|
+
|
2571
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2572
|
+
cred = credential.CVMRoleCredential()
|
2573
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2574
|
+
cred = credential.STSAssumeRoleCredential(
|
2575
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2576
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2577
|
+
)
|
2578
|
+
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):
|
2579
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2580
|
+
else:
|
2581
|
+
cred = credential.Credential(
|
2582
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2583
|
+
)
|
2584
|
+
http_profile = HttpProfile(
|
2585
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2586
|
+
reqMethod="POST",
|
2587
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2588
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2589
|
+
)
|
2590
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2591
|
+
if g_param[OptionsDefine.Language]:
|
2592
|
+
profile.language = g_param[OptionsDefine.Language]
|
2593
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2594
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
2595
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2596
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2597
|
+
model = models.ModifyResourceRequest()
|
2598
|
+
model.from_json_string(json.dumps(args))
|
2599
|
+
start_time = time.time()
|
2600
|
+
while True:
|
2601
|
+
rsp = client.ModifyResource(model)
|
2602
|
+
result = rsp.to_json_string()
|
2603
|
+
try:
|
2604
|
+
json_obj = json.loads(result)
|
2605
|
+
except TypeError as e:
|
2606
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2607
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2608
|
+
break
|
2609
|
+
cur_time = time.time()
|
2610
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2611
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2612
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2613
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2614
|
+
else:
|
2615
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2616
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2617
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2618
|
+
|
2619
|
+
|
2308
2620
|
def doInquiryPriceCreateInstance(args, parsed_globals):
|
2309
2621
|
g_param = parse_global_arg(parsed_globals)
|
2310
2622
|
|
@@ -2461,7 +2773,7 @@ def doDescribeResourceSchedule(args, parsed_globals):
|
|
2461
2773
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2462
2774
|
|
2463
2775
|
|
2464
|
-
def
|
2776
|
+
def doResizeDataDisks(args, parsed_globals):
|
2465
2777
|
g_param = parse_global_arg(parsed_globals)
|
2466
2778
|
|
2467
2779
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2490,11 +2802,11 @@ def doDescribeYarnScheduleHistory(args, parsed_globals):
|
|
2490
2802
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
2491
2803
|
client._sdkVersion += ("_CLI_" + __version__)
|
2492
2804
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2493
|
-
model = models.
|
2805
|
+
model = models.ResizeDataDisksRequest()
|
2494
2806
|
model.from_json_string(json.dumps(args))
|
2495
2807
|
start_time = time.time()
|
2496
2808
|
while True:
|
2497
|
-
rsp = client.
|
2809
|
+
rsp = client.ResizeDataDisks(model)
|
2498
2810
|
result = rsp.to_json_string()
|
2499
2811
|
try:
|
2500
2812
|
json_obj = json.loads(result)
|
@@ -2669,7 +2981,7 @@ def doStartStopServiceOrMonitor(args, parsed_globals):
|
|
2669
2981
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2670
2982
|
|
2671
2983
|
|
2672
|
-
def
|
2984
|
+
def doAddNodeResourceConfig(args, parsed_globals):
|
2673
2985
|
g_param = parse_global_arg(parsed_globals)
|
2674
2986
|
|
2675
2987
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2698,11 +3010,11 @@ def doSyncPodState(args, parsed_globals):
|
|
2698
3010
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
2699
3011
|
client._sdkVersion += ("_CLI_" + __version__)
|
2700
3012
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2701
|
-
model = models.
|
3013
|
+
model = models.AddNodeResourceConfigRequest()
|
2702
3014
|
model.from_json_string(json.dumps(args))
|
2703
3015
|
start_time = time.time()
|
2704
3016
|
while True:
|
2705
|
-
rsp = client.
|
3017
|
+
rsp = client.AddNodeResourceConfig(model)
|
2706
3018
|
result = rsp.to_json_string()
|
2707
3019
|
try:
|
2708
3020
|
json_obj = json.loads(result)
|
@@ -2877,6 +3189,58 @@ def doModifySLInstance(args, parsed_globals):
|
|
2877
3189
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2878
3190
|
|
2879
3191
|
|
3192
|
+
def doDescribeNodeDataDisks(args, parsed_globals):
|
3193
|
+
g_param = parse_global_arg(parsed_globals)
|
3194
|
+
|
3195
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3196
|
+
cred = credential.CVMRoleCredential()
|
3197
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3198
|
+
cred = credential.STSAssumeRoleCredential(
|
3199
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3200
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3201
|
+
)
|
3202
|
+
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):
|
3203
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3204
|
+
else:
|
3205
|
+
cred = credential.Credential(
|
3206
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3207
|
+
)
|
3208
|
+
http_profile = HttpProfile(
|
3209
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3210
|
+
reqMethod="POST",
|
3211
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3212
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3213
|
+
)
|
3214
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3215
|
+
if g_param[OptionsDefine.Language]:
|
3216
|
+
profile.language = g_param[OptionsDefine.Language]
|
3217
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3218
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
3219
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3220
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3221
|
+
model = models.DescribeNodeDataDisksRequest()
|
3222
|
+
model.from_json_string(json.dumps(args))
|
3223
|
+
start_time = time.time()
|
3224
|
+
while True:
|
3225
|
+
rsp = client.DescribeNodeDataDisks(model)
|
3226
|
+
result = rsp.to_json_string()
|
3227
|
+
try:
|
3228
|
+
json_obj = json.loads(result)
|
3229
|
+
except TypeError as e:
|
3230
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3231
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3232
|
+
break
|
3233
|
+
cur_time = time.time()
|
3234
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3235
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3236
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3237
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3238
|
+
else:
|
3239
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3240
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3241
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3242
|
+
|
3243
|
+
|
2880
3244
|
def doDescribeAutoScaleStrategies(args, parsed_globals):
|
2881
3245
|
g_param = parse_global_arg(parsed_globals)
|
2882
3246
|
|
@@ -3085,7 +3449,7 @@ def doDescribeClusterNodes(args, parsed_globals):
|
|
3085
3449
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3086
3450
|
|
3087
3451
|
|
3088
|
-
def
|
3452
|
+
def doDescribeYarnScheduleHistory(args, parsed_globals):
|
3089
3453
|
g_param = parse_global_arg(parsed_globals)
|
3090
3454
|
|
3091
3455
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3114,11 +3478,11 @@ def doDescribeTrinoQueryInfo(args, parsed_globals):
|
|
3114
3478
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
3115
3479
|
client._sdkVersion += ("_CLI_" + __version__)
|
3116
3480
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3117
|
-
model = models.
|
3481
|
+
model = models.DescribeYarnScheduleHistoryRequest()
|
3118
3482
|
model.from_json_string(json.dumps(args))
|
3119
3483
|
start_time = time.time()
|
3120
3484
|
while True:
|
3121
|
-
rsp = client.
|
3485
|
+
rsp = client.DescribeYarnScheduleHistory(model)
|
3122
3486
|
result = rsp.to_json_string()
|
3123
3487
|
try:
|
3124
3488
|
json_obj = json.loads(result)
|
@@ -3189,6 +3553,58 @@ def doDescribeInstancesList(args, parsed_globals):
|
|
3189
3553
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3190
3554
|
|
3191
3555
|
|
3556
|
+
def doDescribeTrinoQueryInfo(args, parsed_globals):
|
3557
|
+
g_param = parse_global_arg(parsed_globals)
|
3558
|
+
|
3559
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3560
|
+
cred = credential.CVMRoleCredential()
|
3561
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3562
|
+
cred = credential.STSAssumeRoleCredential(
|
3563
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3564
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3565
|
+
)
|
3566
|
+
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):
|
3567
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3568
|
+
else:
|
3569
|
+
cred = credential.Credential(
|
3570
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3571
|
+
)
|
3572
|
+
http_profile = HttpProfile(
|
3573
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3574
|
+
reqMethod="POST",
|
3575
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3576
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3577
|
+
)
|
3578
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3579
|
+
if g_param[OptionsDefine.Language]:
|
3580
|
+
profile.language = g_param[OptionsDefine.Language]
|
3581
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3582
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
3583
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3584
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3585
|
+
model = models.DescribeTrinoQueryInfoRequest()
|
3586
|
+
model.from_json_string(json.dumps(args))
|
3587
|
+
start_time = time.time()
|
3588
|
+
while True:
|
3589
|
+
rsp = client.DescribeTrinoQueryInfo(model)
|
3590
|
+
result = rsp.to_json_string()
|
3591
|
+
try:
|
3592
|
+
json_obj = json.loads(result)
|
3593
|
+
except TypeError as e:
|
3594
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3595
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3596
|
+
break
|
3597
|
+
cur_time = time.time()
|
3598
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3599
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3600
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3601
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3602
|
+
else:
|
3603
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3604
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3605
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3606
|
+
|
3607
|
+
|
3192
3608
|
def doModifyResourcePools(args, parsed_globals):
|
3193
3609
|
g_param = parse_global_arg(parsed_globals)
|
3194
3610
|
|
@@ -3345,6 +3761,58 @@ def doDescribeEmrOverviewMetrics(args, parsed_globals):
|
|
3345
3761
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3346
3762
|
|
3347
3763
|
|
3764
|
+
def doModifyInstanceBasic(args, parsed_globals):
|
3765
|
+
g_param = parse_global_arg(parsed_globals)
|
3766
|
+
|
3767
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3768
|
+
cred = credential.CVMRoleCredential()
|
3769
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3770
|
+
cred = credential.STSAssumeRoleCredential(
|
3771
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3772
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3773
|
+
)
|
3774
|
+
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):
|
3775
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3776
|
+
else:
|
3777
|
+
cred = credential.Credential(
|
3778
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3779
|
+
)
|
3780
|
+
http_profile = HttpProfile(
|
3781
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3782
|
+
reqMethod="POST",
|
3783
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3784
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3785
|
+
)
|
3786
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3787
|
+
if g_param[OptionsDefine.Language]:
|
3788
|
+
profile.language = g_param[OptionsDefine.Language]
|
3789
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3790
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
3791
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3792
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3793
|
+
model = models.ModifyInstanceBasicRequest()
|
3794
|
+
model.from_json_string(json.dumps(args))
|
3795
|
+
start_time = time.time()
|
3796
|
+
while True:
|
3797
|
+
rsp = client.ModifyInstanceBasic(model)
|
3798
|
+
result = rsp.to_json_string()
|
3799
|
+
try:
|
3800
|
+
json_obj = json.loads(result)
|
3801
|
+
except TypeError as e:
|
3802
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3803
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3804
|
+
break
|
3805
|
+
cur_time = time.time()
|
3806
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3807
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3808
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3809
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3810
|
+
else:
|
3811
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3812
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3813
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3814
|
+
|
3815
|
+
|
3348
3816
|
def doModifyPodNum(args, parsed_globals):
|
3349
3817
|
g_param = parse_global_arg(parsed_globals)
|
3350
3818
|
|
@@ -3527,6 +3995,9 @@ ACTION_MAP = {
|
|
3527
3995
|
"DescribeAutoScaleRecords": doDescribeAutoScaleRecords,
|
3528
3996
|
"DescribeCvmQuota": doDescribeCvmQuota,
|
3529
3997
|
"ScaleOutInstance": doScaleOutInstance,
|
3998
|
+
"AttachDisks": doAttachDisks,
|
3999
|
+
"SetNodeResourceConfigDefault": doSetNodeResourceConfigDefault,
|
4000
|
+
"DescribeSLInstance": doDescribeSLInstance,
|
3530
4001
|
"DescribeStarRocksQueryInfo": doDescribeStarRocksQueryInfo,
|
3531
4002
|
"DescribeHBaseTableOverview": doDescribeHBaseTableOverview,
|
3532
4003
|
"AddMetricScaleStrategy": doAddMetricScaleStrategy,
|
@@ -3539,6 +4010,7 @@ ACTION_MAP = {
|
|
3539
4010
|
"DescribeUsersForUserManager": doDescribeUsersForUserManager,
|
3540
4011
|
"ModifyUserManagerPwd": doModifyUserManagerPwd,
|
3541
4012
|
"DeleteUserManagerUserList": doDeleteUserManagerUserList,
|
4013
|
+
"DeleteNodeResourceConfig": doDeleteNodeResourceConfig,
|
3542
4014
|
"TerminateSLInstance": doTerminateSLInstance,
|
3543
4015
|
"AddUsersForUserManager": doAddUsersForUserManager,
|
3544
4016
|
"ModifyAutoRenewFlag": doModifyAutoRenewFlag,
|
@@ -3552,30 +4024,35 @@ ACTION_MAP = {
|
|
3552
4024
|
"DescribeInstanceRenewNodes": doDescribeInstanceRenewNodes,
|
3553
4025
|
"DescribeHDFSStorageInfo": doDescribeHDFSStorageInfo,
|
3554
4026
|
"ModifyResourceScheduler": doModifyResourceScheduler,
|
4027
|
+
"DescribeNodeResourceConfigFast": doDescribeNodeResourceConfigFast,
|
3555
4028
|
"DescribeResourceScheduleDiffDetail": doDescribeResourceScheduleDiffDetail,
|
3556
|
-
"
|
4029
|
+
"SyncPodState": doSyncPodState,
|
3557
4030
|
"DescribeSparkQueries": doDescribeSparkQueries,
|
3558
4031
|
"CreateInstance": doCreateInstance,
|
4032
|
+
"ModifyResource": doModifyResource,
|
3559
4033
|
"InquiryPriceCreateInstance": doInquiryPriceCreateInstance,
|
3560
4034
|
"InquirePriceRenewEmr": doInquirePriceRenewEmr,
|
3561
4035
|
"DescribeResourceSchedule": doDescribeResourceSchedule,
|
3562
|
-
"
|
4036
|
+
"ResizeDataDisks": doResizeDataDisks,
|
3563
4037
|
"ModifyResourceScheduleConfig": doModifyResourceScheduleConfig,
|
3564
4038
|
"DescribeHiveQueries": doDescribeHiveQueries,
|
3565
4039
|
"StartStopServiceOrMonitor": doStartStopServiceOrMonitor,
|
3566
|
-
"
|
4040
|
+
"AddNodeResourceConfig": doAddNodeResourceConfig,
|
3567
4041
|
"ModifyGlobalConfig": doModifyGlobalConfig,
|
3568
4042
|
"TerminateInstance": doTerminateInstance,
|
3569
4043
|
"ModifySLInstance": doModifySLInstance,
|
4044
|
+
"DescribeNodeDataDisks": doDescribeNodeDataDisks,
|
3570
4045
|
"DescribeAutoScaleStrategies": doDescribeAutoScaleStrategies,
|
3571
4046
|
"DescribeGlobalConfig": doDescribeGlobalConfig,
|
3572
4047
|
"DescribeAutoScaleGroupGlobalConf": doDescribeAutoScaleGroupGlobalConf,
|
3573
4048
|
"DescribeClusterNodes": doDescribeClusterNodes,
|
3574
|
-
"
|
4049
|
+
"DescribeYarnScheduleHistory": doDescribeYarnScheduleHistory,
|
3575
4050
|
"DescribeInstancesList": doDescribeInstancesList,
|
4051
|
+
"DescribeTrinoQueryInfo": doDescribeTrinoQueryInfo,
|
3576
4052
|
"ModifyResourcePools": doModifyResourcePools,
|
3577
4053
|
"DescribeInsightList": doDescribeInsightList,
|
3578
4054
|
"DescribeEmrOverviewMetrics": doDescribeEmrOverviewMetrics,
|
4055
|
+
"ModifyInstanceBasic": doModifyInstanceBasic,
|
3579
4056
|
"ModifyPodNum": doModifyPodNum,
|
3580
4057
|
"ScaleOutCluster": doScaleOutCluster,
|
3581
4058
|
"RunJobFlow": doRunJobFlow,
|