tccli-intl-en 3.0.1168.1__py2.py3-none-any.whl → 3.1.16.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/argument.py +1 -1
- tccli/plugins/sso/__init__.py +14 -0
- tccli/plugins/sso/login.py +23 -6
- tccli/plugins/sso/texts.py +4 -0
- tccli/services/__init__.py +49 -2
- tccli/services/advisor/advisor_client.py +10 -4
- tccli/services/ai3d/__init__.py +4 -0
- tccli/services/ai3d/ai3d_client.py +266 -0
- tccli/services/ai3d/v20250513/api.json +264 -0
- tccli/services/ai3d/v20250513/examples.json +20 -0
- tccli/services/aiart/aiart_client.py +5 -2
- tccli/services/ams/ams_client.py +20 -8
- tccli/services/antiddos/antiddos_client.py +350 -140
- tccli/services/apigateway/apigateway_client.py +465 -186
- tccli/services/apm/apm_client.py +835 -68
- tccli/services/apm/v20210622/api.json +3936 -1145
- tccli/services/apm/v20210622/examples.json +133 -23
- tccli/services/asr/asr_client.py +10 -4
- tccli/services/autoscaling/autoscaling_client.py +341 -114
- tccli/services/autoscaling/v20180419/api.json +514 -333
- tccli/services/autoscaling/v20180419/examples.json +46 -38
- tccli/services/batch/batch_client.py +140 -56
- tccli/services/bi/__init__.py +4 -0
- tccli/services/bi/bi_client.py +1498 -0
- tccli/services/bi/v20220105/api.json +5769 -0
- tccli/services/bi/v20220105/examples.json +215 -0
- tccli/services/billing/billing_client.py +1055 -134
- tccli/services/billing/v20180709/api.json +1654 -243
- tccli/services/billing/v20180709/examples.json +169 -25
- tccli/services/cam/cam_client.py +405 -162
- tccli/services/captcha/captcha_client.py +5 -2
- tccli/services/captcha/v20190722/api.json +16 -6
- tccli/services/captcha/v20190722/examples.json +3 -3
- tccli/services/car/car_client.py +165 -66
- tccli/services/cbs/cbs_client.py +190 -76
- tccli/services/ccc/ccc_client.py +1167 -268
- tccli/services/ccc/v20200210/api.json +2263 -202
- tccli/services/ccc/v20200210/examples.json +116 -12
- tccli/services/cdb/cdb_client.py +665 -266
- tccli/services/cdb/v20170320/api.json +426 -173
- tccli/services/cdb/v20170320/examples.json +6 -6
- tccli/services/cdc/cdc_client.py +100 -40
- tccli/services/cdc/v20201214/api.json +2 -2
- tccli/services/cdc/v20201214/examples.json +4 -4
- tccli/services/cdn/cdn_client.py +220 -88
- tccli/services/cdwdoris/cdwdoris_client.py +385 -154
- tccli/services/cdwpg/cdwpg_client.py +120 -48
- tccli/services/cdz/__init__.py +4 -0
- tccli/services/cdz/cdz_client.py +210 -0
- tccli/services/cdz/v20221123/api.json +233 -0
- tccli/services/cdz/v20221123/examples.json +12 -0
- tccli/services/cfg/cfg_client.py +80 -32
- tccli/services/cfg/v20210820/api.json +30 -10
- tccli/services/cfg/v20210820/examples.json +1 -1
- tccli/services/cfs/cfs_client.py +195 -78
- tccli/services/cfw/cfw_client.py +330 -132
- tccli/services/chdfs/chdfs_client.py +145 -58
- tccli/services/ciam/ciam_client.py +80 -32
- tccli/services/ckafka/ckafka_client.py +1033 -255
- tccli/services/ckafka/v20190819/api.json +3378 -1681
- tccli/services/ckafka/v20190819/examples.json +254 -160
- tccli/services/clb/clb_client.py +1054 -469
- tccli/services/clb/v20180317/api.json +2307 -1024
- tccli/services/clb/v20180317/examples.json +186 -126
- tccli/services/cloudaudit/cloudaudit_client.py +90 -36
- tccli/services/cls/cls_client.py +434 -173
- tccli/services/cmq/cmq_client.py +14 -803
- tccli/services/cmq/v20190304/api.json +173 -1367
- tccli/services/cmq/v20190304/examples.json +0 -120
- tccli/services/config/config_client.py +30 -12
- tccli/services/controlcenter/controlcenter_client.py +229 -2
- tccli/services/controlcenter/v20230110/api.json +528 -5
- tccli/services/controlcenter/v20230110/examples.json +32 -0
- tccli/services/csip/csip_client.py +339 -78
- tccli/services/csip/v20221121/api.json +1011 -38
- tccli/services/csip/v20221121/examples.json +24 -0
- tccli/services/ctsdb/__init__.py +4 -0
- tccli/services/ctsdb/ctsdb_client.py +266 -0
- tccli/services/ctsdb/v20230202/api.json +677 -0
- tccli/services/ctsdb/v20230202/examples.json +20 -0
- tccli/services/cvm/cvm_client.py +706 -189
- tccli/services/cvm/v20170312/api.json +1141 -510
- tccli/services/cvm/v20170312/examples.json +174 -128
- tccli/services/cwp/cwp_client.py +2325 -930
- tccli/services/cynosdb/cynosdb_client.py +3051 -575
- tccli/services/cynosdb/v20190107/api.json +14074 -7139
- tccli/services/cynosdb/v20190107/examples.json +597 -287
- tccli/services/dataintegration/dataintegration_client.py +5 -2
- tccli/services/dayu/dayu_client.py +515 -206
- tccli/services/dbbrain/dbbrain_client.py +210 -84
- tccli/services/dc/dc_client.py +90 -36
- tccli/services/dcdb/dcdb_client.py +310 -124
- tccli/services/dlc/dlc_client.py +859 -214
- tccli/services/dlc/v20210125/api.json +637 -13
- tccli/services/dlc/v20210125/examples.json +48 -0
- tccli/services/dms/dms_client.py +10 -4
- tccli/services/dnspod/dnspod_client.py +390 -111
- tccli/services/dnspod/v20210323/api.json +196 -0
- tccli/services/dnspod/v20210323/examples.json +24 -0
- tccli/services/domain/domain_client.py +120 -48
- tccli/services/dts/dts_client.py +415 -166
- tccli/services/eb/eb_client.py +130 -52
- tccli/services/ecdn/ecdn_client.py +75 -30
- tccli/services/ecm/ecm_client.py +620 -248
- tccli/services/eiam/eiam_client.py +200 -80
- tccli/services/emr/emr_client.py +3104 -117
- tccli/services/emr/v20190103/api.json +15311 -4361
- tccli/services/emr/v20190103/examples.json +452 -42
- tccli/services/es/es_client.py +105 -42
- tccli/services/facefusion/facefusion_client.py +15 -6
- tccli/services/faceid/faceid_client.py +95 -38
- tccli/services/faceid/v20180301/api.json +172 -45
- tccli/services/faceid/v20180301/examples.json +3 -3
- tccli/services/gaap/gaap_client.py +440 -176
- tccli/services/gme/gme_client.py +50 -20
- tccli/services/gpm/gpm_client.py +90 -36
- tccli/services/gse/gse_client.py +110 -44
- tccli/services/gwlb/gwlb_client.py +90 -36
- tccli/services/hunyuan/__init__.py +4 -0
- tccli/services/hunyuan/hunyuan_client.py +266 -0
- tccli/services/hunyuan/v20230901/api.json +270 -0
- tccli/services/hunyuan/v20230901/examples.json +20 -0
- tccli/services/iai/iai_client.py +145 -58
- tccli/services/iai/v20200303/api.json +187 -51
- tccli/services/iai/v20200303/examples.json +30 -12
- tccli/services/iap/iap_client.py +30 -12
- tccli/services/ims/ims_client.py +5 -2
- tccli/services/ims/v20201229/api.json +133 -141
- tccli/services/ims/v20201229/examples.json +3 -3
- tccli/services/intlpartnersmgt/intlpartnersmgt_client.py +516 -72
- tccli/services/intlpartnersmgt/v20220928/api.json +976 -60
- tccli/services/intlpartnersmgt/v20220928/examples.json +50 -2
- tccli/services/iotcloud/iotcloud_client.py +100 -40
- tccli/services/iotcloud/v20210408/api.json +216 -107
- tccli/services/iotcloud/v20210408/examples.json +9 -9
- tccli/services/ip/ip_client.py +30 -12
- tccli/services/kms/kms_client.py +1226 -227
- tccli/services/kms/v20190118/api.json +1562 -144
- tccli/services/kms/v20190118/examples.json +204 -78
- tccli/services/lcic/lcic_client.py +265 -106
- tccli/services/lighthouse/lighthouse_client.py +370 -148
- tccli/services/lighthouse/v20200324/api.json +14 -14
- tccli/services/lighthouse/v20200324/examples.json +5 -5
- tccli/services/live/live_client.py +804 -232
- tccli/services/live/v20180801/api.json +272 -0
- tccli/services/live/v20180801/examples.json +32 -0
- tccli/services/lke/__init__.py +4 -0
- tccli/services/lke/lke_client.py +5194 -0
- tccli/services/lke/v20231130/api.json +14803 -0
- tccli/services/lke/v20231130/examples.json +736 -0
- tccli/services/lkeap/__init__.py +4 -0
- tccli/services/lkeap/lkeap_client.py +602 -0
- tccli/services/lkeap/v20240522/api.json +953 -0
- tccli/services/lkeap/v20240522/examples.json +92 -0
- tccli/services/mariadb/mariadb_client.py +250 -100
- tccli/services/mdc/mdc_client.py +90 -36
- tccli/services/mdl/mdl_client.py +402 -82
- tccli/services/mdl/v20200326/api.json +1144 -58
- tccli/services/mdl/v20200326/examples.json +48 -16
- tccli/services/mdp/mdp_client.py +785 -122
- tccli/services/mdp/v20200527/api.json +1168 -44
- tccli/services/mdp/v20200527/examples.json +151 -79
- tccli/services/message/__init__.py +4 -0
- tccli/services/message/message_client.py +210 -0
- tccli/services/message/v20181225/api.json +72 -0
- tccli/services/message/v20181225/examples.json +13 -0
- tccli/services/mongodb/mongodb_client.py +1452 -136
- tccli/services/mongodb/v20190725/api.json +4393 -1462
- tccli/services/mongodb/v20190725/examples.json +265 -71
- tccli/services/monitor/monitor_client.py +1008 -296
- tccli/services/monitor/v20180724/api.json +660 -11
- tccli/services/monitor/v20180724/examples.json +152 -4
- tccli/services/mps/mps_client.py +1573 -354
- tccli/services/mps/v20190612/api.json +12394 -7243
- tccli/services/mps/v20190612/examples.json +244 -84
- tccli/services/msp/msp_client.py +35 -14
- tccli/services/ocr/ocr_client.py +596 -102
- tccli/services/ocr/v20181119/api.json +2271 -181
- tccli/services/ocr/v20181119/examples.json +70 -8
- tccli/services/omics/omics_client.py +100 -40
- tccli/services/organization/organization_client.py +580 -232
- tccli/services/postgres/postgres_client.py +455 -182
- tccli/services/postgres/v20170312/api.json +134 -109
- tccli/services/postgres/v20170312/examples.json +14 -14
- tccli/services/privatedns/privatedns_client.py +206 -60
- tccli/services/privatedns/v20201028/api.json +179 -0
- tccli/services/privatedns/v20201028/examples.json +8 -0
- tccli/services/pts/pts_client.py +240 -96
- tccli/services/quota/__init__.py +4 -0
- tccli/services/quota/quota_client.py +434 -0
- tccli/services/quota/v20241204/api.json +548 -0
- tccli/services/quota/v20241204/examples.json +51 -0
- tccli/services/rce/rce_client.py +5 -2
- tccli/services/redis/redis_client.py +698 -212
- tccli/services/redis/v20180412/api.json +968 -563
- tccli/services/redis/v20180412/examples.json +98 -56
- tccli/services/region/__init__.py +4 -0
- tccli/services/region/region_client.py +322 -0
- tccli/services/region/v20220627/api.json +399 -0
- tccli/services/region/v20220627/examples.json +29 -0
- tccli/services/rum/rum_client.py +300 -120
- tccli/services/scf/scf_client.py +210 -84
- tccli/services/ses/ses_client.py +368 -69
- tccli/services/ses/v20201002/api.json +240 -0
- tccli/services/ses/v20201002/examples.json +32 -0
- tccli/services/smh/__init__.py +4 -0
- tccli/services/smh/smh_client.py +714 -0
- tccli/services/smh/v20210712/api.json +1287 -0
- tccli/services/smh/v20210712/examples.json +85 -0
- tccli/services/sms/sms_client.py +90 -36
- tccli/services/sqlserver/sqlserver_client.py +3855 -470
- tccli/services/sqlserver/v20180328/api.json +9757 -3347
- tccli/services/sqlserver/v20180328/examples.json +480 -20
- tccli/services/ssl/ssl_client.py +504 -72
- tccli/services/ssl/v20191205/api.json +789 -21
- tccli/services/ssl/v20191205/examples.json +54 -0
- tccli/services/ssm/ssm_client.py +120 -48
- tccli/services/sts/sts_client.py +25 -10
- tccli/services/tag/tag_client.py +150 -60
- tccli/services/tat/tat_client.py +95 -38
- tccli/services/tbaas/__init__.py +4 -0
- tccli/services/tbaas/tbaas_client.py +378 -0
- tccli/services/tbaas/v20180416/api.json +551 -0
- tccli/services/tbaas/v20180416/examples.json +37 -0
- tccli/services/tcaplusdb/tcaplusdb_client.py +260 -104
- tccli/services/tcaplusdb/v20190823/api.json +836 -760
- tccli/services/tcaplusdb/v20190823/examples.json +3 -3
- tccli/services/tchd/tchd_client.py +5 -2
- tccli/services/tcmpp/tcmpp_client.py +520 -208
- tccli/services/tcr/tcr_client.py +380 -152
- tccli/services/tcsas/tcsas_client.py +295 -118
- tccli/services/tcsas/v20250106/api.json +155 -79
- tccli/services/tcsas/v20250106/examples.json +3 -3
- tccli/services/tcss/tcss_client.py +1650 -660
- tccli/services/tdid/tdid_client.py +240 -96
- tccli/services/tdmq/tdmq_client.py +2876 -466
- tccli/services/tdmq/v20200217/api.json +11607 -3958
- tccli/services/tdmq/v20200217/examples.json +562 -264
- tccli/services/tem/tem_client.py +280 -112
- tccli/services/teo/teo_client.py +4507 -966
- tccli/services/teo/v20220901/api.json +7341 -1405
- tccli/services/teo/v20220901/examples.json +679 -99
- tccli/services/tione/__init__.py +4 -0
- tccli/services/tione/tione_client.py +210 -0
- tccli/services/tione/v20211111/api.json +3074 -0
- tccli/services/tione/v20211111/examples.json +12 -0
- tccli/services/tiw/tiw_client.py +255 -102
- tccli/services/tke/tke_client.py +741 -274
- tccli/services/tke/v20180525/api.json +132 -7
- tccli/services/tke/v20180525/examples.json +42 -16
- tccli/services/tms/tms_client.py +5 -2
- tccli/services/tms/v20201229/api.json +91 -100
- tccli/services/tmt/tmt_client.py +5 -2
- tccli/services/trabbit/__init__.py +4 -0
- tccli/services/trabbit/trabbit_client.py +1778 -0
- tccli/services/trabbit/v20230418/api.json +4772 -0
- tccli/services/trabbit/v20230418/examples.json +237 -0
- tccli/services/trocket/__init__.py +4 -0
- tccli/services/trocket/trocket_client.py +2450 -0
- tccli/services/trocket/v20230308/api.json +6062 -0
- tccli/services/trocket/v20230308/examples.json +339 -0
- tccli/services/trro/trro_client.py +95 -38
- tccli/services/trtc/trtc_client.py +928 -192
- tccli/services/trtc/v20190722/api.json +1810 -256
- tccli/services/trtc/v20190722/examples.json +100 -6
- tccli/services/tts/tts_client.py +5 -2
- tccli/services/vclm/vclm_client.py +10 -4
- tccli/services/vm/v20210922/api.json +61 -30
- tccli/services/vm/v20210922/examples.json +0 -12
- tccli/services/vm/vm_client.py +20 -8
- tccli/services/vod/v20180717/api.json +332 -52
- tccli/services/vod/v20180717/examples.json +9 -1
- tccli/services/vod/v20240718/api.json +1105 -0
- tccli/services/vod/v20240718/examples.json +97 -0
- tccli/services/vod/vod_client.py +1316 -350
- tccli/services/vpc/v20170312/api.json +1166 -106
- tccli/services/vpc/v20170312/examples.json +197 -23
- tccli/services/vpc/vpc_client.py +2413 -739
- tccli/services/waf/v20180125/api.json +1372 -194
- tccli/services/waf/v20180125/examples.json +89 -1
- tccli/services/waf/waf_client.py +1149 -245
- tccli/services/wedata/v20210820/api.json +1577 -231
- tccli/services/wedata/v20210820/examples.json +74 -12
- tccli/services/wedata/v20250806/api.json +13644 -0
- tccli/services/wedata/v20250806/examples.json +621 -0
- tccli/services/wedata/wedata_client.py +6366 -1191
- tccli/services/yunjing/yunjing_client.py +355 -142
- {tccli_intl_en-3.0.1168.1.dist-info → tccli_intl_en-3.1.16.1.dist-info}/METADATA +4 -7
- {tccli_intl_en-3.0.1168.1.dist-info → tccli_intl_en-3.1.16.1.dist-info}/RECORD +294 -230
- {tccli_intl_en-3.0.1168.1.dist-info → tccli_intl_en-3.1.16.1.dist-info}/WHEEL +1 -1
- {tccli_intl_en-3.0.1168.1.dist-info → tccli_intl_en-3.1.16.1.dist-info}/entry_points.txt +0 -1
- {tccli_intl_en-3.0.1168.1.dist-info → tccli_intl_en-3.1.16.1.dist-info}/LICENSE +0 -0
- {tccli_intl_en-3.0.1168.1.dist-info → tccli_intl_en-3.1.16.1.dist-info}/top_level.txt +0 -0
tccli/services/emr/emr_client.py
CHANGED
|
@@ -27,7 +27,10 @@ def doModifyResourcesTags(args, parsed_globals):
|
|
|
27
27
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
28
28
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
29
29
|
)
|
|
30
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
30
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
31
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
32
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
33
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
31
34
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
32
35
|
else:
|
|
33
36
|
cred = credential.Credential(
|
|
@@ -39,7 +42,7 @@ def doModifyResourcesTags(args, parsed_globals):
|
|
|
39
42
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
40
43
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
41
44
|
)
|
|
42
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
45
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
43
46
|
if g_param[OptionsDefine.Language]:
|
|
44
47
|
profile.language = g_param[OptionsDefine.Language]
|
|
45
48
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
@@ -79,7 +82,10 @@ def doInquiryPriceUpdateInstance(args, parsed_globals):
|
|
|
79
82
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
80
83
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
81
84
|
)
|
|
82
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
85
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
86
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
87
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
88
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
83
89
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
84
90
|
else:
|
|
85
91
|
cred = credential.Credential(
|
|
@@ -91,7 +97,7 @@ def doInquiryPriceUpdateInstance(args, parsed_globals):
|
|
|
91
97
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
92
98
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
93
99
|
)
|
|
94
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
100
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
95
101
|
if g_param[OptionsDefine.Language]:
|
|
96
102
|
profile.language = g_param[OptionsDefine.Language]
|
|
97
103
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
@@ -131,7 +137,10 @@ def doCreateCluster(args, parsed_globals):
|
|
|
131
137
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
132
138
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
133
139
|
)
|
|
134
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
140
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
141
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
142
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
143
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
135
144
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
136
145
|
else:
|
|
137
146
|
cred = credential.Credential(
|
|
@@ -143,7 +152,7 @@ def doCreateCluster(args, parsed_globals):
|
|
|
143
152
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
144
153
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
145
154
|
)
|
|
146
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
155
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
147
156
|
if g_param[OptionsDefine.Language]:
|
|
148
157
|
profile.language = g_param[OptionsDefine.Language]
|
|
149
158
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
@@ -173,6 +182,61 @@ def doCreateCluster(args, parsed_globals):
|
|
|
173
182
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
174
183
|
|
|
175
184
|
|
|
185
|
+
def doDescribeServiceConfGroupInfos(args, parsed_globals):
|
|
186
|
+
g_param = parse_global_arg(parsed_globals)
|
|
187
|
+
|
|
188
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
189
|
+
cred = credential.CVMRoleCredential()
|
|
190
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
191
|
+
cred = credential.STSAssumeRoleCredential(
|
|
192
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
193
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
194
|
+
)
|
|
195
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
196
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
197
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
198
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
199
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
200
|
+
else:
|
|
201
|
+
cred = credential.Credential(
|
|
202
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
203
|
+
)
|
|
204
|
+
http_profile = HttpProfile(
|
|
205
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
206
|
+
reqMethod="POST",
|
|
207
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
208
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
209
|
+
)
|
|
210
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
211
|
+
if g_param[OptionsDefine.Language]:
|
|
212
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
213
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
214
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
215
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
216
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
217
|
+
model = models.DescribeServiceConfGroupInfosRequest()
|
|
218
|
+
model.from_json_string(json.dumps(args))
|
|
219
|
+
start_time = time.time()
|
|
220
|
+
while True:
|
|
221
|
+
rsp = client.DescribeServiceConfGroupInfos(model)
|
|
222
|
+
result = rsp.to_json_string()
|
|
223
|
+
try:
|
|
224
|
+
json_obj = json.loads(result)
|
|
225
|
+
except TypeError as e:
|
|
226
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
227
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
228
|
+
break
|
|
229
|
+
cur_time = time.time()
|
|
230
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
231
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
232
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
233
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
234
|
+
else:
|
|
235
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
236
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
237
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
238
|
+
|
|
239
|
+
|
|
176
240
|
def doInquiryPriceRenewInstance(args, parsed_globals):
|
|
177
241
|
g_param = parse_global_arg(parsed_globals)
|
|
178
242
|
|
|
@@ -183,7 +247,2650 @@ def doInquiryPriceRenewInstance(args, parsed_globals):
|
|
|
183
247
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
184
248
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
185
249
|
)
|
|
186
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
250
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
251
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
252
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
253
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
254
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
255
|
+
else:
|
|
256
|
+
cred = credential.Credential(
|
|
257
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
258
|
+
)
|
|
259
|
+
http_profile = HttpProfile(
|
|
260
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
261
|
+
reqMethod="POST",
|
|
262
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
263
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
264
|
+
)
|
|
265
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
266
|
+
if g_param[OptionsDefine.Language]:
|
|
267
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
268
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
269
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
270
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
271
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
272
|
+
model = models.InquiryPriceRenewInstanceRequest()
|
|
273
|
+
model.from_json_string(json.dumps(args))
|
|
274
|
+
start_time = time.time()
|
|
275
|
+
while True:
|
|
276
|
+
rsp = client.InquiryPriceRenewInstance(model)
|
|
277
|
+
result = rsp.to_json_string()
|
|
278
|
+
try:
|
|
279
|
+
json_obj = json.loads(result)
|
|
280
|
+
except TypeError as e:
|
|
281
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
282
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
283
|
+
break
|
|
284
|
+
cur_time = time.time()
|
|
285
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
286
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
287
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
288
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
289
|
+
else:
|
|
290
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
291
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
292
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
def doDescribeGroupsSTD(args, parsed_globals):
|
|
296
|
+
g_param = parse_global_arg(parsed_globals)
|
|
297
|
+
|
|
298
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
299
|
+
cred = credential.CVMRoleCredential()
|
|
300
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
301
|
+
cred = credential.STSAssumeRoleCredential(
|
|
302
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
303
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
304
|
+
)
|
|
305
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
306
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
307
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
308
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
309
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
310
|
+
else:
|
|
311
|
+
cred = credential.Credential(
|
|
312
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
313
|
+
)
|
|
314
|
+
http_profile = HttpProfile(
|
|
315
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
316
|
+
reqMethod="POST",
|
|
317
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
318
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
319
|
+
)
|
|
320
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
321
|
+
if g_param[OptionsDefine.Language]:
|
|
322
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
323
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
324
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
325
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
326
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
327
|
+
model = models.DescribeGroupsSTDRequest()
|
|
328
|
+
model.from_json_string(json.dumps(args))
|
|
329
|
+
start_time = time.time()
|
|
330
|
+
while True:
|
|
331
|
+
rsp = client.DescribeGroupsSTD(model)
|
|
332
|
+
result = rsp.to_json_string()
|
|
333
|
+
try:
|
|
334
|
+
json_obj = json.loads(result)
|
|
335
|
+
except TypeError as e:
|
|
336
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
337
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
338
|
+
break
|
|
339
|
+
cur_time = time.time()
|
|
340
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
341
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
342
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
343
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
344
|
+
else:
|
|
345
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
346
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
347
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
def doDescribeYarnQueue(args, parsed_globals):
|
|
351
|
+
g_param = parse_global_arg(parsed_globals)
|
|
352
|
+
|
|
353
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
354
|
+
cred = credential.CVMRoleCredential()
|
|
355
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
356
|
+
cred = credential.STSAssumeRoleCredential(
|
|
357
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
358
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
359
|
+
)
|
|
360
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
361
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
362
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
363
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
364
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
365
|
+
else:
|
|
366
|
+
cred = credential.Credential(
|
|
367
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
368
|
+
)
|
|
369
|
+
http_profile = HttpProfile(
|
|
370
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
371
|
+
reqMethod="POST",
|
|
372
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
373
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
374
|
+
)
|
|
375
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
376
|
+
if g_param[OptionsDefine.Language]:
|
|
377
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
378
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
379
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
380
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
381
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
382
|
+
model = models.DescribeYarnQueueRequest()
|
|
383
|
+
model.from_json_string(json.dumps(args))
|
|
384
|
+
start_time = time.time()
|
|
385
|
+
while True:
|
|
386
|
+
rsp = client.DescribeYarnQueue(model)
|
|
387
|
+
result = rsp.to_json_string()
|
|
388
|
+
try:
|
|
389
|
+
json_obj = json.loads(result)
|
|
390
|
+
except TypeError as e:
|
|
391
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
392
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
393
|
+
break
|
|
394
|
+
cur_time = time.time()
|
|
395
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
396
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
397
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
398
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
399
|
+
else:
|
|
400
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
401
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
402
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
def doModifyYarnQueueV2(args, parsed_globals):
|
|
406
|
+
g_param = parse_global_arg(parsed_globals)
|
|
407
|
+
|
|
408
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
409
|
+
cred = credential.CVMRoleCredential()
|
|
410
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
411
|
+
cred = credential.STSAssumeRoleCredential(
|
|
412
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
413
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
414
|
+
)
|
|
415
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
416
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
417
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
418
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
419
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
420
|
+
else:
|
|
421
|
+
cred = credential.Credential(
|
|
422
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
423
|
+
)
|
|
424
|
+
http_profile = HttpProfile(
|
|
425
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
426
|
+
reqMethod="POST",
|
|
427
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
428
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
429
|
+
)
|
|
430
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
431
|
+
if g_param[OptionsDefine.Language]:
|
|
432
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
433
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
434
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
435
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
436
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
437
|
+
model = models.ModifyYarnQueueV2Request()
|
|
438
|
+
model.from_json_string(json.dumps(args))
|
|
439
|
+
start_time = time.time()
|
|
440
|
+
while True:
|
|
441
|
+
rsp = client.ModifyYarnQueueV2(model)
|
|
442
|
+
result = rsp.to_json_string()
|
|
443
|
+
try:
|
|
444
|
+
json_obj = json.loads(result)
|
|
445
|
+
except TypeError as e:
|
|
446
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
447
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
448
|
+
break
|
|
449
|
+
cur_time = time.time()
|
|
450
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
451
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
452
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
453
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
454
|
+
else:
|
|
455
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
456
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
457
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
def doDeployYarnConf(args, parsed_globals):
|
|
461
|
+
g_param = parse_global_arg(parsed_globals)
|
|
462
|
+
|
|
463
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
464
|
+
cred = credential.CVMRoleCredential()
|
|
465
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
466
|
+
cred = credential.STSAssumeRoleCredential(
|
|
467
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
468
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
469
|
+
)
|
|
470
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
471
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
472
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
473
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
474
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
475
|
+
else:
|
|
476
|
+
cred = credential.Credential(
|
|
477
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
478
|
+
)
|
|
479
|
+
http_profile = HttpProfile(
|
|
480
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
481
|
+
reqMethod="POST",
|
|
482
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
483
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
484
|
+
)
|
|
485
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
486
|
+
if g_param[OptionsDefine.Language]:
|
|
487
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
488
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
489
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
490
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
491
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
492
|
+
model = models.DeployYarnConfRequest()
|
|
493
|
+
model.from_json_string(json.dumps(args))
|
|
494
|
+
start_time = time.time()
|
|
495
|
+
while True:
|
|
496
|
+
rsp = client.DeployYarnConf(model)
|
|
497
|
+
result = rsp.to_json_string()
|
|
498
|
+
try:
|
|
499
|
+
json_obj = json.loads(result)
|
|
500
|
+
except TypeError as e:
|
|
501
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
502
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
503
|
+
break
|
|
504
|
+
cur_time = time.time()
|
|
505
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
506
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
507
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
508
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
509
|
+
else:
|
|
510
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
511
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
512
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
def doDescribeClusterFlowStatusDetail(args, parsed_globals):
|
|
516
|
+
g_param = parse_global_arg(parsed_globals)
|
|
517
|
+
|
|
518
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
519
|
+
cred = credential.CVMRoleCredential()
|
|
520
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
521
|
+
cred = credential.STSAssumeRoleCredential(
|
|
522
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
523
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
524
|
+
)
|
|
525
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
526
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
527
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
528
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
529
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
530
|
+
else:
|
|
531
|
+
cred = credential.Credential(
|
|
532
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
533
|
+
)
|
|
534
|
+
http_profile = HttpProfile(
|
|
535
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
536
|
+
reqMethod="POST",
|
|
537
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
538
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
539
|
+
)
|
|
540
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
541
|
+
if g_param[OptionsDefine.Language]:
|
|
542
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
543
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
544
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
545
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
546
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
547
|
+
model = models.DescribeClusterFlowStatusDetailRequest()
|
|
548
|
+
model.from_json_string(json.dumps(args))
|
|
549
|
+
start_time = time.time()
|
|
550
|
+
while True:
|
|
551
|
+
rsp = client.DescribeClusterFlowStatusDetail(model)
|
|
552
|
+
result = rsp.to_json_string()
|
|
553
|
+
try:
|
|
554
|
+
json_obj = json.loads(result)
|
|
555
|
+
except TypeError as e:
|
|
556
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
557
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
558
|
+
break
|
|
559
|
+
cur_time = time.time()
|
|
560
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
561
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
562
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
563
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
564
|
+
else:
|
|
565
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
566
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
567
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
def doInquiryPriceScaleOutInstance(args, parsed_globals):
|
|
571
|
+
g_param = parse_global_arg(parsed_globals)
|
|
572
|
+
|
|
573
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
574
|
+
cred = credential.CVMRoleCredential()
|
|
575
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
576
|
+
cred = credential.STSAssumeRoleCredential(
|
|
577
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
578
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
579
|
+
)
|
|
580
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
581
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
582
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
583
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
584
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
585
|
+
else:
|
|
586
|
+
cred = credential.Credential(
|
|
587
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
588
|
+
)
|
|
589
|
+
http_profile = HttpProfile(
|
|
590
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
591
|
+
reqMethod="POST",
|
|
592
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
593
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
594
|
+
)
|
|
595
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
596
|
+
if g_param[OptionsDefine.Language]:
|
|
597
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
598
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
599
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
600
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
601
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
602
|
+
model = models.InquiryPriceScaleOutInstanceRequest()
|
|
603
|
+
model.from_json_string(json.dumps(args))
|
|
604
|
+
start_time = time.time()
|
|
605
|
+
while True:
|
|
606
|
+
rsp = client.InquiryPriceScaleOutInstance(model)
|
|
607
|
+
result = rsp.to_json_string()
|
|
608
|
+
try:
|
|
609
|
+
json_obj = json.loads(result)
|
|
610
|
+
except TypeError as e:
|
|
611
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
612
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
613
|
+
break
|
|
614
|
+
cur_time = time.time()
|
|
615
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
616
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
617
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
618
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
619
|
+
else:
|
|
620
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
621
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
622
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
def doDescribeAutoScaleRecords(args, parsed_globals):
|
|
626
|
+
g_param = parse_global_arg(parsed_globals)
|
|
627
|
+
|
|
628
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
629
|
+
cred = credential.CVMRoleCredential()
|
|
630
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
631
|
+
cred = credential.STSAssumeRoleCredential(
|
|
632
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
633
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
634
|
+
)
|
|
635
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
636
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
637
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
638
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
639
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
640
|
+
else:
|
|
641
|
+
cred = credential.Credential(
|
|
642
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
643
|
+
)
|
|
644
|
+
http_profile = HttpProfile(
|
|
645
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
646
|
+
reqMethod="POST",
|
|
647
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
648
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
649
|
+
)
|
|
650
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
651
|
+
if g_param[OptionsDefine.Language]:
|
|
652
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
653
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
654
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
655
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
656
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
657
|
+
model = models.DescribeAutoScaleRecordsRequest()
|
|
658
|
+
model.from_json_string(json.dumps(args))
|
|
659
|
+
start_time = time.time()
|
|
660
|
+
while True:
|
|
661
|
+
rsp = client.DescribeAutoScaleRecords(model)
|
|
662
|
+
result = rsp.to_json_string()
|
|
663
|
+
try:
|
|
664
|
+
json_obj = json.loads(result)
|
|
665
|
+
except TypeError as e:
|
|
666
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
667
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
668
|
+
break
|
|
669
|
+
cur_time = time.time()
|
|
670
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
671
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
672
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
673
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
674
|
+
else:
|
|
675
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
676
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
677
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
def doDescribeEmrOverviewMetrics(args, parsed_globals):
|
|
681
|
+
g_param = parse_global_arg(parsed_globals)
|
|
682
|
+
|
|
683
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
684
|
+
cred = credential.CVMRoleCredential()
|
|
685
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
686
|
+
cred = credential.STSAssumeRoleCredential(
|
|
687
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
688
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
689
|
+
)
|
|
690
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
691
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
692
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
693
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
694
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
695
|
+
else:
|
|
696
|
+
cred = credential.Credential(
|
|
697
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
698
|
+
)
|
|
699
|
+
http_profile = HttpProfile(
|
|
700
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
701
|
+
reqMethod="POST",
|
|
702
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
703
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
704
|
+
)
|
|
705
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
706
|
+
if g_param[OptionsDefine.Language]:
|
|
707
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
708
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
709
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
710
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
711
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
712
|
+
model = models.DescribeEmrOverviewMetricsRequest()
|
|
713
|
+
model.from_json_string(json.dumps(args))
|
|
714
|
+
start_time = time.time()
|
|
715
|
+
while True:
|
|
716
|
+
rsp = client.DescribeEmrOverviewMetrics(model)
|
|
717
|
+
result = rsp.to_json_string()
|
|
718
|
+
try:
|
|
719
|
+
json_obj = json.loads(result)
|
|
720
|
+
except TypeError as e:
|
|
721
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
722
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
723
|
+
break
|
|
724
|
+
cur_time = time.time()
|
|
725
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
726
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
727
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
728
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
729
|
+
else:
|
|
730
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
731
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
732
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
def doScaleOutInstance(args, parsed_globals):
|
|
736
|
+
g_param = parse_global_arg(parsed_globals)
|
|
737
|
+
|
|
738
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
739
|
+
cred = credential.CVMRoleCredential()
|
|
740
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
741
|
+
cred = credential.STSAssumeRoleCredential(
|
|
742
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
743
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
744
|
+
)
|
|
745
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
746
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
747
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
748
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
749
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
750
|
+
else:
|
|
751
|
+
cred = credential.Credential(
|
|
752
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
753
|
+
)
|
|
754
|
+
http_profile = HttpProfile(
|
|
755
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
756
|
+
reqMethod="POST",
|
|
757
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
758
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
759
|
+
)
|
|
760
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
761
|
+
if g_param[OptionsDefine.Language]:
|
|
762
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
763
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
764
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
765
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
766
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
767
|
+
model = models.ScaleOutInstanceRequest()
|
|
768
|
+
model.from_json_string(json.dumps(args))
|
|
769
|
+
start_time = time.time()
|
|
770
|
+
while True:
|
|
771
|
+
rsp = client.ScaleOutInstance(model)
|
|
772
|
+
result = rsp.to_json_string()
|
|
773
|
+
try:
|
|
774
|
+
json_obj = json.loads(result)
|
|
775
|
+
except TypeError as e:
|
|
776
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
777
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
778
|
+
break
|
|
779
|
+
cur_time = time.time()
|
|
780
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
781
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
782
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
783
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
784
|
+
else:
|
|
785
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
786
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
787
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
def doAttachDisks(args, parsed_globals):
|
|
791
|
+
g_param = parse_global_arg(parsed_globals)
|
|
792
|
+
|
|
793
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
794
|
+
cred = credential.CVMRoleCredential()
|
|
795
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
796
|
+
cred = credential.STSAssumeRoleCredential(
|
|
797
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
798
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
799
|
+
)
|
|
800
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
801
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
802
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
803
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
804
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
805
|
+
else:
|
|
806
|
+
cred = credential.Credential(
|
|
807
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
808
|
+
)
|
|
809
|
+
http_profile = HttpProfile(
|
|
810
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
811
|
+
reqMethod="POST",
|
|
812
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
813
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
814
|
+
)
|
|
815
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
816
|
+
if g_param[OptionsDefine.Language]:
|
|
817
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
818
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
819
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
820
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
821
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
822
|
+
model = models.AttachDisksRequest()
|
|
823
|
+
model.from_json_string(json.dumps(args))
|
|
824
|
+
start_time = time.time()
|
|
825
|
+
while True:
|
|
826
|
+
rsp = client.AttachDisks(model)
|
|
827
|
+
result = rsp.to_json_string()
|
|
828
|
+
try:
|
|
829
|
+
json_obj = json.loads(result)
|
|
830
|
+
except TypeError as e:
|
|
831
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
832
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
833
|
+
break
|
|
834
|
+
cur_time = time.time()
|
|
835
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
836
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
837
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
838
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
839
|
+
else:
|
|
840
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
841
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
842
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
def doSetNodeResourceConfigDefault(args, parsed_globals):
|
|
846
|
+
g_param = parse_global_arg(parsed_globals)
|
|
847
|
+
|
|
848
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
849
|
+
cred = credential.CVMRoleCredential()
|
|
850
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
851
|
+
cred = credential.STSAssumeRoleCredential(
|
|
852
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
853
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
854
|
+
)
|
|
855
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
856
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
857
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
858
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
859
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
860
|
+
else:
|
|
861
|
+
cred = credential.Credential(
|
|
862
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
863
|
+
)
|
|
864
|
+
http_profile = HttpProfile(
|
|
865
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
866
|
+
reqMethod="POST",
|
|
867
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
868
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
869
|
+
)
|
|
870
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
871
|
+
if g_param[OptionsDefine.Language]:
|
|
872
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
873
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
874
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
875
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
876
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
877
|
+
model = models.SetNodeResourceConfigDefaultRequest()
|
|
878
|
+
model.from_json_string(json.dumps(args))
|
|
879
|
+
start_time = time.time()
|
|
880
|
+
while True:
|
|
881
|
+
rsp = client.SetNodeResourceConfigDefault(model)
|
|
882
|
+
result = rsp.to_json_string()
|
|
883
|
+
try:
|
|
884
|
+
json_obj = json.loads(result)
|
|
885
|
+
except TypeError as e:
|
|
886
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
887
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
888
|
+
break
|
|
889
|
+
cur_time = time.time()
|
|
890
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
891
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
892
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
893
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
894
|
+
else:
|
|
895
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
896
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
897
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
898
|
+
|
|
899
|
+
|
|
900
|
+
def doDescribeStarRocksQueryInfo(args, parsed_globals):
|
|
901
|
+
g_param = parse_global_arg(parsed_globals)
|
|
902
|
+
|
|
903
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
904
|
+
cred = credential.CVMRoleCredential()
|
|
905
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
906
|
+
cred = credential.STSAssumeRoleCredential(
|
|
907
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
908
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
909
|
+
)
|
|
910
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
911
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
912
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
913
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
914
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
915
|
+
else:
|
|
916
|
+
cred = credential.Credential(
|
|
917
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
918
|
+
)
|
|
919
|
+
http_profile = HttpProfile(
|
|
920
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
921
|
+
reqMethod="POST",
|
|
922
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
923
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
924
|
+
)
|
|
925
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
926
|
+
if g_param[OptionsDefine.Language]:
|
|
927
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
928
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
929
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
930
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
931
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
932
|
+
model = models.DescribeStarRocksQueryInfoRequest()
|
|
933
|
+
model.from_json_string(json.dumps(args))
|
|
934
|
+
start_time = time.time()
|
|
935
|
+
while True:
|
|
936
|
+
rsp = client.DescribeStarRocksQueryInfo(model)
|
|
937
|
+
result = rsp.to_json_string()
|
|
938
|
+
try:
|
|
939
|
+
json_obj = json.loads(result)
|
|
940
|
+
except TypeError as e:
|
|
941
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
942
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
943
|
+
break
|
|
944
|
+
cur_time = time.time()
|
|
945
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
946
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
947
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
948
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
949
|
+
else:
|
|
950
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
951
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
952
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
def doModifySLInstanceBasic(args, parsed_globals):
|
|
956
|
+
g_param = parse_global_arg(parsed_globals)
|
|
957
|
+
|
|
958
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
959
|
+
cred = credential.CVMRoleCredential()
|
|
960
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
961
|
+
cred = credential.STSAssumeRoleCredential(
|
|
962
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
963
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
964
|
+
)
|
|
965
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
966
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
967
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
968
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
969
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
970
|
+
else:
|
|
971
|
+
cred = credential.Credential(
|
|
972
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
973
|
+
)
|
|
974
|
+
http_profile = HttpProfile(
|
|
975
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
976
|
+
reqMethod="POST",
|
|
977
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
978
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
979
|
+
)
|
|
980
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
981
|
+
if g_param[OptionsDefine.Language]:
|
|
982
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
983
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
984
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
985
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
986
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
987
|
+
model = models.ModifySLInstanceBasicRequest()
|
|
988
|
+
model.from_json_string(json.dumps(args))
|
|
989
|
+
start_time = time.time()
|
|
990
|
+
while True:
|
|
991
|
+
rsp = client.ModifySLInstanceBasic(model)
|
|
992
|
+
result = rsp.to_json_string()
|
|
993
|
+
try:
|
|
994
|
+
json_obj = json.loads(result)
|
|
995
|
+
except TypeError as e:
|
|
996
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
997
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
998
|
+
break
|
|
999
|
+
cur_time = time.time()
|
|
1000
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1001
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1002
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1003
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1004
|
+
else:
|
|
1005
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1006
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1007
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1008
|
+
|
|
1009
|
+
|
|
1010
|
+
def doAddMetricScaleStrategy(args, parsed_globals):
|
|
1011
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1012
|
+
|
|
1013
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1014
|
+
cred = credential.CVMRoleCredential()
|
|
1015
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1016
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1017
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1018
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1019
|
+
)
|
|
1020
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1021
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1022
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1023
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1024
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1025
|
+
else:
|
|
1026
|
+
cred = credential.Credential(
|
|
1027
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1028
|
+
)
|
|
1029
|
+
http_profile = HttpProfile(
|
|
1030
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1031
|
+
reqMethod="POST",
|
|
1032
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1033
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1034
|
+
)
|
|
1035
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1036
|
+
if g_param[OptionsDefine.Language]:
|
|
1037
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1038
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1039
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1040
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1041
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1042
|
+
model = models.AddMetricScaleStrategyRequest()
|
|
1043
|
+
model.from_json_string(json.dumps(args))
|
|
1044
|
+
start_time = time.time()
|
|
1045
|
+
while True:
|
|
1046
|
+
rsp = client.AddMetricScaleStrategy(model)
|
|
1047
|
+
result = rsp.to_json_string()
|
|
1048
|
+
try:
|
|
1049
|
+
json_obj = json.loads(result)
|
|
1050
|
+
except TypeError as e:
|
|
1051
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1052
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1053
|
+
break
|
|
1054
|
+
cur_time = time.time()
|
|
1055
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1056
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1057
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1058
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1059
|
+
else:
|
|
1060
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1061
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1062
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
def doDescribeServiceNodeInfos(args, parsed_globals):
|
|
1066
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1067
|
+
|
|
1068
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1069
|
+
cred = credential.CVMRoleCredential()
|
|
1070
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1071
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1072
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1073
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1074
|
+
)
|
|
1075
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1076
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1077
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1078
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1079
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1080
|
+
else:
|
|
1081
|
+
cred = credential.Credential(
|
|
1082
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1083
|
+
)
|
|
1084
|
+
http_profile = HttpProfile(
|
|
1085
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1086
|
+
reqMethod="POST",
|
|
1087
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1088
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1089
|
+
)
|
|
1090
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1091
|
+
if g_param[OptionsDefine.Language]:
|
|
1092
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1093
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1094
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1095
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1096
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1097
|
+
model = models.DescribeServiceNodeInfosRequest()
|
|
1098
|
+
model.from_json_string(json.dumps(args))
|
|
1099
|
+
start_time = time.time()
|
|
1100
|
+
while True:
|
|
1101
|
+
rsp = client.DescribeServiceNodeInfos(model)
|
|
1102
|
+
result = rsp.to_json_string()
|
|
1103
|
+
try:
|
|
1104
|
+
json_obj = json.loads(result)
|
|
1105
|
+
except TypeError as e:
|
|
1106
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1107
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1108
|
+
break
|
|
1109
|
+
cur_time = time.time()
|
|
1110
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1111
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1112
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1113
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1114
|
+
else:
|
|
1115
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1116
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1117
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
def doDescribeInstances(args, parsed_globals):
|
|
1121
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1122
|
+
|
|
1123
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1124
|
+
cred = credential.CVMRoleCredential()
|
|
1125
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1126
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1127
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1128
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1129
|
+
)
|
|
1130
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1131
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1132
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1133
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1134
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1135
|
+
else:
|
|
1136
|
+
cred = credential.Credential(
|
|
1137
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1138
|
+
)
|
|
1139
|
+
http_profile = HttpProfile(
|
|
1140
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1141
|
+
reqMethod="POST",
|
|
1142
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1143
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1144
|
+
)
|
|
1145
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1146
|
+
if g_param[OptionsDefine.Language]:
|
|
1147
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1148
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1149
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1150
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1151
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1152
|
+
model = models.DescribeInstancesRequest()
|
|
1153
|
+
model.from_json_string(json.dumps(args))
|
|
1154
|
+
start_time = time.time()
|
|
1155
|
+
while True:
|
|
1156
|
+
rsp = client.DescribeInstances(model)
|
|
1157
|
+
result = rsp.to_json_string()
|
|
1158
|
+
try:
|
|
1159
|
+
json_obj = json.loads(result)
|
|
1160
|
+
except TypeError as e:
|
|
1161
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1162
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1163
|
+
break
|
|
1164
|
+
cur_time = time.time()
|
|
1165
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1166
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1167
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1168
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1169
|
+
else:
|
|
1170
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1171
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1172
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1173
|
+
|
|
1174
|
+
|
|
1175
|
+
def doModifyYarnDeploy(args, parsed_globals):
|
|
1176
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1177
|
+
|
|
1178
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1179
|
+
cred = credential.CVMRoleCredential()
|
|
1180
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1181
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1182
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1183
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1184
|
+
)
|
|
1185
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1186
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1187
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1188
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1189
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1190
|
+
else:
|
|
1191
|
+
cred = credential.Credential(
|
|
1192
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1193
|
+
)
|
|
1194
|
+
http_profile = HttpProfile(
|
|
1195
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1196
|
+
reqMethod="POST",
|
|
1197
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1198
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1199
|
+
)
|
|
1200
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1201
|
+
if g_param[OptionsDefine.Language]:
|
|
1202
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1203
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1204
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1205
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1206
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1207
|
+
model = models.ModifyYarnDeployRequest()
|
|
1208
|
+
model.from_json_string(json.dumps(args))
|
|
1209
|
+
start_time = time.time()
|
|
1210
|
+
while True:
|
|
1211
|
+
rsp = client.ModifyYarnDeploy(model)
|
|
1212
|
+
result = rsp.to_json_string()
|
|
1213
|
+
try:
|
|
1214
|
+
json_obj = json.loads(result)
|
|
1215
|
+
except TypeError as e:
|
|
1216
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1217
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1218
|
+
break
|
|
1219
|
+
cur_time = time.time()
|
|
1220
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1221
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1222
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1223
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1224
|
+
else:
|
|
1225
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1226
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1227
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1228
|
+
|
|
1229
|
+
|
|
1230
|
+
def doTerminateTasks(args, parsed_globals):
|
|
1231
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1232
|
+
|
|
1233
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1234
|
+
cred = credential.CVMRoleCredential()
|
|
1235
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1236
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1237
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1238
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1239
|
+
)
|
|
1240
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1241
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1242
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1243
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1244
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1245
|
+
else:
|
|
1246
|
+
cred = credential.Credential(
|
|
1247
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1248
|
+
)
|
|
1249
|
+
http_profile = HttpProfile(
|
|
1250
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1251
|
+
reqMethod="POST",
|
|
1252
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1253
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1254
|
+
)
|
|
1255
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1256
|
+
if g_param[OptionsDefine.Language]:
|
|
1257
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1258
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1259
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1260
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1261
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1262
|
+
model = models.TerminateTasksRequest()
|
|
1263
|
+
model.from_json_string(json.dumps(args))
|
|
1264
|
+
start_time = time.time()
|
|
1265
|
+
while True:
|
|
1266
|
+
rsp = client.TerminateTasks(model)
|
|
1267
|
+
result = rsp.to_json_string()
|
|
1268
|
+
try:
|
|
1269
|
+
json_obj = json.loads(result)
|
|
1270
|
+
except TypeError as e:
|
|
1271
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1272
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1273
|
+
break
|
|
1274
|
+
cur_time = time.time()
|
|
1275
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1276
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1277
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1278
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1279
|
+
else:
|
|
1280
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1281
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1282
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1283
|
+
|
|
1284
|
+
|
|
1285
|
+
def doDeleteGroupsSTD(args, parsed_globals):
|
|
1286
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1287
|
+
|
|
1288
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1289
|
+
cred = credential.CVMRoleCredential()
|
|
1290
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1291
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1292
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1293
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1294
|
+
)
|
|
1295
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1296
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1297
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1298
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1299
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1300
|
+
else:
|
|
1301
|
+
cred = credential.Credential(
|
|
1302
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1303
|
+
)
|
|
1304
|
+
http_profile = HttpProfile(
|
|
1305
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1306
|
+
reqMethod="POST",
|
|
1307
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1308
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1309
|
+
)
|
|
1310
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1311
|
+
if g_param[OptionsDefine.Language]:
|
|
1312
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1313
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1314
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1315
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1316
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1317
|
+
model = models.DeleteGroupsSTDRequest()
|
|
1318
|
+
model.from_json_string(json.dumps(args))
|
|
1319
|
+
start_time = time.time()
|
|
1320
|
+
while True:
|
|
1321
|
+
rsp = client.DeleteGroupsSTD(model)
|
|
1322
|
+
result = rsp.to_json_string()
|
|
1323
|
+
try:
|
|
1324
|
+
json_obj = json.loads(result)
|
|
1325
|
+
except TypeError as e:
|
|
1326
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1327
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1328
|
+
break
|
|
1329
|
+
cur_time = time.time()
|
|
1330
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1331
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1332
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1333
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1334
|
+
else:
|
|
1335
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1336
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1337
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1338
|
+
|
|
1339
|
+
|
|
1340
|
+
def doTerminateClusterNodes(args, parsed_globals):
|
|
1341
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1342
|
+
|
|
1343
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1344
|
+
cred = credential.CVMRoleCredential()
|
|
1345
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1346
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1347
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1348
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1349
|
+
)
|
|
1350
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1351
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1352
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1353
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1354
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1355
|
+
else:
|
|
1356
|
+
cred = credential.Credential(
|
|
1357
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1358
|
+
)
|
|
1359
|
+
http_profile = HttpProfile(
|
|
1360
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1361
|
+
reqMethod="POST",
|
|
1362
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1363
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1364
|
+
)
|
|
1365
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1366
|
+
if g_param[OptionsDefine.Language]:
|
|
1367
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1368
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1369
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1370
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1371
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1372
|
+
model = models.TerminateClusterNodesRequest()
|
|
1373
|
+
model.from_json_string(json.dumps(args))
|
|
1374
|
+
start_time = time.time()
|
|
1375
|
+
while True:
|
|
1376
|
+
rsp = client.TerminateClusterNodes(model)
|
|
1377
|
+
result = rsp.to_json_string()
|
|
1378
|
+
try:
|
|
1379
|
+
json_obj = json.loads(result)
|
|
1380
|
+
except TypeError as e:
|
|
1381
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1382
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1383
|
+
break
|
|
1384
|
+
cur_time = time.time()
|
|
1385
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1386
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1387
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1388
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1389
|
+
else:
|
|
1390
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1391
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1392
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1393
|
+
|
|
1394
|
+
|
|
1395
|
+
def doResetYarnConfig(args, parsed_globals):
|
|
1396
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1397
|
+
|
|
1398
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1399
|
+
cred = credential.CVMRoleCredential()
|
|
1400
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1401
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1402
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1403
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1404
|
+
)
|
|
1405
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1406
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1407
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1408
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1409
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1410
|
+
else:
|
|
1411
|
+
cred = credential.Credential(
|
|
1412
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1413
|
+
)
|
|
1414
|
+
http_profile = HttpProfile(
|
|
1415
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1416
|
+
reqMethod="POST",
|
|
1417
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1418
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1419
|
+
)
|
|
1420
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1421
|
+
if g_param[OptionsDefine.Language]:
|
|
1422
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1423
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1424
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1425
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1426
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1427
|
+
model = models.ResetYarnConfigRequest()
|
|
1428
|
+
model.from_json_string(json.dumps(args))
|
|
1429
|
+
start_time = time.time()
|
|
1430
|
+
while True:
|
|
1431
|
+
rsp = client.ResetYarnConfig(model)
|
|
1432
|
+
result = rsp.to_json_string()
|
|
1433
|
+
try:
|
|
1434
|
+
json_obj = json.loads(result)
|
|
1435
|
+
except TypeError as e:
|
|
1436
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1437
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1438
|
+
break
|
|
1439
|
+
cur_time = time.time()
|
|
1440
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1441
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1442
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1443
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1444
|
+
else:
|
|
1445
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1446
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1447
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
def doDescribeUsersForUserManager(args, parsed_globals):
|
|
1451
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1452
|
+
|
|
1453
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1454
|
+
cred = credential.CVMRoleCredential()
|
|
1455
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1456
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1457
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1458
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1459
|
+
)
|
|
1460
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1461
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1462
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1463
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1464
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1465
|
+
else:
|
|
1466
|
+
cred = credential.Credential(
|
|
1467
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1468
|
+
)
|
|
1469
|
+
http_profile = HttpProfile(
|
|
1470
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1471
|
+
reqMethod="POST",
|
|
1472
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1473
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1474
|
+
)
|
|
1475
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1476
|
+
if g_param[OptionsDefine.Language]:
|
|
1477
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1478
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1479
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1480
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1481
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1482
|
+
model = models.DescribeUsersForUserManagerRequest()
|
|
1483
|
+
model.from_json_string(json.dumps(args))
|
|
1484
|
+
start_time = time.time()
|
|
1485
|
+
while True:
|
|
1486
|
+
rsp = client.DescribeUsersForUserManager(model)
|
|
1487
|
+
result = rsp.to_json_string()
|
|
1488
|
+
try:
|
|
1489
|
+
json_obj = json.loads(result)
|
|
1490
|
+
except TypeError as e:
|
|
1491
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1492
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1493
|
+
break
|
|
1494
|
+
cur_time = time.time()
|
|
1495
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1496
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1497
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1498
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1499
|
+
else:
|
|
1500
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1501
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1502
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1503
|
+
|
|
1504
|
+
|
|
1505
|
+
def doModifyUserManagerPwd(args, parsed_globals):
|
|
1506
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1507
|
+
|
|
1508
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1509
|
+
cred = credential.CVMRoleCredential()
|
|
1510
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1511
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1512
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1513
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1514
|
+
)
|
|
1515
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1516
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1517
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1518
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1519
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1520
|
+
else:
|
|
1521
|
+
cred = credential.Credential(
|
|
1522
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1523
|
+
)
|
|
1524
|
+
http_profile = HttpProfile(
|
|
1525
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1526
|
+
reqMethod="POST",
|
|
1527
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1528
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1529
|
+
)
|
|
1530
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1531
|
+
if g_param[OptionsDefine.Language]:
|
|
1532
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1533
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1534
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1535
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1536
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1537
|
+
model = models.ModifyUserManagerPwdRequest()
|
|
1538
|
+
model.from_json_string(json.dumps(args))
|
|
1539
|
+
start_time = time.time()
|
|
1540
|
+
while True:
|
|
1541
|
+
rsp = client.ModifyUserManagerPwd(model)
|
|
1542
|
+
result = rsp.to_json_string()
|
|
1543
|
+
try:
|
|
1544
|
+
json_obj = json.loads(result)
|
|
1545
|
+
except TypeError as e:
|
|
1546
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1547
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1548
|
+
break
|
|
1549
|
+
cur_time = time.time()
|
|
1550
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1551
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1552
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1553
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1554
|
+
else:
|
|
1555
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1556
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1557
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1558
|
+
|
|
1559
|
+
|
|
1560
|
+
def doConvertPreToPostCluster(args, parsed_globals):
|
|
1561
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1562
|
+
|
|
1563
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1564
|
+
cred = credential.CVMRoleCredential()
|
|
1565
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1566
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1567
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1568
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1569
|
+
)
|
|
1570
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1571
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1572
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1573
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1574
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1575
|
+
else:
|
|
1576
|
+
cred = credential.Credential(
|
|
1577
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1578
|
+
)
|
|
1579
|
+
http_profile = HttpProfile(
|
|
1580
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1581
|
+
reqMethod="POST",
|
|
1582
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1583
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1584
|
+
)
|
|
1585
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1586
|
+
if g_param[OptionsDefine.Language]:
|
|
1587
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1588
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1589
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1590
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1591
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1592
|
+
model = models.ConvertPreToPostClusterRequest()
|
|
1593
|
+
model.from_json_string(json.dumps(args))
|
|
1594
|
+
start_time = time.time()
|
|
1595
|
+
while True:
|
|
1596
|
+
rsp = client.ConvertPreToPostCluster(model)
|
|
1597
|
+
result = rsp.to_json_string()
|
|
1598
|
+
try:
|
|
1599
|
+
json_obj = json.loads(result)
|
|
1600
|
+
except TypeError as e:
|
|
1601
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1602
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1603
|
+
break
|
|
1604
|
+
cur_time = time.time()
|
|
1605
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1606
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1607
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1608
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1609
|
+
else:
|
|
1610
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1611
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1612
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1613
|
+
|
|
1614
|
+
|
|
1615
|
+
def doCreateGroupsSTD(args, parsed_globals):
|
|
1616
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1617
|
+
|
|
1618
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1619
|
+
cred = credential.CVMRoleCredential()
|
|
1620
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1621
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1622
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1623
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1624
|
+
)
|
|
1625
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1626
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1627
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1628
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1629
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1630
|
+
else:
|
|
1631
|
+
cred = credential.Credential(
|
|
1632
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1633
|
+
)
|
|
1634
|
+
http_profile = HttpProfile(
|
|
1635
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1636
|
+
reqMethod="POST",
|
|
1637
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1638
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1639
|
+
)
|
|
1640
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1641
|
+
if g_param[OptionsDefine.Language]:
|
|
1642
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1643
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1644
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1645
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1646
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1647
|
+
model = models.CreateGroupsSTDRequest()
|
|
1648
|
+
model.from_json_string(json.dumps(args))
|
|
1649
|
+
start_time = time.time()
|
|
1650
|
+
while True:
|
|
1651
|
+
rsp = client.CreateGroupsSTD(model)
|
|
1652
|
+
result = rsp.to_json_string()
|
|
1653
|
+
try:
|
|
1654
|
+
json_obj = json.loads(result)
|
|
1655
|
+
except TypeError as e:
|
|
1656
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1657
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1658
|
+
break
|
|
1659
|
+
cur_time = time.time()
|
|
1660
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1661
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1662
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1663
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1664
|
+
else:
|
|
1665
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1666
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1667
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1668
|
+
|
|
1669
|
+
|
|
1670
|
+
def doTerminateSLInstance(args, parsed_globals):
|
|
1671
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1672
|
+
|
|
1673
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1674
|
+
cred = credential.CVMRoleCredential()
|
|
1675
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1676
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1677
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1678
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1679
|
+
)
|
|
1680
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1681
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1682
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1683
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1684
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1685
|
+
else:
|
|
1686
|
+
cred = credential.Credential(
|
|
1687
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1688
|
+
)
|
|
1689
|
+
http_profile = HttpProfile(
|
|
1690
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1691
|
+
reqMethod="POST",
|
|
1692
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1693
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1694
|
+
)
|
|
1695
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1696
|
+
if g_param[OptionsDefine.Language]:
|
|
1697
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1698
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1699
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1700
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1701
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1702
|
+
model = models.TerminateSLInstanceRequest()
|
|
1703
|
+
model.from_json_string(json.dumps(args))
|
|
1704
|
+
start_time = time.time()
|
|
1705
|
+
while True:
|
|
1706
|
+
rsp = client.TerminateSLInstance(model)
|
|
1707
|
+
result = rsp.to_json_string()
|
|
1708
|
+
try:
|
|
1709
|
+
json_obj = json.loads(result)
|
|
1710
|
+
except TypeError as e:
|
|
1711
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1712
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1713
|
+
break
|
|
1714
|
+
cur_time = time.time()
|
|
1715
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1716
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1717
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1718
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1719
|
+
else:
|
|
1720
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1721
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1722
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1723
|
+
|
|
1724
|
+
|
|
1725
|
+
def doAddUsersForUserManager(args, parsed_globals):
|
|
1726
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1727
|
+
|
|
1728
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1729
|
+
cred = credential.CVMRoleCredential()
|
|
1730
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1731
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1732
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1733
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1734
|
+
)
|
|
1735
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1736
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1737
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1738
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1739
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1740
|
+
else:
|
|
1741
|
+
cred = credential.Credential(
|
|
1742
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1743
|
+
)
|
|
1744
|
+
http_profile = HttpProfile(
|
|
1745
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1746
|
+
reqMethod="POST",
|
|
1747
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1748
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1749
|
+
)
|
|
1750
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1751
|
+
if g_param[OptionsDefine.Language]:
|
|
1752
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1753
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1754
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1755
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1756
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1757
|
+
model = models.AddUsersForUserManagerRequest()
|
|
1758
|
+
model.from_json_string(json.dumps(args))
|
|
1759
|
+
start_time = time.time()
|
|
1760
|
+
while True:
|
|
1761
|
+
rsp = client.AddUsersForUserManager(model)
|
|
1762
|
+
result = rsp.to_json_string()
|
|
1763
|
+
try:
|
|
1764
|
+
json_obj = json.loads(result)
|
|
1765
|
+
except TypeError as e:
|
|
1766
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1767
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1768
|
+
break
|
|
1769
|
+
cur_time = time.time()
|
|
1770
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1771
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1772
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1773
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1774
|
+
else:
|
|
1775
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1776
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1777
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1778
|
+
|
|
1779
|
+
|
|
1780
|
+
def doDescribeSparkApplications(args, parsed_globals):
|
|
1781
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1782
|
+
|
|
1783
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1784
|
+
cred = credential.CVMRoleCredential()
|
|
1785
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1786
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1787
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1788
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1789
|
+
)
|
|
1790
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1791
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1792
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1793
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1794
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1795
|
+
else:
|
|
1796
|
+
cred = credential.Credential(
|
|
1797
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1798
|
+
)
|
|
1799
|
+
http_profile = HttpProfile(
|
|
1800
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1801
|
+
reqMethod="POST",
|
|
1802
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1803
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1804
|
+
)
|
|
1805
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1806
|
+
if g_param[OptionsDefine.Language]:
|
|
1807
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1808
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1809
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1810
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1811
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1812
|
+
model = models.DescribeSparkApplicationsRequest()
|
|
1813
|
+
model.from_json_string(json.dumps(args))
|
|
1814
|
+
start_time = time.time()
|
|
1815
|
+
while True:
|
|
1816
|
+
rsp = client.DescribeSparkApplications(model)
|
|
1817
|
+
result = rsp.to_json_string()
|
|
1818
|
+
try:
|
|
1819
|
+
json_obj = json.loads(result)
|
|
1820
|
+
except TypeError as e:
|
|
1821
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1822
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1823
|
+
break
|
|
1824
|
+
cur_time = time.time()
|
|
1825
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1826
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1827
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1828
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1829
|
+
else:
|
|
1830
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1831
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1832
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1833
|
+
|
|
1834
|
+
|
|
1835
|
+
def doModifyUserGroup(args, parsed_globals):
|
|
1836
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1837
|
+
|
|
1838
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1839
|
+
cred = credential.CVMRoleCredential()
|
|
1840
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1841
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1842
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1843
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1844
|
+
)
|
|
1845
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1846
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1847
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1848
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1849
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1850
|
+
else:
|
|
1851
|
+
cred = credential.Credential(
|
|
1852
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1853
|
+
)
|
|
1854
|
+
http_profile = HttpProfile(
|
|
1855
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1856
|
+
reqMethod="POST",
|
|
1857
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1858
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1859
|
+
)
|
|
1860
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1861
|
+
if g_param[OptionsDefine.Language]:
|
|
1862
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1863
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1864
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1865
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1866
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1867
|
+
model = models.ModifyUserGroupRequest()
|
|
1868
|
+
model.from_json_string(json.dumps(args))
|
|
1869
|
+
start_time = time.time()
|
|
1870
|
+
while True:
|
|
1871
|
+
rsp = client.ModifyUserGroup(model)
|
|
1872
|
+
result = rsp.to_json_string()
|
|
1873
|
+
try:
|
|
1874
|
+
json_obj = json.loads(result)
|
|
1875
|
+
except TypeError as e:
|
|
1876
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1877
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1878
|
+
break
|
|
1879
|
+
cur_time = time.time()
|
|
1880
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1881
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1882
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1883
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1884
|
+
else:
|
|
1885
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1886
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1887
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1888
|
+
|
|
1889
|
+
|
|
1890
|
+
def doCreateSLInstance(args, parsed_globals):
|
|
1891
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1892
|
+
|
|
1893
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1894
|
+
cred = credential.CVMRoleCredential()
|
|
1895
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1896
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1897
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1898
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1899
|
+
)
|
|
1900
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1901
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1902
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1903
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1904
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1905
|
+
else:
|
|
1906
|
+
cred = credential.Credential(
|
|
1907
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1908
|
+
)
|
|
1909
|
+
http_profile = HttpProfile(
|
|
1910
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1911
|
+
reqMethod="POST",
|
|
1912
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1913
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1914
|
+
)
|
|
1915
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1916
|
+
if g_param[OptionsDefine.Language]:
|
|
1917
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1918
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1919
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1920
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1921
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1922
|
+
model = models.CreateSLInstanceRequest()
|
|
1923
|
+
model.from_json_string(json.dumps(args))
|
|
1924
|
+
start_time = time.time()
|
|
1925
|
+
while True:
|
|
1926
|
+
rsp = client.CreateSLInstance(model)
|
|
1927
|
+
result = rsp.to_json_string()
|
|
1928
|
+
try:
|
|
1929
|
+
json_obj = json.loads(result)
|
|
1930
|
+
except TypeError as e:
|
|
1931
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1932
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1933
|
+
break
|
|
1934
|
+
cur_time = time.time()
|
|
1935
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1936
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1937
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1938
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1939
|
+
else:
|
|
1940
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1941
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1942
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1943
|
+
|
|
1944
|
+
|
|
1945
|
+
def doDescribeSLInstanceList(args, parsed_globals):
|
|
1946
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1947
|
+
|
|
1948
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1949
|
+
cred = credential.CVMRoleCredential()
|
|
1950
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1951
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1952
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1953
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1954
|
+
)
|
|
1955
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1956
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1957
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1958
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1959
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1960
|
+
else:
|
|
1961
|
+
cred = credential.Credential(
|
|
1962
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1963
|
+
)
|
|
1964
|
+
http_profile = HttpProfile(
|
|
1965
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1966
|
+
reqMethod="POST",
|
|
1967
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1968
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1969
|
+
)
|
|
1970
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1971
|
+
if g_param[OptionsDefine.Language]:
|
|
1972
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1973
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1974
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1975
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1976
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1977
|
+
model = models.DescribeSLInstanceListRequest()
|
|
1978
|
+
model.from_json_string(json.dumps(args))
|
|
1979
|
+
start_time = time.time()
|
|
1980
|
+
while True:
|
|
1981
|
+
rsp = client.DescribeSLInstanceList(model)
|
|
1982
|
+
result = rsp.to_json_string()
|
|
1983
|
+
try:
|
|
1984
|
+
json_obj = json.loads(result)
|
|
1985
|
+
except TypeError as e:
|
|
1986
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1987
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1988
|
+
break
|
|
1989
|
+
cur_time = time.time()
|
|
1990
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1991
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1992
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1993
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1994
|
+
else:
|
|
1995
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1996
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1997
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1998
|
+
|
|
1999
|
+
|
|
2000
|
+
def doAddNodeResourceConfig(args, parsed_globals):
|
|
2001
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2002
|
+
|
|
2003
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2004
|
+
cred = credential.CVMRoleCredential()
|
|
2005
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2006
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2007
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2008
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2009
|
+
)
|
|
2010
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2011
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2012
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2013
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2014
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2015
|
+
else:
|
|
2016
|
+
cred = credential.Credential(
|
|
2017
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2018
|
+
)
|
|
2019
|
+
http_profile = HttpProfile(
|
|
2020
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2021
|
+
reqMethod="POST",
|
|
2022
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2023
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2024
|
+
)
|
|
2025
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2026
|
+
if g_param[OptionsDefine.Language]:
|
|
2027
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2028
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2029
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2030
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2031
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2032
|
+
model = models.AddNodeResourceConfigRequest()
|
|
2033
|
+
model.from_json_string(json.dumps(args))
|
|
2034
|
+
start_time = time.time()
|
|
2035
|
+
while True:
|
|
2036
|
+
rsp = client.AddNodeResourceConfig(model)
|
|
2037
|
+
result = rsp.to_json_string()
|
|
2038
|
+
try:
|
|
2039
|
+
json_obj = json.loads(result)
|
|
2040
|
+
except TypeError as e:
|
|
2041
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2042
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2043
|
+
break
|
|
2044
|
+
cur_time = time.time()
|
|
2045
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2046
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2047
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2048
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2049
|
+
else:
|
|
2050
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2051
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2052
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2053
|
+
|
|
2054
|
+
|
|
2055
|
+
def doModifyAutoScaleStrategy(args, parsed_globals):
|
|
2056
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2057
|
+
|
|
2058
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2059
|
+
cred = credential.CVMRoleCredential()
|
|
2060
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2061
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2062
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2063
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2064
|
+
)
|
|
2065
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2066
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2067
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2068
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2069
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2070
|
+
else:
|
|
2071
|
+
cred = credential.Credential(
|
|
2072
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2073
|
+
)
|
|
2074
|
+
http_profile = HttpProfile(
|
|
2075
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2076
|
+
reqMethod="POST",
|
|
2077
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2078
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2079
|
+
)
|
|
2080
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2081
|
+
if g_param[OptionsDefine.Language]:
|
|
2082
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2083
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2084
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2085
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2086
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2087
|
+
model = models.ModifyAutoScaleStrategyRequest()
|
|
2088
|
+
model.from_json_string(json.dumps(args))
|
|
2089
|
+
start_time = time.time()
|
|
2090
|
+
while True:
|
|
2091
|
+
rsp = client.ModifyAutoScaleStrategy(model)
|
|
2092
|
+
result = rsp.to_json_string()
|
|
2093
|
+
try:
|
|
2094
|
+
json_obj = json.loads(result)
|
|
2095
|
+
except TypeError as e:
|
|
2096
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2097
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2098
|
+
break
|
|
2099
|
+
cur_time = time.time()
|
|
2100
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2101
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2102
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2103
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2104
|
+
else:
|
|
2105
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2106
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2107
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2108
|
+
|
|
2109
|
+
|
|
2110
|
+
def doDescribeKyuubiQueryInfo(args, parsed_globals):
|
|
2111
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2112
|
+
|
|
2113
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2114
|
+
cred = credential.CVMRoleCredential()
|
|
2115
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2116
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2117
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2118
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2119
|
+
)
|
|
2120
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2121
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2122
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2123
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2124
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2125
|
+
else:
|
|
2126
|
+
cred = credential.Credential(
|
|
2127
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2128
|
+
)
|
|
2129
|
+
http_profile = HttpProfile(
|
|
2130
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2131
|
+
reqMethod="POST",
|
|
2132
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2133
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2134
|
+
)
|
|
2135
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2136
|
+
if g_param[OptionsDefine.Language]:
|
|
2137
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2138
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2139
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2140
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2141
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2142
|
+
model = models.DescribeKyuubiQueryInfoRequest()
|
|
2143
|
+
model.from_json_string(json.dumps(args))
|
|
2144
|
+
start_time = time.time()
|
|
2145
|
+
while True:
|
|
2146
|
+
rsp = client.DescribeKyuubiQueryInfo(model)
|
|
2147
|
+
result = rsp.to_json_string()
|
|
2148
|
+
try:
|
|
2149
|
+
json_obj = json.loads(result)
|
|
2150
|
+
except TypeError as e:
|
|
2151
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2152
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2153
|
+
break
|
|
2154
|
+
cur_time = time.time()
|
|
2155
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2156
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2157
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2158
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2159
|
+
else:
|
|
2160
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2161
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2162
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2163
|
+
|
|
2164
|
+
|
|
2165
|
+
def doDeleteAutoScaleStrategy(args, parsed_globals):
|
|
2166
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2167
|
+
|
|
2168
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2169
|
+
cred = credential.CVMRoleCredential()
|
|
2170
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2171
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2172
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2173
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2174
|
+
)
|
|
2175
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2176
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2177
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2178
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2179
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2180
|
+
else:
|
|
2181
|
+
cred = credential.Credential(
|
|
2182
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2183
|
+
)
|
|
2184
|
+
http_profile = HttpProfile(
|
|
2185
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2186
|
+
reqMethod="POST",
|
|
2187
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2188
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2189
|
+
)
|
|
2190
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2191
|
+
if g_param[OptionsDefine.Language]:
|
|
2192
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2193
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2194
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2195
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2196
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2197
|
+
model = models.DeleteAutoScaleStrategyRequest()
|
|
2198
|
+
model.from_json_string(json.dumps(args))
|
|
2199
|
+
start_time = time.time()
|
|
2200
|
+
while True:
|
|
2201
|
+
rsp = client.DeleteAutoScaleStrategy(model)
|
|
2202
|
+
result = rsp.to_json_string()
|
|
2203
|
+
try:
|
|
2204
|
+
json_obj = json.loads(result)
|
|
2205
|
+
except TypeError as e:
|
|
2206
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2207
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2208
|
+
break
|
|
2209
|
+
cur_time = time.time()
|
|
2210
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2211
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2212
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2213
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2214
|
+
else:
|
|
2215
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2216
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2217
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2218
|
+
|
|
2219
|
+
|
|
2220
|
+
def doDescribeEmrApplicationStatics(args, parsed_globals):
|
|
2221
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2222
|
+
|
|
2223
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2224
|
+
cred = credential.CVMRoleCredential()
|
|
2225
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2226
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2227
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2228
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2229
|
+
)
|
|
2230
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2231
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2232
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2233
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2234
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2235
|
+
else:
|
|
2236
|
+
cred = credential.Credential(
|
|
2237
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2238
|
+
)
|
|
2239
|
+
http_profile = HttpProfile(
|
|
2240
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2241
|
+
reqMethod="POST",
|
|
2242
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2243
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2244
|
+
)
|
|
2245
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2246
|
+
if g_param[OptionsDefine.Language]:
|
|
2247
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2248
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2249
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2250
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2251
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2252
|
+
model = models.DescribeEmrApplicationStaticsRequest()
|
|
2253
|
+
model.from_json_string(json.dumps(args))
|
|
2254
|
+
start_time = time.time()
|
|
2255
|
+
while True:
|
|
2256
|
+
rsp = client.DescribeEmrApplicationStatics(model)
|
|
2257
|
+
result = rsp.to_json_string()
|
|
2258
|
+
try:
|
|
2259
|
+
json_obj = json.loads(result)
|
|
2260
|
+
except TypeError as e:
|
|
2261
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2262
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2263
|
+
break
|
|
2264
|
+
cur_time = time.time()
|
|
2265
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2266
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2267
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2268
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2269
|
+
else:
|
|
2270
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2271
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2272
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2273
|
+
|
|
2274
|
+
|
|
2275
|
+
def doDescribeHDFSStorageInfo(args, parsed_globals):
|
|
2276
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2277
|
+
|
|
2278
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2279
|
+
cred = credential.CVMRoleCredential()
|
|
2280
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2281
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2282
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2283
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2284
|
+
)
|
|
2285
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2286
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2287
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2288
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2289
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2290
|
+
else:
|
|
2291
|
+
cred = credential.Credential(
|
|
2292
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2293
|
+
)
|
|
2294
|
+
http_profile = HttpProfile(
|
|
2295
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2296
|
+
reqMethod="POST",
|
|
2297
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2298
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2299
|
+
)
|
|
2300
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2301
|
+
if g_param[OptionsDefine.Language]:
|
|
2302
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2303
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2304
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2305
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2306
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2307
|
+
model = models.DescribeHDFSStorageInfoRequest()
|
|
2308
|
+
model.from_json_string(json.dumps(args))
|
|
2309
|
+
start_time = time.time()
|
|
2310
|
+
while True:
|
|
2311
|
+
rsp = client.DescribeHDFSStorageInfo(model)
|
|
2312
|
+
result = rsp.to_json_string()
|
|
2313
|
+
try:
|
|
2314
|
+
json_obj = json.loads(result)
|
|
2315
|
+
except TypeError as e:
|
|
2316
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2317
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2318
|
+
break
|
|
2319
|
+
cur_time = time.time()
|
|
2320
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2321
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2322
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2323
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2324
|
+
else:
|
|
2325
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2326
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2327
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2328
|
+
|
|
2329
|
+
|
|
2330
|
+
def doCreateInstance(args, parsed_globals):
|
|
2331
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2332
|
+
|
|
2333
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2334
|
+
cred = credential.CVMRoleCredential()
|
|
2335
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2336
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2337
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2338
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2339
|
+
)
|
|
2340
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2341
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2342
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2343
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2344
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2345
|
+
else:
|
|
2346
|
+
cred = credential.Credential(
|
|
2347
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2348
|
+
)
|
|
2349
|
+
http_profile = HttpProfile(
|
|
2350
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2351
|
+
reqMethod="POST",
|
|
2352
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2353
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2354
|
+
)
|
|
2355
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2356
|
+
if g_param[OptionsDefine.Language]:
|
|
2357
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2358
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2359
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2360
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2361
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2362
|
+
model = models.CreateInstanceRequest()
|
|
2363
|
+
model.from_json_string(json.dumps(args))
|
|
2364
|
+
start_time = time.time()
|
|
2365
|
+
while True:
|
|
2366
|
+
rsp = client.CreateInstance(model)
|
|
2367
|
+
result = rsp.to_json_string()
|
|
2368
|
+
try:
|
|
2369
|
+
json_obj = json.loads(result)
|
|
2370
|
+
except TypeError as e:
|
|
2371
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2372
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2373
|
+
break
|
|
2374
|
+
cur_time = time.time()
|
|
2375
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2376
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2377
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2378
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2379
|
+
else:
|
|
2380
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2381
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2382
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2383
|
+
|
|
2384
|
+
|
|
2385
|
+
def doModifyResourceScheduler(args, parsed_globals):
|
|
2386
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2387
|
+
|
|
2388
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2389
|
+
cred = credential.CVMRoleCredential()
|
|
2390
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2391
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2392
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2393
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2394
|
+
)
|
|
2395
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2396
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2397
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2398
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2399
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2400
|
+
else:
|
|
2401
|
+
cred = credential.Credential(
|
|
2402
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2403
|
+
)
|
|
2404
|
+
http_profile = HttpProfile(
|
|
2405
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2406
|
+
reqMethod="POST",
|
|
2407
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2408
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2409
|
+
)
|
|
2410
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2411
|
+
if g_param[OptionsDefine.Language]:
|
|
2412
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2413
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2414
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2415
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2416
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2417
|
+
model = models.ModifyResourceSchedulerRequest()
|
|
2418
|
+
model.from_json_string(json.dumps(args))
|
|
2419
|
+
start_time = time.time()
|
|
2420
|
+
while True:
|
|
2421
|
+
rsp = client.ModifyResourceScheduler(model)
|
|
2422
|
+
result = rsp.to_json_string()
|
|
2423
|
+
try:
|
|
2424
|
+
json_obj = json.loads(result)
|
|
2425
|
+
except TypeError as e:
|
|
2426
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2427
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2428
|
+
break
|
|
2429
|
+
cur_time = time.time()
|
|
2430
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2431
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2432
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2433
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2434
|
+
else:
|
|
2435
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2436
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2437
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2438
|
+
|
|
2439
|
+
|
|
2440
|
+
def doDescribeHBaseTableOverview(args, parsed_globals):
|
|
2441
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2442
|
+
|
|
2443
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2444
|
+
cred = credential.CVMRoleCredential()
|
|
2445
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2446
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2447
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2448
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2449
|
+
)
|
|
2450
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2451
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2452
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2453
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2454
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2455
|
+
else:
|
|
2456
|
+
cred = credential.Credential(
|
|
2457
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2458
|
+
)
|
|
2459
|
+
http_profile = HttpProfile(
|
|
2460
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2461
|
+
reqMethod="POST",
|
|
2462
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2463
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2464
|
+
)
|
|
2465
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2466
|
+
if g_param[OptionsDefine.Language]:
|
|
2467
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2468
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2469
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2470
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2471
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2472
|
+
model = models.DescribeHBaseTableOverviewRequest()
|
|
2473
|
+
model.from_json_string(json.dumps(args))
|
|
2474
|
+
start_time = time.time()
|
|
2475
|
+
while True:
|
|
2476
|
+
rsp = client.DescribeHBaseTableOverview(model)
|
|
2477
|
+
result = rsp.to_json_string()
|
|
2478
|
+
try:
|
|
2479
|
+
json_obj = json.loads(result)
|
|
2480
|
+
except TypeError as e:
|
|
2481
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2482
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2483
|
+
break
|
|
2484
|
+
cur_time = time.time()
|
|
2485
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2486
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2487
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2488
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2489
|
+
else:
|
|
2490
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2491
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2492
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2493
|
+
|
|
2494
|
+
|
|
2495
|
+
def doDescribeResourceScheduleDiffDetail(args, parsed_globals):
|
|
2496
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2497
|
+
|
|
2498
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2499
|
+
cred = credential.CVMRoleCredential()
|
|
2500
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2501
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2502
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2503
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2504
|
+
)
|
|
2505
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2506
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2507
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2508
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2509
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2510
|
+
else:
|
|
2511
|
+
cred = credential.Credential(
|
|
2512
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2513
|
+
)
|
|
2514
|
+
http_profile = HttpProfile(
|
|
2515
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2516
|
+
reqMethod="POST",
|
|
2517
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2518
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2519
|
+
)
|
|
2520
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2521
|
+
if g_param[OptionsDefine.Language]:
|
|
2522
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2523
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2524
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2525
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2526
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2527
|
+
model = models.DescribeResourceScheduleDiffDetailRequest()
|
|
2528
|
+
model.from_json_string(json.dumps(args))
|
|
2529
|
+
start_time = time.time()
|
|
2530
|
+
while True:
|
|
2531
|
+
rsp = client.DescribeResourceScheduleDiffDetail(model)
|
|
2532
|
+
result = rsp.to_json_string()
|
|
2533
|
+
try:
|
|
2534
|
+
json_obj = json.loads(result)
|
|
2535
|
+
except TypeError as e:
|
|
2536
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2537
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2538
|
+
break
|
|
2539
|
+
cur_time = time.time()
|
|
2540
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2541
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2542
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2543
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2544
|
+
else:
|
|
2545
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2546
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2547
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2548
|
+
|
|
2549
|
+
|
|
2550
|
+
def doDescribeSLInstance(args, parsed_globals):
|
|
2551
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2552
|
+
|
|
2553
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2554
|
+
cred = credential.CVMRoleCredential()
|
|
2555
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2556
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2557
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2558
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2559
|
+
)
|
|
2560
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2561
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2562
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2563
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2564
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2565
|
+
else:
|
|
2566
|
+
cred = credential.Credential(
|
|
2567
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2568
|
+
)
|
|
2569
|
+
http_profile = HttpProfile(
|
|
2570
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2571
|
+
reqMethod="POST",
|
|
2572
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2573
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2574
|
+
)
|
|
2575
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2576
|
+
if g_param[OptionsDefine.Language]:
|
|
2577
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2578
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2579
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2580
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2581
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2582
|
+
model = models.DescribeSLInstanceRequest()
|
|
2583
|
+
model.from_json_string(json.dumps(args))
|
|
2584
|
+
start_time = time.time()
|
|
2585
|
+
while True:
|
|
2586
|
+
rsp = client.DescribeSLInstance(model)
|
|
2587
|
+
result = rsp.to_json_string()
|
|
2588
|
+
try:
|
|
2589
|
+
json_obj = json.loads(result)
|
|
2590
|
+
except TypeError as e:
|
|
2591
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2592
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2593
|
+
break
|
|
2594
|
+
cur_time = time.time()
|
|
2595
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2596
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2597
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2598
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2599
|
+
else:
|
|
2600
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2601
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2602
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2603
|
+
|
|
2604
|
+
|
|
2605
|
+
def doDescribeSparkQueries(args, parsed_globals):
|
|
2606
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2607
|
+
|
|
2608
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2609
|
+
cred = credential.CVMRoleCredential()
|
|
2610
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2611
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2612
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2613
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2614
|
+
)
|
|
2615
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2616
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2617
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2618
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2619
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2620
|
+
else:
|
|
2621
|
+
cred = credential.Credential(
|
|
2622
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2623
|
+
)
|
|
2624
|
+
http_profile = HttpProfile(
|
|
2625
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2626
|
+
reqMethod="POST",
|
|
2627
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2628
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2629
|
+
)
|
|
2630
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2631
|
+
if g_param[OptionsDefine.Language]:
|
|
2632
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2633
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2634
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2635
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2636
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2637
|
+
model = models.DescribeSparkQueriesRequest()
|
|
2638
|
+
model.from_json_string(json.dumps(args))
|
|
2639
|
+
start_time = time.time()
|
|
2640
|
+
while True:
|
|
2641
|
+
rsp = client.DescribeSparkQueries(model)
|
|
2642
|
+
result = rsp.to_json_string()
|
|
2643
|
+
try:
|
|
2644
|
+
json_obj = json.loads(result)
|
|
2645
|
+
except TypeError as e:
|
|
2646
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2647
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2648
|
+
break
|
|
2649
|
+
cur_time = time.time()
|
|
2650
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2651
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2652
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2653
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2654
|
+
else:
|
|
2655
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2656
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2657
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2658
|
+
|
|
2659
|
+
|
|
2660
|
+
def doModifyAutoRenewFlag(args, parsed_globals):
|
|
2661
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2662
|
+
|
|
2663
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2664
|
+
cred = credential.CVMRoleCredential()
|
|
2665
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2666
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2667
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2668
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2669
|
+
)
|
|
2670
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2671
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2672
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2673
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2674
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2675
|
+
else:
|
|
2676
|
+
cred = credential.Credential(
|
|
2677
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2678
|
+
)
|
|
2679
|
+
http_profile = HttpProfile(
|
|
2680
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2681
|
+
reqMethod="POST",
|
|
2682
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2683
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2684
|
+
)
|
|
2685
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2686
|
+
if g_param[OptionsDefine.Language]:
|
|
2687
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2688
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2689
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2690
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2691
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2692
|
+
model = models.ModifyAutoRenewFlagRequest()
|
|
2693
|
+
model.from_json_string(json.dumps(args))
|
|
2694
|
+
start_time = time.time()
|
|
2695
|
+
while True:
|
|
2696
|
+
rsp = client.ModifyAutoRenewFlag(model)
|
|
2697
|
+
result = rsp.to_json_string()
|
|
2698
|
+
try:
|
|
2699
|
+
json_obj = json.loads(result)
|
|
2700
|
+
except TypeError as e:
|
|
2701
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2702
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2703
|
+
break
|
|
2704
|
+
cur_time = time.time()
|
|
2705
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2706
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2707
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2708
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2709
|
+
else:
|
|
2710
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2711
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2712
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2713
|
+
|
|
2714
|
+
|
|
2715
|
+
def doModifyResource(args, parsed_globals):
|
|
2716
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2717
|
+
|
|
2718
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2719
|
+
cred = credential.CVMRoleCredential()
|
|
2720
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2721
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2722
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2723
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2724
|
+
)
|
|
2725
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2726
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2727
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2728
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2729
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2730
|
+
else:
|
|
2731
|
+
cred = credential.Credential(
|
|
2732
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2733
|
+
)
|
|
2734
|
+
http_profile = HttpProfile(
|
|
2735
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2736
|
+
reqMethod="POST",
|
|
2737
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2738
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2739
|
+
)
|
|
2740
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2741
|
+
if g_param[OptionsDefine.Language]:
|
|
2742
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2743
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2744
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2745
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2746
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2747
|
+
model = models.ModifyResourceRequest()
|
|
2748
|
+
model.from_json_string(json.dumps(args))
|
|
2749
|
+
start_time = time.time()
|
|
2750
|
+
while True:
|
|
2751
|
+
rsp = client.ModifyResource(model)
|
|
2752
|
+
result = rsp.to_json_string()
|
|
2753
|
+
try:
|
|
2754
|
+
json_obj = json.loads(result)
|
|
2755
|
+
except TypeError as e:
|
|
2756
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2757
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2758
|
+
break
|
|
2759
|
+
cur_time = time.time()
|
|
2760
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2761
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2762
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2763
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2764
|
+
else:
|
|
2765
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2766
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2767
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2768
|
+
|
|
2769
|
+
|
|
2770
|
+
def doInquiryPriceCreateInstance(args, parsed_globals):
|
|
2771
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2772
|
+
|
|
2773
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2774
|
+
cred = credential.CVMRoleCredential()
|
|
2775
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2776
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2777
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2778
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2779
|
+
)
|
|
2780
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2781
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2782
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2783
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2784
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2785
|
+
else:
|
|
2786
|
+
cred = credential.Credential(
|
|
2787
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2788
|
+
)
|
|
2789
|
+
http_profile = HttpProfile(
|
|
2790
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2791
|
+
reqMethod="POST",
|
|
2792
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2793
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2794
|
+
)
|
|
2795
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2796
|
+
if g_param[OptionsDefine.Language]:
|
|
2797
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2798
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2799
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2800
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2801
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2802
|
+
model = models.InquiryPriceCreateInstanceRequest()
|
|
2803
|
+
model.from_json_string(json.dumps(args))
|
|
2804
|
+
start_time = time.time()
|
|
2805
|
+
while True:
|
|
2806
|
+
rsp = client.InquiryPriceCreateInstance(model)
|
|
2807
|
+
result = rsp.to_json_string()
|
|
2808
|
+
try:
|
|
2809
|
+
json_obj = json.loads(result)
|
|
2810
|
+
except TypeError as e:
|
|
2811
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2812
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2813
|
+
break
|
|
2814
|
+
cur_time = time.time()
|
|
2815
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2816
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2817
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2818
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2819
|
+
else:
|
|
2820
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2821
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2822
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2823
|
+
|
|
2824
|
+
|
|
2825
|
+
def doDescribeResourceSchedule(args, parsed_globals):
|
|
2826
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2827
|
+
|
|
2828
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2829
|
+
cred = credential.CVMRoleCredential()
|
|
2830
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2831
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2832
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2833
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2834
|
+
)
|
|
2835
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2836
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2837
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2838
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
2839
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
2840
|
+
else:
|
|
2841
|
+
cred = credential.Credential(
|
|
2842
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
2843
|
+
)
|
|
2844
|
+
http_profile = HttpProfile(
|
|
2845
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
2846
|
+
reqMethod="POST",
|
|
2847
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
2848
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
2849
|
+
)
|
|
2850
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
2851
|
+
if g_param[OptionsDefine.Language]:
|
|
2852
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
2853
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
2854
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2855
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2856
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2857
|
+
model = models.DescribeResourceScheduleRequest()
|
|
2858
|
+
model.from_json_string(json.dumps(args))
|
|
2859
|
+
start_time = time.time()
|
|
2860
|
+
while True:
|
|
2861
|
+
rsp = client.DescribeResourceSchedule(model)
|
|
2862
|
+
result = rsp.to_json_string()
|
|
2863
|
+
try:
|
|
2864
|
+
json_obj = json.loads(result)
|
|
2865
|
+
except TypeError as e:
|
|
2866
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
2867
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
2868
|
+
break
|
|
2869
|
+
cur_time = time.time()
|
|
2870
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
2871
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
2872
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
2873
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
2874
|
+
else:
|
|
2875
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
2876
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
2877
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
2878
|
+
|
|
2879
|
+
|
|
2880
|
+
def doResizeDataDisks(args, parsed_globals):
|
|
2881
|
+
g_param = parse_global_arg(parsed_globals)
|
|
2882
|
+
|
|
2883
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
2884
|
+
cred = credential.CVMRoleCredential()
|
|
2885
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
2886
|
+
cred = credential.STSAssumeRoleCredential(
|
|
2887
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
2888
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
2889
|
+
)
|
|
2890
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2891
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2892
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2893
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
187
2894
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
188
2895
|
else:
|
|
189
2896
|
cred = credential.Credential(
|
|
@@ -195,18 +2902,18 @@ def doInquiryPriceRenewInstance(args, parsed_globals):
|
|
|
195
2902
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
196
2903
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
197
2904
|
)
|
|
198
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
2905
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
199
2906
|
if g_param[OptionsDefine.Language]:
|
|
200
2907
|
profile.language = g_param[OptionsDefine.Language]
|
|
201
2908
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
202
2909
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
203
2910
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
204
2911
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
205
|
-
model = models.
|
|
2912
|
+
model = models.ResizeDataDisksRequest()
|
|
206
2913
|
model.from_json_string(json.dumps(args))
|
|
207
2914
|
start_time = time.time()
|
|
208
2915
|
while True:
|
|
209
|
-
rsp = client.
|
|
2916
|
+
rsp = client.ResizeDataDisks(model)
|
|
210
2917
|
result = rsp.to_json_string()
|
|
211
2918
|
try:
|
|
212
2919
|
json_obj = json.loads(result)
|
|
@@ -225,7 +2932,7 @@ def doInquiryPriceRenewInstance(args, parsed_globals):
|
|
|
225
2932
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
226
2933
|
|
|
227
2934
|
|
|
228
|
-
def
|
|
2935
|
+
def doModifyResourceScheduleConfig(args, parsed_globals):
|
|
229
2936
|
g_param = parse_global_arg(parsed_globals)
|
|
230
2937
|
|
|
231
2938
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -235,7 +2942,10 @@ def doInquiryPriceScaleOutInstance(args, parsed_globals):
|
|
|
235
2942
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
236
2943
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
237
2944
|
)
|
|
238
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
2945
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
2946
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
2947
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
2948
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
239
2949
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
240
2950
|
else:
|
|
241
2951
|
cred = credential.Credential(
|
|
@@ -247,18 +2957,18 @@ def doInquiryPriceScaleOutInstance(args, parsed_globals):
|
|
|
247
2957
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
248
2958
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
249
2959
|
)
|
|
250
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
2960
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
251
2961
|
if g_param[OptionsDefine.Language]:
|
|
252
2962
|
profile.language = g_param[OptionsDefine.Language]
|
|
253
2963
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
254
2964
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
255
2965
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
256
2966
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
257
|
-
model = models.
|
|
2967
|
+
model = models.ModifyResourceScheduleConfigRequest()
|
|
258
2968
|
model.from_json_string(json.dumps(args))
|
|
259
2969
|
start_time = time.time()
|
|
260
2970
|
while True:
|
|
261
|
-
rsp = client.
|
|
2971
|
+
rsp = client.ModifyResourceScheduleConfig(model)
|
|
262
2972
|
result = rsp.to_json_string()
|
|
263
2973
|
try:
|
|
264
2974
|
json_obj = json.loads(result)
|
|
@@ -277,7 +2987,7 @@ def doInquiryPriceScaleOutInstance(args, parsed_globals):
|
|
|
277
2987
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
278
2988
|
|
|
279
2989
|
|
|
280
|
-
def
|
|
2990
|
+
def doDescribeHiveQueries(args, parsed_globals):
|
|
281
2991
|
g_param = parse_global_arg(parsed_globals)
|
|
282
2992
|
|
|
283
2993
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -287,7 +2997,10 @@ def doDescribeAutoScaleRecords(args, parsed_globals):
|
|
|
287
2997
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
288
2998
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
289
2999
|
)
|
|
290
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3000
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3001
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3002
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3003
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
291
3004
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
292
3005
|
else:
|
|
293
3006
|
cred = credential.Credential(
|
|
@@ -299,18 +3012,18 @@ def doDescribeAutoScaleRecords(args, parsed_globals):
|
|
|
299
3012
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
300
3013
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
301
3014
|
)
|
|
302
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3015
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
303
3016
|
if g_param[OptionsDefine.Language]:
|
|
304
3017
|
profile.language = g_param[OptionsDefine.Language]
|
|
305
3018
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
306
3019
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
307
3020
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
308
3021
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
309
|
-
model = models.
|
|
3022
|
+
model = models.DescribeHiveQueriesRequest()
|
|
310
3023
|
model.from_json_string(json.dumps(args))
|
|
311
3024
|
start_time = time.time()
|
|
312
3025
|
while True:
|
|
313
|
-
rsp = client.
|
|
3026
|
+
rsp = client.DescribeHiveQueries(model)
|
|
314
3027
|
result = rsp.to_json_string()
|
|
315
3028
|
try:
|
|
316
3029
|
json_obj = json.loads(result)
|
|
@@ -329,7 +3042,7 @@ def doDescribeAutoScaleRecords(args, parsed_globals):
|
|
|
329
3042
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
330
3043
|
|
|
331
3044
|
|
|
332
|
-
def
|
|
3045
|
+
def doStartStopServiceOrMonitor(args, parsed_globals):
|
|
333
3046
|
g_param = parse_global_arg(parsed_globals)
|
|
334
3047
|
|
|
335
3048
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -339,7 +3052,10 @@ def doScaleOutInstance(args, parsed_globals):
|
|
|
339
3052
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
340
3053
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
341
3054
|
)
|
|
342
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3055
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3056
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3057
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3058
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
343
3059
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
344
3060
|
else:
|
|
345
3061
|
cred = credential.Credential(
|
|
@@ -351,18 +3067,128 @@ def doScaleOutInstance(args, parsed_globals):
|
|
|
351
3067
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
352
3068
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
353
3069
|
)
|
|
354
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3070
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
355
3071
|
if g_param[OptionsDefine.Language]:
|
|
356
3072
|
profile.language = g_param[OptionsDefine.Language]
|
|
357
3073
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
358
3074
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
359
3075
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
360
3076
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
361
|
-
model = models.
|
|
3077
|
+
model = models.StartStopServiceOrMonitorRequest()
|
|
362
3078
|
model.from_json_string(json.dumps(args))
|
|
363
3079
|
start_time = time.time()
|
|
364
3080
|
while True:
|
|
365
|
-
rsp = client.
|
|
3081
|
+
rsp = client.StartStopServiceOrMonitor(model)
|
|
3082
|
+
result = rsp.to_json_string()
|
|
3083
|
+
try:
|
|
3084
|
+
json_obj = json.loads(result)
|
|
3085
|
+
except TypeError as e:
|
|
3086
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
3087
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
3088
|
+
break
|
|
3089
|
+
cur_time = time.time()
|
|
3090
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
3091
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
3092
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
3093
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
3094
|
+
else:
|
|
3095
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
3096
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
3097
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
3098
|
+
|
|
3099
|
+
|
|
3100
|
+
def doDescribeYarnScheduleHistory(args, parsed_globals):
|
|
3101
|
+
g_param = parse_global_arg(parsed_globals)
|
|
3102
|
+
|
|
3103
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
3104
|
+
cred = credential.CVMRoleCredential()
|
|
3105
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
3106
|
+
cred = credential.STSAssumeRoleCredential(
|
|
3107
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
3108
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
3109
|
+
)
|
|
3110
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3111
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3112
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3113
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
3114
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
3115
|
+
else:
|
|
3116
|
+
cred = credential.Credential(
|
|
3117
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
3118
|
+
)
|
|
3119
|
+
http_profile = HttpProfile(
|
|
3120
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
3121
|
+
reqMethod="POST",
|
|
3122
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
3123
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
3124
|
+
)
|
|
3125
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
3126
|
+
if g_param[OptionsDefine.Language]:
|
|
3127
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
3128
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
3129
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
3130
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
3131
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
3132
|
+
model = models.DescribeYarnScheduleHistoryRequest()
|
|
3133
|
+
model.from_json_string(json.dumps(args))
|
|
3134
|
+
start_time = time.time()
|
|
3135
|
+
while True:
|
|
3136
|
+
rsp = client.DescribeYarnScheduleHistory(model)
|
|
3137
|
+
result = rsp.to_json_string()
|
|
3138
|
+
try:
|
|
3139
|
+
json_obj = json.loads(result)
|
|
3140
|
+
except TypeError as e:
|
|
3141
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
3142
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
3143
|
+
break
|
|
3144
|
+
cur_time = time.time()
|
|
3145
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
3146
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
3147
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
3148
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
3149
|
+
else:
|
|
3150
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
3151
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
3152
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
3153
|
+
|
|
3154
|
+
|
|
3155
|
+
def doModifyGlobalConfig(args, parsed_globals):
|
|
3156
|
+
g_param = parse_global_arg(parsed_globals)
|
|
3157
|
+
|
|
3158
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
3159
|
+
cred = credential.CVMRoleCredential()
|
|
3160
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
3161
|
+
cred = credential.STSAssumeRoleCredential(
|
|
3162
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
3163
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
3164
|
+
)
|
|
3165
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3166
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3167
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3168
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
3169
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
3170
|
+
else:
|
|
3171
|
+
cred = credential.Credential(
|
|
3172
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
3173
|
+
)
|
|
3174
|
+
http_profile = HttpProfile(
|
|
3175
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
3176
|
+
reqMethod="POST",
|
|
3177
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
3178
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
3179
|
+
)
|
|
3180
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
3181
|
+
if g_param[OptionsDefine.Language]:
|
|
3182
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
3183
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
3184
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
3185
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
3186
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
3187
|
+
model = models.ModifyGlobalConfigRequest()
|
|
3188
|
+
model.from_json_string(json.dumps(args))
|
|
3189
|
+
start_time = time.time()
|
|
3190
|
+
while True:
|
|
3191
|
+
rsp = client.ModifyGlobalConfig(model)
|
|
366
3192
|
result = rsp.to_json_string()
|
|
367
3193
|
try:
|
|
368
3194
|
json_obj = json.loads(result)
|
|
@@ -391,7 +3217,10 @@ def doTerminateInstance(args, parsed_globals):
|
|
|
391
3217
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
392
3218
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
393
3219
|
)
|
|
394
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3220
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3221
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3222
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3223
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
395
3224
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
396
3225
|
else:
|
|
397
3226
|
cred = credential.Credential(
|
|
@@ -403,7 +3232,7 @@ def doTerminateInstance(args, parsed_globals):
|
|
|
403
3232
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
404
3233
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
405
3234
|
)
|
|
406
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3235
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
407
3236
|
if g_param[OptionsDefine.Language]:
|
|
408
3237
|
profile.language = g_param[OptionsDefine.Language]
|
|
409
3238
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
@@ -433,7 +3262,7 @@ def doTerminateInstance(args, parsed_globals):
|
|
|
433
3262
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
434
3263
|
|
|
435
3264
|
|
|
436
|
-
def
|
|
3265
|
+
def doModifySLInstance(args, parsed_globals):
|
|
437
3266
|
g_param = parse_global_arg(parsed_globals)
|
|
438
3267
|
|
|
439
3268
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -443,7 +3272,10 @@ def doDescribeInstances(args, parsed_globals):
|
|
|
443
3272
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
444
3273
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
445
3274
|
)
|
|
446
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3275
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3276
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3277
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3278
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
447
3279
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
448
3280
|
else:
|
|
449
3281
|
cred = credential.Credential(
|
|
@@ -455,18 +3287,18 @@ def doDescribeInstances(args, parsed_globals):
|
|
|
455
3287
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
456
3288
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
457
3289
|
)
|
|
458
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3290
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
459
3291
|
if g_param[OptionsDefine.Language]:
|
|
460
3292
|
profile.language = g_param[OptionsDefine.Language]
|
|
461
3293
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
462
3294
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
463
3295
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
464
3296
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
465
|
-
model = models.
|
|
3297
|
+
model = models.ModifySLInstanceRequest()
|
|
466
3298
|
model.from_json_string(json.dumps(args))
|
|
467
3299
|
start_time = time.time()
|
|
468
3300
|
while True:
|
|
469
|
-
rsp = client.
|
|
3301
|
+
rsp = client.ModifySLInstance(model)
|
|
470
3302
|
result = rsp.to_json_string()
|
|
471
3303
|
try:
|
|
472
3304
|
json_obj = json.loads(result)
|
|
@@ -485,7 +3317,7 @@ def doDescribeInstances(args, parsed_globals):
|
|
|
485
3317
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
486
3318
|
|
|
487
3319
|
|
|
488
|
-
def
|
|
3320
|
+
def doDescribeNodeDataDisks(args, parsed_globals):
|
|
489
3321
|
g_param = parse_global_arg(parsed_globals)
|
|
490
3322
|
|
|
491
3323
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -495,7 +3327,10 @@ def doTerminateClusterNodes(args, parsed_globals):
|
|
|
495
3327
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
496
3328
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
497
3329
|
)
|
|
498
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3330
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3331
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3332
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3333
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
499
3334
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
500
3335
|
else:
|
|
501
3336
|
cred = credential.Credential(
|
|
@@ -507,18 +3342,18 @@ def doTerminateClusterNodes(args, parsed_globals):
|
|
|
507
3342
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
508
3343
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
509
3344
|
)
|
|
510
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3345
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
511
3346
|
if g_param[OptionsDefine.Language]:
|
|
512
3347
|
profile.language = g_param[OptionsDefine.Language]
|
|
513
3348
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
514
3349
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
515
3350
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
516
3351
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
517
|
-
model = models.
|
|
3352
|
+
model = models.DescribeNodeDataDisksRequest()
|
|
518
3353
|
model.from_json_string(json.dumps(args))
|
|
519
3354
|
start_time = time.time()
|
|
520
3355
|
while True:
|
|
521
|
-
rsp = client.
|
|
3356
|
+
rsp = client.DescribeNodeDataDisks(model)
|
|
522
3357
|
result = rsp.to_json_string()
|
|
523
3358
|
try:
|
|
524
3359
|
json_obj = json.loads(result)
|
|
@@ -537,7 +3372,7 @@ def doTerminateClusterNodes(args, parsed_globals):
|
|
|
537
3372
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
538
3373
|
|
|
539
3374
|
|
|
540
|
-
def
|
|
3375
|
+
def doDescribeNodeResourceConfigFast(args, parsed_globals):
|
|
541
3376
|
g_param = parse_global_arg(parsed_globals)
|
|
542
3377
|
|
|
543
3378
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -547,7 +3382,10 @@ def doDescribeUsersForUserManager(args, parsed_globals):
|
|
|
547
3382
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
548
3383
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
549
3384
|
)
|
|
550
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3385
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3386
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3387
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3388
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
551
3389
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
552
3390
|
else:
|
|
553
3391
|
cred = credential.Credential(
|
|
@@ -559,18 +3397,18 @@ def doDescribeUsersForUserManager(args, parsed_globals):
|
|
|
559
3397
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
560
3398
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
561
3399
|
)
|
|
562
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3400
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
563
3401
|
if g_param[OptionsDefine.Language]:
|
|
564
3402
|
profile.language = g_param[OptionsDefine.Language]
|
|
565
3403
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
566
3404
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
567
3405
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
568
3406
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
569
|
-
model = models.
|
|
3407
|
+
model = models.DescribeNodeResourceConfigFastRequest()
|
|
570
3408
|
model.from_json_string(json.dumps(args))
|
|
571
3409
|
start_time = time.time()
|
|
572
3410
|
while True:
|
|
573
|
-
rsp = client.
|
|
3411
|
+
rsp = client.DescribeNodeResourceConfigFast(model)
|
|
574
3412
|
result = rsp.to_json_string()
|
|
575
3413
|
try:
|
|
576
3414
|
json_obj = json.loads(result)
|
|
@@ -589,7 +3427,7 @@ def doDescribeUsersForUserManager(args, parsed_globals):
|
|
|
589
3427
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
590
3428
|
|
|
591
3429
|
|
|
592
|
-
def
|
|
3430
|
+
def doDescribeAutoScaleStrategies(args, parsed_globals):
|
|
593
3431
|
g_param = parse_global_arg(parsed_globals)
|
|
594
3432
|
|
|
595
3433
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -599,7 +3437,10 @@ def doModifyUserManagerPwd(args, parsed_globals):
|
|
|
599
3437
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
600
3438
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
601
3439
|
)
|
|
602
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3440
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3441
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3442
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3443
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
603
3444
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
604
3445
|
else:
|
|
605
3446
|
cred = credential.Credential(
|
|
@@ -611,18 +3452,18 @@ def doModifyUserManagerPwd(args, parsed_globals):
|
|
|
611
3452
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
612
3453
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
613
3454
|
)
|
|
614
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3455
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
615
3456
|
if g_param[OptionsDefine.Language]:
|
|
616
3457
|
profile.language = g_param[OptionsDefine.Language]
|
|
617
3458
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
618
3459
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
619
3460
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
620
3461
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
621
|
-
model = models.
|
|
3462
|
+
model = models.DescribeAutoScaleStrategiesRequest()
|
|
622
3463
|
model.from_json_string(json.dumps(args))
|
|
623
3464
|
start_time = time.time()
|
|
624
3465
|
while True:
|
|
625
|
-
rsp = client.
|
|
3466
|
+
rsp = client.DescribeAutoScaleStrategies(model)
|
|
626
3467
|
result = rsp.to_json_string()
|
|
627
3468
|
try:
|
|
628
3469
|
json_obj = json.loads(result)
|
|
@@ -641,7 +3482,7 @@ def doModifyUserManagerPwd(args, parsed_globals):
|
|
|
641
3482
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
642
3483
|
|
|
643
3484
|
|
|
644
|
-
def
|
|
3485
|
+
def doDescribeGlobalConfig(args, parsed_globals):
|
|
645
3486
|
g_param = parse_global_arg(parsed_globals)
|
|
646
3487
|
|
|
647
3488
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -651,7 +3492,10 @@ def doAddUsersForUserManager(args, parsed_globals):
|
|
|
651
3492
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
652
3493
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
653
3494
|
)
|
|
654
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3495
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3496
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3497
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3498
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
655
3499
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
656
3500
|
else:
|
|
657
3501
|
cred = credential.Credential(
|
|
@@ -663,18 +3507,18 @@ def doAddUsersForUserManager(args, parsed_globals):
|
|
|
663
3507
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
664
3508
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
665
3509
|
)
|
|
666
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3510
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
667
3511
|
if g_param[OptionsDefine.Language]:
|
|
668
3512
|
profile.language = g_param[OptionsDefine.Language]
|
|
669
3513
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
670
3514
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
671
3515
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
672
3516
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
673
|
-
model = models.
|
|
3517
|
+
model = models.DescribeGlobalConfigRequest()
|
|
674
3518
|
model.from_json_string(json.dumps(args))
|
|
675
3519
|
start_time = time.time()
|
|
676
3520
|
while True:
|
|
677
|
-
rsp = client.
|
|
3521
|
+
rsp = client.DescribeGlobalConfig(model)
|
|
678
3522
|
result = rsp.to_json_string()
|
|
679
3523
|
try:
|
|
680
3524
|
json_obj = json.loads(result)
|
|
@@ -693,7 +3537,7 @@ def doAddUsersForUserManager(args, parsed_globals):
|
|
|
693
3537
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
694
3538
|
|
|
695
3539
|
|
|
696
|
-
def
|
|
3540
|
+
def doDescribeAutoScaleGroupGlobalConf(args, parsed_globals):
|
|
697
3541
|
g_param = parse_global_arg(parsed_globals)
|
|
698
3542
|
|
|
699
3543
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -703,7 +3547,10 @@ def doScaleOutCluster(args, parsed_globals):
|
|
|
703
3547
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
704
3548
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
705
3549
|
)
|
|
706
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3550
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3551
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3552
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3553
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
707
3554
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
708
3555
|
else:
|
|
709
3556
|
cred = credential.Credential(
|
|
@@ -715,18 +3562,18 @@ def doScaleOutCluster(args, parsed_globals):
|
|
|
715
3562
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
716
3563
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
717
3564
|
)
|
|
718
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3565
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
719
3566
|
if g_param[OptionsDefine.Language]:
|
|
720
3567
|
profile.language = g_param[OptionsDefine.Language]
|
|
721
3568
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
722
3569
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
723
3570
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
724
3571
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
725
|
-
model = models.
|
|
3572
|
+
model = models.DescribeAutoScaleGroupGlobalConfRequest()
|
|
726
3573
|
model.from_json_string(json.dumps(args))
|
|
727
3574
|
start_time = time.time()
|
|
728
3575
|
while True:
|
|
729
|
-
rsp = client.
|
|
3576
|
+
rsp = client.DescribeAutoScaleGroupGlobalConf(model)
|
|
730
3577
|
result = rsp.to_json_string()
|
|
731
3578
|
try:
|
|
732
3579
|
json_obj = json.loads(result)
|
|
@@ -745,7 +3592,7 @@ def doScaleOutCluster(args, parsed_globals):
|
|
|
745
3592
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
746
3593
|
|
|
747
3594
|
|
|
748
|
-
def
|
|
3595
|
+
def doDescribeDAGInfo(args, parsed_globals):
|
|
749
3596
|
g_param = parse_global_arg(parsed_globals)
|
|
750
3597
|
|
|
751
3598
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -755,7 +3602,10 @@ def doModifyResourceScheduler(args, parsed_globals):
|
|
|
755
3602
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
756
3603
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
757
3604
|
)
|
|
758
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3605
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3606
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3607
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3608
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
759
3609
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
760
3610
|
else:
|
|
761
3611
|
cred = credential.Credential(
|
|
@@ -767,18 +3617,18 @@ def doModifyResourceScheduler(args, parsed_globals):
|
|
|
767
3617
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
768
3618
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
769
3619
|
)
|
|
770
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3620
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
771
3621
|
if g_param[OptionsDefine.Language]:
|
|
772
3622
|
profile.language = g_param[OptionsDefine.Language]
|
|
773
3623
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
774
3624
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
775
3625
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
776
3626
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
777
|
-
model = models.
|
|
3627
|
+
model = models.DescribeDAGInfoRequest()
|
|
778
3628
|
model.from_json_string(json.dumps(args))
|
|
779
3629
|
start_time = time.time()
|
|
780
3630
|
while True:
|
|
781
|
-
rsp = client.
|
|
3631
|
+
rsp = client.DescribeDAGInfo(model)
|
|
782
3632
|
result = rsp.to_json_string()
|
|
783
3633
|
try:
|
|
784
3634
|
json_obj = json.loads(result)
|
|
@@ -797,7 +3647,7 @@ def doModifyResourceScheduler(args, parsed_globals):
|
|
|
797
3647
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
798
3648
|
|
|
799
3649
|
|
|
800
|
-
def
|
|
3650
|
+
def doDescribeClusterNodes(args, parsed_globals):
|
|
801
3651
|
g_param = parse_global_arg(parsed_globals)
|
|
802
3652
|
|
|
803
3653
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -807,7 +3657,10 @@ def doCreateInstance(args, parsed_globals):
|
|
|
807
3657
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
808
3658
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
809
3659
|
)
|
|
810
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3660
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3661
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3662
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3663
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
811
3664
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
812
3665
|
else:
|
|
813
3666
|
cred = credential.Credential(
|
|
@@ -819,18 +3672,18 @@ def doCreateInstance(args, parsed_globals):
|
|
|
819
3672
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
820
3673
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
821
3674
|
)
|
|
822
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3675
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
823
3676
|
if g_param[OptionsDefine.Language]:
|
|
824
3677
|
profile.language = g_param[OptionsDefine.Language]
|
|
825
3678
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
826
3679
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
827
3680
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
828
3681
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
829
|
-
model = models.
|
|
3682
|
+
model = models.DescribeClusterNodesRequest()
|
|
830
3683
|
model.from_json_string(json.dumps(args))
|
|
831
3684
|
start_time = time.time()
|
|
832
3685
|
while True:
|
|
833
|
-
rsp = client.
|
|
3686
|
+
rsp = client.DescribeClusterNodes(model)
|
|
834
3687
|
result = rsp.to_json_string()
|
|
835
3688
|
try:
|
|
836
3689
|
json_obj = json.loads(result)
|
|
@@ -849,7 +3702,7 @@ def doCreateInstance(args, parsed_globals):
|
|
|
849
3702
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
850
3703
|
|
|
851
3704
|
|
|
852
|
-
def
|
|
3705
|
+
def doDescribeTrinoQueryInfo(args, parsed_globals):
|
|
853
3706
|
g_param = parse_global_arg(parsed_globals)
|
|
854
3707
|
|
|
855
3708
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -859,7 +3712,10 @@ def doInquiryPriceCreateInstance(args, parsed_globals):
|
|
|
859
3712
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
860
3713
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
861
3714
|
)
|
|
862
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3715
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3716
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3717
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3718
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
863
3719
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
864
3720
|
else:
|
|
865
3721
|
cred = credential.Credential(
|
|
@@ -871,18 +3727,18 @@ def doInquiryPriceCreateInstance(args, parsed_globals):
|
|
|
871
3727
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
872
3728
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
873
3729
|
)
|
|
874
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3730
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
875
3731
|
if g_param[OptionsDefine.Language]:
|
|
876
3732
|
profile.language = g_param[OptionsDefine.Language]
|
|
877
3733
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
878
3734
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
879
3735
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
880
3736
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
881
|
-
model = models.
|
|
3737
|
+
model = models.DescribeTrinoQueryInfoRequest()
|
|
882
3738
|
model.from_json_string(json.dumps(args))
|
|
883
3739
|
start_time = time.time()
|
|
884
3740
|
while True:
|
|
885
|
-
rsp = client.
|
|
3741
|
+
rsp = client.DescribeTrinoQueryInfo(model)
|
|
886
3742
|
result = rsp.to_json_string()
|
|
887
3743
|
try:
|
|
888
3744
|
json_obj = json.loads(result)
|
|
@@ -901,7 +3757,7 @@ def doInquiryPriceCreateInstance(args, parsed_globals):
|
|
|
901
3757
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
902
3758
|
|
|
903
3759
|
|
|
904
|
-
def
|
|
3760
|
+
def doDescribeInstancesList(args, parsed_globals):
|
|
905
3761
|
g_param = parse_global_arg(parsed_globals)
|
|
906
3762
|
|
|
907
3763
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -911,7 +3767,10 @@ def doDescribeResourceSchedule(args, parsed_globals):
|
|
|
911
3767
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
912
3768
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
913
3769
|
)
|
|
914
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3770
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3771
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3772
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3773
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
915
3774
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
916
3775
|
else:
|
|
917
3776
|
cred = credential.Credential(
|
|
@@ -923,18 +3782,18 @@ def doDescribeResourceSchedule(args, parsed_globals):
|
|
|
923
3782
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
924
3783
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
925
3784
|
)
|
|
926
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3785
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
927
3786
|
if g_param[OptionsDefine.Language]:
|
|
928
3787
|
profile.language = g_param[OptionsDefine.Language]
|
|
929
3788
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
930
3789
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
931
3790
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
932
3791
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
933
|
-
model = models.
|
|
3792
|
+
model = models.DescribeInstancesListRequest()
|
|
934
3793
|
model.from_json_string(json.dumps(args))
|
|
935
3794
|
start_time = time.time()
|
|
936
3795
|
while True:
|
|
937
|
-
rsp = client.
|
|
3796
|
+
rsp = client.DescribeInstancesList(model)
|
|
938
3797
|
result = rsp.to_json_string()
|
|
939
3798
|
try:
|
|
940
3799
|
json_obj = json.loads(result)
|
|
@@ -953,7 +3812,7 @@ def doDescribeResourceSchedule(args, parsed_globals):
|
|
|
953
3812
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
954
3813
|
|
|
955
3814
|
|
|
956
|
-
def
|
|
3815
|
+
def doDescribeNodeSpec(args, parsed_globals):
|
|
957
3816
|
g_param = parse_global_arg(parsed_globals)
|
|
958
3817
|
|
|
959
3818
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -963,7 +3822,10 @@ def doModifyResourceScheduleConfig(args, parsed_globals):
|
|
|
963
3822
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
964
3823
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
965
3824
|
)
|
|
966
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3825
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3826
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3827
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3828
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
967
3829
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
968
3830
|
else:
|
|
969
3831
|
cred = credential.Credential(
|
|
@@ -975,18 +3837,18 @@ def doModifyResourceScheduleConfig(args, parsed_globals):
|
|
|
975
3837
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
976
3838
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
977
3839
|
)
|
|
978
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3840
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
979
3841
|
if g_param[OptionsDefine.Language]:
|
|
980
3842
|
profile.language = g_param[OptionsDefine.Language]
|
|
981
3843
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
982
3844
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
983
3845
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
984
3846
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
985
|
-
model = models.
|
|
3847
|
+
model = models.DescribeNodeSpecRequest()
|
|
986
3848
|
model.from_json_string(json.dumps(args))
|
|
987
3849
|
start_time = time.time()
|
|
988
3850
|
while True:
|
|
989
|
-
rsp = client.
|
|
3851
|
+
rsp = client.DescribeNodeSpec(model)
|
|
990
3852
|
result = rsp.to_json_string()
|
|
991
3853
|
try:
|
|
992
3854
|
json_obj = json.loads(result)
|
|
@@ -1005,7 +3867,7 @@ def doModifyResourceScheduleConfig(args, parsed_globals):
|
|
|
1005
3867
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1006
3868
|
|
|
1007
3869
|
|
|
1008
|
-
def
|
|
3870
|
+
def doDescribeInsightList(args, parsed_globals):
|
|
1009
3871
|
g_param = parse_global_arg(parsed_globals)
|
|
1010
3872
|
|
|
1011
3873
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1015,7 +3877,10 @@ def doDescribeHiveQueries(args, parsed_globals):
|
|
|
1015
3877
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1016
3878
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1017
3879
|
)
|
|
1018
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3880
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3881
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3882
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3883
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1019
3884
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1020
3885
|
else:
|
|
1021
3886
|
cred = credential.Credential(
|
|
@@ -1027,18 +3892,18 @@ def doDescribeHiveQueries(args, parsed_globals):
|
|
|
1027
3892
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1028
3893
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1029
3894
|
)
|
|
1030
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3895
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1031
3896
|
if g_param[OptionsDefine.Language]:
|
|
1032
3897
|
profile.language = g_param[OptionsDefine.Language]
|
|
1033
3898
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1034
3899
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1035
3900
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1036
3901
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1037
|
-
model = models.
|
|
3902
|
+
model = models.DescribeInsightListRequest()
|
|
1038
3903
|
model.from_json_string(json.dumps(args))
|
|
1039
3904
|
start_time = time.time()
|
|
1040
3905
|
while True:
|
|
1041
|
-
rsp = client.
|
|
3906
|
+
rsp = client.DescribeInsightList(model)
|
|
1042
3907
|
result = rsp.to_json_string()
|
|
1043
3908
|
try:
|
|
1044
3909
|
json_obj = json.loads(result)
|
|
@@ -1057,7 +3922,7 @@ def doDescribeHiveQueries(args, parsed_globals):
|
|
|
1057
3922
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1058
3923
|
|
|
1059
3924
|
|
|
1060
|
-
def
|
|
3925
|
+
def doDeleteNodeResourceConfig(args, parsed_globals):
|
|
1061
3926
|
g_param = parse_global_arg(parsed_globals)
|
|
1062
3927
|
|
|
1063
3928
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1067,7 +3932,10 @@ def doStartStopServiceOrMonitor(args, parsed_globals):
|
|
|
1067
3932
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1068
3933
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1069
3934
|
)
|
|
1070
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3935
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3936
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3937
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3938
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1071
3939
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1072
3940
|
else:
|
|
1073
3941
|
cred = credential.Credential(
|
|
@@ -1079,18 +3947,18 @@ def doStartStopServiceOrMonitor(args, parsed_globals):
|
|
|
1079
3947
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1080
3948
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1081
3949
|
)
|
|
1082
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
3950
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1083
3951
|
if g_param[OptionsDefine.Language]:
|
|
1084
3952
|
profile.language = g_param[OptionsDefine.Language]
|
|
1085
3953
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1086
3954
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1087
3955
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1088
3956
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1089
|
-
model = models.
|
|
3957
|
+
model = models.DeleteNodeResourceConfigRequest()
|
|
1090
3958
|
model.from_json_string(json.dumps(args))
|
|
1091
3959
|
start_time = time.time()
|
|
1092
3960
|
while True:
|
|
1093
|
-
rsp = client.
|
|
3961
|
+
rsp = client.DeleteNodeResourceConfig(model)
|
|
1094
3962
|
result = rsp.to_json_string()
|
|
1095
3963
|
try:
|
|
1096
3964
|
json_obj = json.loads(result)
|
|
@@ -1109,7 +3977,7 @@ def doStartStopServiceOrMonitor(args, parsed_globals):
|
|
|
1109
3977
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1110
3978
|
|
|
1111
3979
|
|
|
1112
|
-
def
|
|
3980
|
+
def doModifyInstanceBasic(args, parsed_globals):
|
|
1113
3981
|
g_param = parse_global_arg(parsed_globals)
|
|
1114
3982
|
|
|
1115
3983
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1119,7 +3987,10 @@ def doTerminateTasks(args, parsed_globals):
|
|
|
1119
3987
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1120
3988
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1121
3989
|
)
|
|
1122
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
3990
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
3991
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
3992
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
3993
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1123
3994
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1124
3995
|
else:
|
|
1125
3996
|
cred = credential.Credential(
|
|
@@ -1131,18 +4002,18 @@ def doTerminateTasks(args, parsed_globals):
|
|
|
1131
4002
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1132
4003
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1133
4004
|
)
|
|
1134
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
4005
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1135
4006
|
if g_param[OptionsDefine.Language]:
|
|
1136
4007
|
profile.language = g_param[OptionsDefine.Language]
|
|
1137
4008
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1138
4009
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1139
4010
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1140
4011
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1141
|
-
model = models.
|
|
4012
|
+
model = models.ModifyInstanceBasicRequest()
|
|
1142
4013
|
model.from_json_string(json.dumps(args))
|
|
1143
4014
|
start_time = time.time()
|
|
1144
4015
|
while True:
|
|
1145
|
-
rsp = client.
|
|
4016
|
+
rsp = client.ModifyInstanceBasic(model)
|
|
1146
4017
|
result = rsp.to_json_string()
|
|
1147
4018
|
try:
|
|
1148
4019
|
json_obj = json.loads(result)
|
|
@@ -1161,7 +4032,7 @@ def doTerminateTasks(args, parsed_globals):
|
|
|
1161
4032
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1162
4033
|
|
|
1163
4034
|
|
|
1164
|
-
def
|
|
4035
|
+
def doModifyUsersOfGroupSTD(args, parsed_globals):
|
|
1165
4036
|
g_param = parse_global_arg(parsed_globals)
|
|
1166
4037
|
|
|
1167
4038
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1171,7 +4042,10 @@ def doDescribeClusterNodes(args, parsed_globals):
|
|
|
1171
4042
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1172
4043
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1173
4044
|
)
|
|
1174
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
4045
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
4046
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
4047
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
4048
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1175
4049
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1176
4050
|
else:
|
|
1177
4051
|
cred = credential.Credential(
|
|
@@ -1183,18 +4057,18 @@ def doDescribeClusterNodes(args, parsed_globals):
|
|
|
1183
4057
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1184
4058
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1185
4059
|
)
|
|
1186
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
4060
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1187
4061
|
if g_param[OptionsDefine.Language]:
|
|
1188
4062
|
profile.language = g_param[OptionsDefine.Language]
|
|
1189
4063
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1190
4064
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1191
4065
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1192
4066
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1193
|
-
model = models.
|
|
4067
|
+
model = models.ModifyUsersOfGroupSTDRequest()
|
|
1194
4068
|
model.from_json_string(json.dumps(args))
|
|
1195
4069
|
start_time = time.time()
|
|
1196
4070
|
while True:
|
|
1197
|
-
rsp = client.
|
|
4071
|
+
rsp = client.ModifyUsersOfGroupSTD(model)
|
|
1198
4072
|
result = rsp.to_json_string()
|
|
1199
4073
|
try:
|
|
1200
4074
|
json_obj = json.loads(result)
|
|
@@ -1213,7 +4087,7 @@ def doDescribeClusterNodes(args, parsed_globals):
|
|
|
1213
4087
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1214
4088
|
|
|
1215
4089
|
|
|
1216
|
-
def
|
|
4090
|
+
def doModifyInspectionSettings(args, parsed_globals):
|
|
1217
4091
|
g_param = parse_global_arg(parsed_globals)
|
|
1218
4092
|
|
|
1219
4093
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1223,7 +4097,10 @@ def doDescribeInstancesList(args, parsed_globals):
|
|
|
1223
4097
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1224
4098
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1225
4099
|
)
|
|
1226
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
4100
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
4101
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
4102
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
4103
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1227
4104
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1228
4105
|
else:
|
|
1229
4106
|
cred = credential.Credential(
|
|
@@ -1235,18 +4112,18 @@ def doDescribeInstancesList(args, parsed_globals):
|
|
|
1235
4112
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1236
4113
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1237
4114
|
)
|
|
1238
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
4115
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1239
4116
|
if g_param[OptionsDefine.Language]:
|
|
1240
4117
|
profile.language = g_param[OptionsDefine.Language]
|
|
1241
4118
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1242
4119
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1243
4120
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1244
4121
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1245
|
-
model = models.
|
|
4122
|
+
model = models.ModifyInspectionSettingsRequest()
|
|
1246
4123
|
model.from_json_string(json.dumps(args))
|
|
1247
4124
|
start_time = time.time()
|
|
1248
4125
|
while True:
|
|
1249
|
-
rsp = client.
|
|
4126
|
+
rsp = client.ModifyInspectionSettings(model)
|
|
1250
4127
|
result = rsp.to_json_string()
|
|
1251
4128
|
try:
|
|
1252
4129
|
json_obj = json.loads(result)
|
|
@@ -1265,7 +4142,7 @@ def doDescribeInstancesList(args, parsed_globals):
|
|
|
1265
4142
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1266
4143
|
|
|
1267
4144
|
|
|
1268
|
-
def
|
|
4145
|
+
def doDescribeInspectionTaskResult(args, parsed_globals):
|
|
1269
4146
|
g_param = parse_global_arg(parsed_globals)
|
|
1270
4147
|
|
|
1271
4148
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1275,7 +4152,10 @@ def doDescribeEmrApplicationStatics(args, parsed_globals):
|
|
|
1275
4152
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1276
4153
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1277
4154
|
)
|
|
1278
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
4155
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
4156
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
4157
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
4158
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1279
4159
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1280
4160
|
else:
|
|
1281
4161
|
cred = credential.Credential(
|
|
@@ -1287,18 +4167,73 @@ def doDescribeEmrApplicationStatics(args, parsed_globals):
|
|
|
1287
4167
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1288
4168
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1289
4169
|
)
|
|
1290
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
4170
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1291
4171
|
if g_param[OptionsDefine.Language]:
|
|
1292
4172
|
profile.language = g_param[OptionsDefine.Language]
|
|
1293
4173
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1294
4174
|
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1295
4175
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1296
4176
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1297
|
-
model = models.
|
|
4177
|
+
model = models.DescribeInspectionTaskResultRequest()
|
|
1298
4178
|
model.from_json_string(json.dumps(args))
|
|
1299
4179
|
start_time = time.time()
|
|
1300
4180
|
while True:
|
|
1301
|
-
rsp = client.
|
|
4181
|
+
rsp = client.DescribeInspectionTaskResult(model)
|
|
4182
|
+
result = rsp.to_json_string()
|
|
4183
|
+
try:
|
|
4184
|
+
json_obj = json.loads(result)
|
|
4185
|
+
except TypeError as e:
|
|
4186
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
4187
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
4188
|
+
break
|
|
4189
|
+
cur_time = time.time()
|
|
4190
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
4191
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
4192
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
4193
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
4194
|
+
else:
|
|
4195
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
4196
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
4197
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
4198
|
+
|
|
4199
|
+
|
|
4200
|
+
def doScaleOutCluster(args, parsed_globals):
|
|
4201
|
+
g_param = parse_global_arg(parsed_globals)
|
|
4202
|
+
|
|
4203
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
4204
|
+
cred = credential.CVMRoleCredential()
|
|
4205
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
4206
|
+
cred = credential.STSAssumeRoleCredential(
|
|
4207
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
4208
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
4209
|
+
)
|
|
4210
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
4211
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
4212
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
4213
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
4214
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
4215
|
+
else:
|
|
4216
|
+
cred = credential.Credential(
|
|
4217
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
4218
|
+
)
|
|
4219
|
+
http_profile = HttpProfile(
|
|
4220
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
4221
|
+
reqMethod="POST",
|
|
4222
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
4223
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
4224
|
+
)
|
|
4225
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
4226
|
+
if g_param[OptionsDefine.Language]:
|
|
4227
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
4228
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
4229
|
+
client = mod.EmrClient(cred, g_param[OptionsDefine.Region], profile)
|
|
4230
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
4231
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
4232
|
+
model = models.ScaleOutClusterRequest()
|
|
4233
|
+
model.from_json_string(json.dumps(args))
|
|
4234
|
+
start_time = time.time()
|
|
4235
|
+
while True:
|
|
4236
|
+
rsp = client.ScaleOutCluster(model)
|
|
1302
4237
|
result = rsp.to_json_string()
|
|
1303
4238
|
try:
|
|
1304
4239
|
json_obj = json.loads(result)
|
|
@@ -1331,28 +4266,80 @@ ACTION_MAP = {
|
|
|
1331
4266
|
"ModifyResourcesTags": doModifyResourcesTags,
|
|
1332
4267
|
"InquiryPriceUpdateInstance": doInquiryPriceUpdateInstance,
|
|
1333
4268
|
"CreateCluster": doCreateCluster,
|
|
4269
|
+
"DescribeServiceConfGroupInfos": doDescribeServiceConfGroupInfos,
|
|
1334
4270
|
"InquiryPriceRenewInstance": doInquiryPriceRenewInstance,
|
|
4271
|
+
"DescribeGroupsSTD": doDescribeGroupsSTD,
|
|
4272
|
+
"DescribeYarnQueue": doDescribeYarnQueue,
|
|
4273
|
+
"ModifyYarnQueueV2": doModifyYarnQueueV2,
|
|
4274
|
+
"DeployYarnConf": doDeployYarnConf,
|
|
4275
|
+
"DescribeClusterFlowStatusDetail": doDescribeClusterFlowStatusDetail,
|
|
1335
4276
|
"InquiryPriceScaleOutInstance": doInquiryPriceScaleOutInstance,
|
|
1336
4277
|
"DescribeAutoScaleRecords": doDescribeAutoScaleRecords,
|
|
4278
|
+
"DescribeEmrOverviewMetrics": doDescribeEmrOverviewMetrics,
|
|
1337
4279
|
"ScaleOutInstance": doScaleOutInstance,
|
|
1338
|
-
"
|
|
4280
|
+
"AttachDisks": doAttachDisks,
|
|
4281
|
+
"SetNodeResourceConfigDefault": doSetNodeResourceConfigDefault,
|
|
4282
|
+
"DescribeStarRocksQueryInfo": doDescribeStarRocksQueryInfo,
|
|
4283
|
+
"ModifySLInstanceBasic": doModifySLInstanceBasic,
|
|
4284
|
+
"AddMetricScaleStrategy": doAddMetricScaleStrategy,
|
|
4285
|
+
"DescribeServiceNodeInfos": doDescribeServiceNodeInfos,
|
|
1339
4286
|
"DescribeInstances": doDescribeInstances,
|
|
4287
|
+
"ModifyYarnDeploy": doModifyYarnDeploy,
|
|
4288
|
+
"TerminateTasks": doTerminateTasks,
|
|
4289
|
+
"DeleteGroupsSTD": doDeleteGroupsSTD,
|
|
1340
4290
|
"TerminateClusterNodes": doTerminateClusterNodes,
|
|
4291
|
+
"ResetYarnConfig": doResetYarnConfig,
|
|
1341
4292
|
"DescribeUsersForUserManager": doDescribeUsersForUserManager,
|
|
1342
4293
|
"ModifyUserManagerPwd": doModifyUserManagerPwd,
|
|
4294
|
+
"ConvertPreToPostCluster": doConvertPreToPostCluster,
|
|
4295
|
+
"CreateGroupsSTD": doCreateGroupsSTD,
|
|
4296
|
+
"TerminateSLInstance": doTerminateSLInstance,
|
|
1343
4297
|
"AddUsersForUserManager": doAddUsersForUserManager,
|
|
1344
|
-
"
|
|
1345
|
-
"
|
|
4298
|
+
"DescribeSparkApplications": doDescribeSparkApplications,
|
|
4299
|
+
"ModifyUserGroup": doModifyUserGroup,
|
|
4300
|
+
"CreateSLInstance": doCreateSLInstance,
|
|
4301
|
+
"DescribeSLInstanceList": doDescribeSLInstanceList,
|
|
4302
|
+
"AddNodeResourceConfig": doAddNodeResourceConfig,
|
|
4303
|
+
"ModifyAutoScaleStrategy": doModifyAutoScaleStrategy,
|
|
4304
|
+
"DescribeKyuubiQueryInfo": doDescribeKyuubiQueryInfo,
|
|
4305
|
+
"DeleteAutoScaleStrategy": doDeleteAutoScaleStrategy,
|
|
4306
|
+
"DescribeEmrApplicationStatics": doDescribeEmrApplicationStatics,
|
|
4307
|
+
"DescribeHDFSStorageInfo": doDescribeHDFSStorageInfo,
|
|
1346
4308
|
"CreateInstance": doCreateInstance,
|
|
4309
|
+
"ModifyResourceScheduler": doModifyResourceScheduler,
|
|
4310
|
+
"DescribeHBaseTableOverview": doDescribeHBaseTableOverview,
|
|
4311
|
+
"DescribeResourceScheduleDiffDetail": doDescribeResourceScheduleDiffDetail,
|
|
4312
|
+
"DescribeSLInstance": doDescribeSLInstance,
|
|
4313
|
+
"DescribeSparkQueries": doDescribeSparkQueries,
|
|
4314
|
+
"ModifyAutoRenewFlag": doModifyAutoRenewFlag,
|
|
4315
|
+
"ModifyResource": doModifyResource,
|
|
1347
4316
|
"InquiryPriceCreateInstance": doInquiryPriceCreateInstance,
|
|
1348
4317
|
"DescribeResourceSchedule": doDescribeResourceSchedule,
|
|
4318
|
+
"ResizeDataDisks": doResizeDataDisks,
|
|
1349
4319
|
"ModifyResourceScheduleConfig": doModifyResourceScheduleConfig,
|
|
1350
4320
|
"DescribeHiveQueries": doDescribeHiveQueries,
|
|
1351
4321
|
"StartStopServiceOrMonitor": doStartStopServiceOrMonitor,
|
|
1352
|
-
"
|
|
4322
|
+
"DescribeYarnScheduleHistory": doDescribeYarnScheduleHistory,
|
|
4323
|
+
"ModifyGlobalConfig": doModifyGlobalConfig,
|
|
4324
|
+
"TerminateInstance": doTerminateInstance,
|
|
4325
|
+
"ModifySLInstance": doModifySLInstance,
|
|
4326
|
+
"DescribeNodeDataDisks": doDescribeNodeDataDisks,
|
|
4327
|
+
"DescribeNodeResourceConfigFast": doDescribeNodeResourceConfigFast,
|
|
4328
|
+
"DescribeAutoScaleStrategies": doDescribeAutoScaleStrategies,
|
|
4329
|
+
"DescribeGlobalConfig": doDescribeGlobalConfig,
|
|
4330
|
+
"DescribeAutoScaleGroupGlobalConf": doDescribeAutoScaleGroupGlobalConf,
|
|
4331
|
+
"DescribeDAGInfo": doDescribeDAGInfo,
|
|
1353
4332
|
"DescribeClusterNodes": doDescribeClusterNodes,
|
|
4333
|
+
"DescribeTrinoQueryInfo": doDescribeTrinoQueryInfo,
|
|
1354
4334
|
"DescribeInstancesList": doDescribeInstancesList,
|
|
1355
|
-
"
|
|
4335
|
+
"DescribeNodeSpec": doDescribeNodeSpec,
|
|
4336
|
+
"DescribeInsightList": doDescribeInsightList,
|
|
4337
|
+
"DeleteNodeResourceConfig": doDeleteNodeResourceConfig,
|
|
4338
|
+
"ModifyInstanceBasic": doModifyInstanceBasic,
|
|
4339
|
+
"ModifyUsersOfGroupSTD": doModifyUsersOfGroupSTD,
|
|
4340
|
+
"ModifyInspectionSettings": doModifyInspectionSettings,
|
|
4341
|
+
"DescribeInspectionTaskResult": doDescribeInspectionTaskResult,
|
|
4342
|
+
"ScaleOutCluster": doScaleOutCluster,
|
|
1356
4343
|
|
|
1357
4344
|
}
|
|
1358
4345
|
|