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
|
@@ -17,6 +17,171 @@ from tencentcloud.mongodb.v20190725 import models as models_v20190725
|
|
|
17
17
|
from jmespath import search
|
|
18
18
|
import time
|
|
19
19
|
|
|
20
|
+
def doTerminateDBInstances(args, parsed_globals):
|
|
21
|
+
g_param = parse_global_arg(parsed_globals)
|
|
22
|
+
|
|
23
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
24
|
+
cred = credential.CVMRoleCredential()
|
|
25
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
26
|
+
cred = credential.STSAssumeRoleCredential(
|
|
27
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
28
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
29
|
+
)
|
|
30
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
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):
|
|
34
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
35
|
+
else:
|
|
36
|
+
cred = credential.Credential(
|
|
37
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
38
|
+
)
|
|
39
|
+
http_profile = HttpProfile(
|
|
40
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
41
|
+
reqMethod="POST",
|
|
42
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
43
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
44
|
+
)
|
|
45
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
46
|
+
if g_param[OptionsDefine.Language]:
|
|
47
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
48
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
49
|
+
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
50
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
51
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
52
|
+
model = models.TerminateDBInstancesRequest()
|
|
53
|
+
model.from_json_string(json.dumps(args))
|
|
54
|
+
start_time = time.time()
|
|
55
|
+
while True:
|
|
56
|
+
rsp = client.TerminateDBInstances(model)
|
|
57
|
+
result = rsp.to_json_string()
|
|
58
|
+
try:
|
|
59
|
+
json_obj = json.loads(result)
|
|
60
|
+
except TypeError as e:
|
|
61
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
62
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
63
|
+
break
|
|
64
|
+
cur_time = time.time()
|
|
65
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
66
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
67
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
68
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
69
|
+
else:
|
|
70
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
71
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
72
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def doCreateLogDownloadTask(args, parsed_globals):
|
|
76
|
+
g_param = parse_global_arg(parsed_globals)
|
|
77
|
+
|
|
78
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
79
|
+
cred = credential.CVMRoleCredential()
|
|
80
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
81
|
+
cred = credential.STSAssumeRoleCredential(
|
|
82
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
83
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
84
|
+
)
|
|
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):
|
|
89
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
90
|
+
else:
|
|
91
|
+
cred = credential.Credential(
|
|
92
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
93
|
+
)
|
|
94
|
+
http_profile = HttpProfile(
|
|
95
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
96
|
+
reqMethod="POST",
|
|
97
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
98
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
99
|
+
)
|
|
100
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
101
|
+
if g_param[OptionsDefine.Language]:
|
|
102
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
103
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
104
|
+
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
105
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
106
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
107
|
+
model = models.CreateLogDownloadTaskRequest()
|
|
108
|
+
model.from_json_string(json.dumps(args))
|
|
109
|
+
start_time = time.time()
|
|
110
|
+
while True:
|
|
111
|
+
rsp = client.CreateLogDownloadTask(model)
|
|
112
|
+
result = rsp.to_json_string()
|
|
113
|
+
try:
|
|
114
|
+
json_obj = json.loads(result)
|
|
115
|
+
except TypeError as e:
|
|
116
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
117
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
118
|
+
break
|
|
119
|
+
cur_time = time.time()
|
|
120
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
121
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
122
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
123
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
124
|
+
else:
|
|
125
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
126
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
127
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def doDescribeDBInstanceNodeProperty(args, parsed_globals):
|
|
131
|
+
g_param = parse_global_arg(parsed_globals)
|
|
132
|
+
|
|
133
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
134
|
+
cred = credential.CVMRoleCredential()
|
|
135
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
136
|
+
cred = credential.STSAssumeRoleCredential(
|
|
137
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
138
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
139
|
+
)
|
|
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):
|
|
144
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
145
|
+
else:
|
|
146
|
+
cred = credential.Credential(
|
|
147
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
148
|
+
)
|
|
149
|
+
http_profile = HttpProfile(
|
|
150
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
151
|
+
reqMethod="POST",
|
|
152
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
153
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
154
|
+
)
|
|
155
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
156
|
+
if g_param[OptionsDefine.Language]:
|
|
157
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
158
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
159
|
+
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
160
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
161
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
162
|
+
model = models.DescribeDBInstanceNodePropertyRequest()
|
|
163
|
+
model.from_json_string(json.dumps(args))
|
|
164
|
+
start_time = time.time()
|
|
165
|
+
while True:
|
|
166
|
+
rsp = client.DescribeDBInstanceNodeProperty(model)
|
|
167
|
+
result = rsp.to_json_string()
|
|
168
|
+
try:
|
|
169
|
+
json_obj = json.loads(result)
|
|
170
|
+
except TypeError as e:
|
|
171
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
172
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
173
|
+
break
|
|
174
|
+
cur_time = time.time()
|
|
175
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
176
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
177
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
178
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
179
|
+
else:
|
|
180
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
181
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
182
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
183
|
+
|
|
184
|
+
|
|
20
185
|
def doDescribeDBInstanceDeal(args, parsed_globals):
|
|
21
186
|
g_param = parse_global_arg(parsed_globals)
|
|
22
187
|
|
|
@@ -27,7 +192,945 @@ def doDescribeDBInstanceDeal(args, parsed_globals):
|
|
|
27
192
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
28
193
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
29
194
|
)
|
|
30
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
215
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
216
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
217
|
+
model = models.DescribeDBInstanceDealRequest()
|
|
218
|
+
model.from_json_string(json.dumps(args))
|
|
219
|
+
start_time = time.time()
|
|
220
|
+
while True:
|
|
221
|
+
rsp = client.DescribeDBInstanceDeal(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
|
+
|
|
240
|
+
def doDescribeCurrentOp(args, parsed_globals):
|
|
241
|
+
g_param = parse_global_arg(parsed_globals)
|
|
242
|
+
|
|
243
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
244
|
+
cred = credential.CVMRoleCredential()
|
|
245
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
246
|
+
cred = credential.STSAssumeRoleCredential(
|
|
247
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
248
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
249
|
+
)
|
|
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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
270
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
271
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
272
|
+
model = models.DescribeCurrentOpRequest()
|
|
273
|
+
model.from_json_string(json.dumps(args))
|
|
274
|
+
start_time = time.time()
|
|
275
|
+
while True:
|
|
276
|
+
rsp = client.DescribeCurrentOp(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 doDescribeDBBackups(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
325
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
326
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
327
|
+
model = models.DescribeDBBackupsRequest()
|
|
328
|
+
model.from_json_string(json.dumps(args))
|
|
329
|
+
start_time = time.time()
|
|
330
|
+
while True:
|
|
331
|
+
rsp = client.DescribeDBBackups(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 doDescribeClientConnections(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
380
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
381
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
382
|
+
model = models.DescribeClientConnectionsRequest()
|
|
383
|
+
model.from_json_string(json.dumps(args))
|
|
384
|
+
start_time = time.time()
|
|
385
|
+
while True:
|
|
386
|
+
rsp = client.DescribeClientConnections(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 doResetDBInstancePassword(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
435
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
436
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
437
|
+
model = models.ResetDBInstancePasswordRequest()
|
|
438
|
+
model.from_json_string(json.dumps(args))
|
|
439
|
+
start_time = time.time()
|
|
440
|
+
while True:
|
|
441
|
+
rsp = client.ResetDBInstancePassword(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 doDescribeSecurityGroup(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
490
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
491
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
492
|
+
model = models.DescribeSecurityGroupRequest()
|
|
493
|
+
model.from_json_string(json.dumps(args))
|
|
494
|
+
start_time = time.time()
|
|
495
|
+
while True:
|
|
496
|
+
rsp = client.DescribeSecurityGroup(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 doSetAccountUserPrivilege(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
545
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
546
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
547
|
+
model = models.SetAccountUserPrivilegeRequest()
|
|
548
|
+
model.from_json_string(json.dumps(args))
|
|
549
|
+
start_time = time.time()
|
|
550
|
+
while True:
|
|
551
|
+
rsp = client.SetAccountUserPrivilege(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 doFlushInstanceRouterConfig(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
600
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
601
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
602
|
+
model = models.FlushInstanceRouterConfigRequest()
|
|
603
|
+
model.from_json_string(json.dumps(args))
|
|
604
|
+
start_time = time.time()
|
|
605
|
+
while True:
|
|
606
|
+
rsp = client.FlushInstanceRouterConfig(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 doDescribeDBInstanceNamespace(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
655
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
656
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
657
|
+
model = models.DescribeDBInstanceNamespaceRequest()
|
|
658
|
+
model.from_json_string(json.dumps(args))
|
|
659
|
+
start_time = time.time()
|
|
660
|
+
while True:
|
|
661
|
+
rsp = client.DescribeDBInstanceNamespace(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 doDeleteLogDownloadTask(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
710
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
711
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
712
|
+
model = models.DeleteLogDownloadTaskRequest()
|
|
713
|
+
model.from_json_string(json.dumps(args))
|
|
714
|
+
start_time = time.time()
|
|
715
|
+
while True:
|
|
716
|
+
rsp = client.DeleteLogDownloadTask(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 doDescribeDetailedSlowLogs(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
765
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
766
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
767
|
+
model = models.DescribeDetailedSlowLogsRequest()
|
|
768
|
+
model.from_json_string(json.dumps(args))
|
|
769
|
+
start_time = time.time()
|
|
770
|
+
while True:
|
|
771
|
+
rsp = client.DescribeDetailedSlowLogs(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 doInstanceEnableSSL(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
820
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
821
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
822
|
+
model = models.InstanceEnableSSLRequest()
|
|
823
|
+
model.from_json_string(json.dumps(args))
|
|
824
|
+
start_time = time.time()
|
|
825
|
+
while True:
|
|
826
|
+
rsp = client.InstanceEnableSSL(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 doInquirePriceModifyDBInstanceSpec(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
875
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
876
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
877
|
+
model = models.InquirePriceModifyDBInstanceSpecRequest()
|
|
878
|
+
model.from_json_string(json.dumps(args))
|
|
879
|
+
start_time = time.time()
|
|
880
|
+
while True:
|
|
881
|
+
rsp = client.InquirePriceModifyDBInstanceSpec(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 doDescribeLogDownloadTasks(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
930
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
931
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
932
|
+
model = models.DescribeLogDownloadTasksRequest()
|
|
933
|
+
model.from_json_string(json.dumps(args))
|
|
934
|
+
start_time = time.time()
|
|
935
|
+
while True:
|
|
936
|
+
rsp = client.DescribeLogDownloadTasks(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 doDescribeBackupRules(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
985
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
986
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
987
|
+
model = models.DescribeBackupRulesRequest()
|
|
988
|
+
model.from_json_string(json.dumps(args))
|
|
989
|
+
start_time = time.time()
|
|
990
|
+
while True:
|
|
991
|
+
rsp = client.DescribeBackupRules(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 doRenameInstance(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1040
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1041
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1042
|
+
model = models.RenameInstanceRequest()
|
|
1043
|
+
model.from_json_string(json.dumps(args))
|
|
1044
|
+
start_time = time.time()
|
|
1045
|
+
while True:
|
|
1046
|
+
rsp = client.RenameInstance(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 doDescribeAsyncRequestInfo(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1095
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1096
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1097
|
+
model = models.DescribeAsyncRequestInfoRequest()
|
|
1098
|
+
model.from_json_string(json.dumps(args))
|
|
1099
|
+
start_time = time.time()
|
|
1100
|
+
while True:
|
|
1101
|
+
rsp = client.DescribeAsyncRequestInfo(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 doCreateAccountUser(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):
|
|
31
1134
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
32
1135
|
else:
|
|
33
1136
|
cred = credential.Credential(
|
|
@@ -39,18 +1142,18 @@ def doDescribeDBInstanceDeal(args, parsed_globals):
|
|
|
39
1142
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
40
1143
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
41
1144
|
)
|
|
42
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1145
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
43
1146
|
if g_param[OptionsDefine.Language]:
|
|
44
1147
|
profile.language = g_param[OptionsDefine.Language]
|
|
45
1148
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
46
1149
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
47
1150
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
48
1151
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
49
|
-
model = models.
|
|
1152
|
+
model = models.CreateAccountUserRequest()
|
|
50
1153
|
model.from_json_string(json.dumps(args))
|
|
51
1154
|
start_time = time.time()
|
|
52
1155
|
while True:
|
|
53
|
-
rsp = client.
|
|
1156
|
+
rsp = client.CreateAccountUser(model)
|
|
54
1157
|
result = rsp.to_json_string()
|
|
55
1158
|
try:
|
|
56
1159
|
json_obj = json.loads(result)
|
|
@@ -69,7 +1172,7 @@ def doDescribeDBInstanceDeal(args, parsed_globals):
|
|
|
69
1172
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
70
1173
|
|
|
71
1174
|
|
|
72
|
-
def
|
|
1175
|
+
def doCreateDBInstanceHour(args, parsed_globals):
|
|
73
1176
|
g_param = parse_global_arg(parsed_globals)
|
|
74
1177
|
|
|
75
1178
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -79,7 +1182,10 @@ def doOfflineIsolatedDBInstance(args, parsed_globals):
|
|
|
79
1182
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
80
1183
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
81
1184
|
)
|
|
82
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
83
1189
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
84
1190
|
else:
|
|
85
1191
|
cred = credential.Credential(
|
|
@@ -91,18 +1197,18 @@ def doOfflineIsolatedDBInstance(args, parsed_globals):
|
|
|
91
1197
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
92
1198
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
93
1199
|
)
|
|
94
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1200
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
95
1201
|
if g_param[OptionsDefine.Language]:
|
|
96
1202
|
profile.language = g_param[OptionsDefine.Language]
|
|
97
1203
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
98
1204
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
99
1205
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
100
1206
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
101
|
-
model = models.
|
|
1207
|
+
model = models.CreateDBInstanceHourRequest()
|
|
102
1208
|
model.from_json_string(json.dumps(args))
|
|
103
1209
|
start_time = time.time()
|
|
104
1210
|
while True:
|
|
105
|
-
rsp = client.
|
|
1211
|
+
rsp = client.CreateDBInstanceHour(model)
|
|
106
1212
|
result = rsp.to_json_string()
|
|
107
1213
|
try:
|
|
108
1214
|
json_obj = json.loads(result)
|
|
@@ -121,7 +1227,7 @@ def doOfflineIsolatedDBInstance(args, parsed_globals):
|
|
|
121
1227
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
122
1228
|
|
|
123
1229
|
|
|
124
|
-
def
|
|
1230
|
+
def doIsolateDBInstance(args, parsed_globals):
|
|
125
1231
|
g_param = parse_global_arg(parsed_globals)
|
|
126
1232
|
|
|
127
1233
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -131,7 +1237,10 @@ def doDescribeClientConnections(args, parsed_globals):
|
|
|
131
1237
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
132
1238
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
133
1239
|
)
|
|
134
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
135
1244
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
136
1245
|
else:
|
|
137
1246
|
cred = credential.Credential(
|
|
@@ -143,18 +1252,18 @@ def doDescribeClientConnections(args, parsed_globals):
|
|
|
143
1252
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
144
1253
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
145
1254
|
)
|
|
146
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1255
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
147
1256
|
if g_param[OptionsDefine.Language]:
|
|
148
1257
|
profile.language = g_param[OptionsDefine.Language]
|
|
149
1258
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
150
1259
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
151
1260
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
152
1261
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
153
|
-
model = models.
|
|
1262
|
+
model = models.IsolateDBInstanceRequest()
|
|
154
1263
|
model.from_json_string(json.dumps(args))
|
|
155
1264
|
start_time = time.time()
|
|
156
1265
|
while True:
|
|
157
|
-
rsp = client.
|
|
1266
|
+
rsp = client.IsolateDBInstance(model)
|
|
158
1267
|
result = rsp.to_json_string()
|
|
159
1268
|
try:
|
|
160
1269
|
json_obj = json.loads(result)
|
|
@@ -173,7 +1282,7 @@ def doDescribeClientConnections(args, parsed_globals):
|
|
|
173
1282
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
174
1283
|
|
|
175
1284
|
|
|
176
|
-
def
|
|
1285
|
+
def doKillOps(args, parsed_globals):
|
|
177
1286
|
g_param = parse_global_arg(parsed_globals)
|
|
178
1287
|
|
|
179
1288
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -183,7 +1292,10 @@ def doResetDBInstancePassword(args, parsed_globals):
|
|
|
183
1292
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
184
1293
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
185
1294
|
)
|
|
186
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
187
1299
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
188
1300
|
else:
|
|
189
1301
|
cred = credential.Credential(
|
|
@@ -195,18 +1307,18 @@ def doResetDBInstancePassword(args, parsed_globals):
|
|
|
195
1307
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
196
1308
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
197
1309
|
)
|
|
198
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1310
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
199
1311
|
if g_param[OptionsDefine.Language]:
|
|
200
1312
|
profile.language = g_param[OptionsDefine.Language]
|
|
201
1313
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
202
1314
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
203
1315
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
204
1316
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
205
|
-
model = models.
|
|
1317
|
+
model = models.KillOpsRequest()
|
|
206
1318
|
model.from_json_string(json.dumps(args))
|
|
207
1319
|
start_time = time.time()
|
|
208
1320
|
while True:
|
|
209
|
-
rsp = client.
|
|
1321
|
+
rsp = client.KillOps(model)
|
|
210
1322
|
result = rsp.to_json_string()
|
|
211
1323
|
try:
|
|
212
1324
|
json_obj = json.loads(result)
|
|
@@ -225,7 +1337,7 @@ def doResetDBInstancePassword(args, parsed_globals):
|
|
|
225
1337
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
226
1338
|
|
|
227
1339
|
|
|
228
|
-
def
|
|
1340
|
+
def doCreateBackupDownloadTask(args, parsed_globals):
|
|
229
1341
|
g_param = parse_global_arg(parsed_globals)
|
|
230
1342
|
|
|
231
1343
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -235,7 +1347,10 @@ def doDescribeSecurityGroup(args, parsed_globals):
|
|
|
235
1347
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
236
1348
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
237
1349
|
)
|
|
238
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
239
1354
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
240
1355
|
else:
|
|
241
1356
|
cred = credential.Credential(
|
|
@@ -247,18 +1362,18 @@ def doDescribeSecurityGroup(args, parsed_globals):
|
|
|
247
1362
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
248
1363
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
249
1364
|
)
|
|
250
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1365
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
251
1366
|
if g_param[OptionsDefine.Language]:
|
|
252
1367
|
profile.language = g_param[OptionsDefine.Language]
|
|
253
1368
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
254
1369
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
255
1370
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
256
1371
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
257
|
-
model = models.
|
|
1372
|
+
model = models.CreateBackupDownloadTaskRequest()
|
|
258
1373
|
model.from_json_string(json.dumps(args))
|
|
259
1374
|
start_time = time.time()
|
|
260
1375
|
while True:
|
|
261
|
-
rsp = client.
|
|
1376
|
+
rsp = client.CreateBackupDownloadTask(model)
|
|
262
1377
|
result = rsp.to_json_string()
|
|
263
1378
|
try:
|
|
264
1379
|
json_obj = json.loads(result)
|
|
@@ -277,7 +1392,7 @@ def doDescribeSecurityGroup(args, parsed_globals):
|
|
|
277
1392
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
278
1393
|
|
|
279
1394
|
|
|
280
|
-
def
|
|
1395
|
+
def doCreateBackupDBInstance(args, parsed_globals):
|
|
281
1396
|
g_param = parse_global_arg(parsed_globals)
|
|
282
1397
|
|
|
283
1398
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -287,7 +1402,10 @@ def doFlushInstanceRouterConfig(args, parsed_globals):
|
|
|
287
1402
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
288
1403
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
289
1404
|
)
|
|
290
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
291
1409
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
292
1410
|
else:
|
|
293
1411
|
cred = credential.Credential(
|
|
@@ -299,18 +1417,18 @@ def doFlushInstanceRouterConfig(args, parsed_globals):
|
|
|
299
1417
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
300
1418
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
301
1419
|
)
|
|
302
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1420
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
303
1421
|
if g_param[OptionsDefine.Language]:
|
|
304
1422
|
profile.language = g_param[OptionsDefine.Language]
|
|
305
1423
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
306
1424
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
307
1425
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
308
1426
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
309
|
-
model = models.
|
|
1427
|
+
model = models.CreateBackupDBInstanceRequest()
|
|
310
1428
|
model.from_json_string(json.dumps(args))
|
|
311
1429
|
start_time = time.time()
|
|
312
1430
|
while True:
|
|
313
|
-
rsp = client.
|
|
1431
|
+
rsp = client.CreateBackupDBInstance(model)
|
|
314
1432
|
result = rsp.to_json_string()
|
|
315
1433
|
try:
|
|
316
1434
|
json_obj = json.loads(result)
|
|
@@ -329,7 +1447,7 @@ def doFlushInstanceRouterConfig(args, parsed_globals):
|
|
|
329
1447
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
330
1448
|
|
|
331
1449
|
|
|
332
|
-
def
|
|
1450
|
+
def doDescribeDBInstances(args, parsed_globals):
|
|
333
1451
|
g_param = parse_global_arg(parsed_globals)
|
|
334
1452
|
|
|
335
1453
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -339,7 +1457,10 @@ def doDescribeDBBackups(args, parsed_globals):
|
|
|
339
1457
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
340
1458
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
341
1459
|
)
|
|
342
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
343
1464
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
344
1465
|
else:
|
|
345
1466
|
cred = credential.Credential(
|
|
@@ -351,18 +1472,18 @@ def doDescribeDBBackups(args, parsed_globals):
|
|
|
351
1472
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
352
1473
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
353
1474
|
)
|
|
354
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1475
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
355
1476
|
if g_param[OptionsDefine.Language]:
|
|
356
1477
|
profile.language = g_param[OptionsDefine.Language]
|
|
357
1478
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
358
1479
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
359
1480
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
360
1481
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
361
|
-
model = models.
|
|
1482
|
+
model = models.DescribeDBInstancesRequest()
|
|
362
1483
|
model.from_json_string(json.dumps(args))
|
|
363
1484
|
start_time = time.time()
|
|
364
1485
|
while True:
|
|
365
|
-
rsp = client.
|
|
1486
|
+
rsp = client.DescribeDBInstances(model)
|
|
366
1487
|
result = rsp.to_json_string()
|
|
367
1488
|
try:
|
|
368
1489
|
json_obj = json.loads(result)
|
|
@@ -381,7 +1502,7 @@ def doDescribeDBBackups(args, parsed_globals):
|
|
|
381
1502
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
382
1503
|
|
|
383
1504
|
|
|
384
|
-
def
|
|
1505
|
+
def doOfflineIsolatedDBInstance(args, parsed_globals):
|
|
385
1506
|
g_param = parse_global_arg(parsed_globals)
|
|
386
1507
|
|
|
387
1508
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -391,7 +1512,10 @@ def doIsolateDBInstance(args, parsed_globals):
|
|
|
391
1512
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
392
1513
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
393
1514
|
)
|
|
394
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
395
1519
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
396
1520
|
else:
|
|
397
1521
|
cred = credential.Credential(
|
|
@@ -403,18 +1527,18 @@ def doIsolateDBInstance(args, parsed_globals):
|
|
|
403
1527
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
404
1528
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
405
1529
|
)
|
|
406
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1530
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
407
1531
|
if g_param[OptionsDefine.Language]:
|
|
408
1532
|
profile.language = g_param[OptionsDefine.Language]
|
|
409
1533
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
410
1534
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
411
1535
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
412
1536
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
413
|
-
model = models.
|
|
1537
|
+
model = models.OfflineIsolatedDBInstanceRequest()
|
|
414
1538
|
model.from_json_string(json.dumps(args))
|
|
415
1539
|
start_time = time.time()
|
|
416
1540
|
while True:
|
|
417
|
-
rsp = client.
|
|
1541
|
+
rsp = client.OfflineIsolatedDBInstance(model)
|
|
418
1542
|
result = rsp.to_json_string()
|
|
419
1543
|
try:
|
|
420
1544
|
json_obj = json.loads(result)
|
|
@@ -433,7 +1557,7 @@ def doIsolateDBInstance(args, parsed_globals):
|
|
|
433
1557
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
434
1558
|
|
|
435
1559
|
|
|
436
|
-
def
|
|
1560
|
+
def doDescribeSlowLogPatterns(args, parsed_globals):
|
|
437
1561
|
g_param = parse_global_arg(parsed_globals)
|
|
438
1562
|
|
|
439
1563
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -443,7 +1567,10 @@ def doInquirePriceModifyDBInstanceSpec(args, parsed_globals):
|
|
|
443
1567
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
444
1568
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
445
1569
|
)
|
|
446
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
447
1574
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
448
1575
|
else:
|
|
449
1576
|
cred = credential.Credential(
|
|
@@ -455,18 +1582,18 @@ def doInquirePriceModifyDBInstanceSpec(args, parsed_globals):
|
|
|
455
1582
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
456
1583
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
457
1584
|
)
|
|
458
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1585
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
459
1586
|
if g_param[OptionsDefine.Language]:
|
|
460
1587
|
profile.language = g_param[OptionsDefine.Language]
|
|
461
1588
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
462
1589
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
463
1590
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
464
1591
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
465
|
-
model = models.
|
|
1592
|
+
model = models.DescribeSlowLogPatternsRequest()
|
|
466
1593
|
model.from_json_string(json.dumps(args))
|
|
467
1594
|
start_time = time.time()
|
|
468
1595
|
while True:
|
|
469
|
-
rsp = client.
|
|
1596
|
+
rsp = client.DescribeSlowLogPatterns(model)
|
|
470
1597
|
result = rsp.to_json_string()
|
|
471
1598
|
try:
|
|
472
1599
|
json_obj = json.loads(result)
|
|
@@ -485,7 +1612,7 @@ def doInquirePriceModifyDBInstanceSpec(args, parsed_globals):
|
|
|
485
1612
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
486
1613
|
|
|
487
1614
|
|
|
488
|
-
def
|
|
1615
|
+
def doDescribeSlowLogs(args, parsed_globals):
|
|
489
1616
|
g_param = parse_global_arg(parsed_globals)
|
|
490
1617
|
|
|
491
1618
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -495,7 +1622,10 @@ def doDescribeAsyncRequestInfo(args, parsed_globals):
|
|
|
495
1622
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
496
1623
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
497
1624
|
)
|
|
498
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
499
1629
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
500
1630
|
else:
|
|
501
1631
|
cred = credential.Credential(
|
|
@@ -507,18 +1637,18 @@ def doDescribeAsyncRequestInfo(args, parsed_globals):
|
|
|
507
1637
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
508
1638
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
509
1639
|
)
|
|
510
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1640
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
511
1641
|
if g_param[OptionsDefine.Language]:
|
|
512
1642
|
profile.language = g_param[OptionsDefine.Language]
|
|
513
1643
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
514
1644
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
515
1645
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
516
1646
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
517
|
-
model = models.
|
|
1647
|
+
model = models.DescribeSlowLogsRequest()
|
|
518
1648
|
model.from_json_string(json.dumps(args))
|
|
519
1649
|
start_time = time.time()
|
|
520
1650
|
while True:
|
|
521
|
-
rsp = client.
|
|
1651
|
+
rsp = client.DescribeSlowLogs(model)
|
|
522
1652
|
result = rsp.to_json_string()
|
|
523
1653
|
try:
|
|
524
1654
|
json_obj = json.loads(result)
|
|
@@ -537,7 +1667,7 @@ def doDescribeAsyncRequestInfo(args, parsed_globals):
|
|
|
537
1667
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
538
1668
|
|
|
539
1669
|
|
|
540
|
-
def
|
|
1670
|
+
def doDescribeMongodbLogs(args, parsed_globals):
|
|
541
1671
|
g_param = parse_global_arg(parsed_globals)
|
|
542
1672
|
|
|
543
1673
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -547,7 +1677,10 @@ def doModifyDBInstanceNetworkAddress(args, parsed_globals):
|
|
|
547
1677
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
548
1678
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
549
1679
|
)
|
|
550
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
551
1684
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
552
1685
|
else:
|
|
553
1686
|
cred = credential.Credential(
|
|
@@ -559,18 +1692,18 @@ def doModifyDBInstanceNetworkAddress(args, parsed_globals):
|
|
|
559
1692
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
560
1693
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
561
1694
|
)
|
|
562
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1695
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
563
1696
|
if g_param[OptionsDefine.Language]:
|
|
564
1697
|
profile.language = g_param[OptionsDefine.Language]
|
|
565
1698
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
566
1699
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
567
1700
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
568
1701
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
569
|
-
model = models.
|
|
1702
|
+
model = models.DescribeMongodbLogsRequest()
|
|
570
1703
|
model.from_json_string(json.dumps(args))
|
|
571
1704
|
start_time = time.time()
|
|
572
1705
|
while True:
|
|
573
|
-
rsp = client.
|
|
1706
|
+
rsp = client.DescribeMongodbLogs(model)
|
|
574
1707
|
result = rsp.to_json_string()
|
|
575
1708
|
try:
|
|
576
1709
|
json_obj = json.loads(result)
|
|
@@ -589,7 +1722,7 @@ def doModifyDBInstanceNetworkAddress(args, parsed_globals):
|
|
|
589
1722
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
590
1723
|
|
|
591
1724
|
|
|
592
|
-
def
|
|
1725
|
+
def doCreateDBInstance(args, parsed_globals):
|
|
593
1726
|
g_param = parse_global_arg(parsed_globals)
|
|
594
1727
|
|
|
595
1728
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -599,7 +1732,10 @@ def doCreateDBInstanceHour(args, parsed_globals):
|
|
|
599
1732
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
600
1733
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
601
1734
|
)
|
|
602
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
603
1739
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
604
1740
|
else:
|
|
605
1741
|
cred = credential.Credential(
|
|
@@ -611,18 +1747,18 @@ def doCreateDBInstanceHour(args, parsed_globals):
|
|
|
611
1747
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
612
1748
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
613
1749
|
)
|
|
614
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1750
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
615
1751
|
if g_param[OptionsDefine.Language]:
|
|
616
1752
|
profile.language = g_param[OptionsDefine.Language]
|
|
617
1753
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
618
1754
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
619
1755
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
620
1756
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
621
|
-
model = models.
|
|
1757
|
+
model = models.CreateDBInstanceRequest()
|
|
622
1758
|
model.from_json_string(json.dumps(args))
|
|
623
1759
|
start_time = time.time()
|
|
624
1760
|
while True:
|
|
625
|
-
rsp = client.
|
|
1761
|
+
rsp = client.CreateDBInstance(model)
|
|
626
1762
|
result = rsp.to_json_string()
|
|
627
1763
|
try:
|
|
628
1764
|
json_obj = json.loads(result)
|
|
@@ -641,7 +1777,7 @@ def doCreateDBInstanceHour(args, parsed_globals):
|
|
|
641
1777
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
642
1778
|
|
|
643
1779
|
|
|
644
|
-
def
|
|
1780
|
+
def doModifyDBInstanceSpec(args, parsed_globals):
|
|
645
1781
|
g_param = parse_global_arg(parsed_globals)
|
|
646
1782
|
|
|
647
1783
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -651,7 +1787,10 @@ def doCreateBackupDownloadTask(args, parsed_globals):
|
|
|
651
1787
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
652
1788
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
653
1789
|
)
|
|
654
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
655
1794
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
656
1795
|
else:
|
|
657
1796
|
cred = credential.Credential(
|
|
@@ -663,18 +1802,18 @@ def doCreateBackupDownloadTask(args, parsed_globals):
|
|
|
663
1802
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
664
1803
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
665
1804
|
)
|
|
666
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1805
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
667
1806
|
if g_param[OptionsDefine.Language]:
|
|
668
1807
|
profile.language = g_param[OptionsDefine.Language]
|
|
669
1808
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
670
1809
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
671
1810
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
672
1811
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
673
|
-
model = models.
|
|
1812
|
+
model = models.ModifyDBInstanceSpecRequest()
|
|
674
1813
|
model.from_json_string(json.dumps(args))
|
|
675
1814
|
start_time = time.time()
|
|
676
1815
|
while True:
|
|
677
|
-
rsp = client.
|
|
1816
|
+
rsp = client.ModifyDBInstanceSpec(model)
|
|
678
1817
|
result = rsp.to_json_string()
|
|
679
1818
|
try:
|
|
680
1819
|
json_obj = json.loads(result)
|
|
@@ -693,7 +1832,7 @@ def doCreateBackupDownloadTask(args, parsed_globals):
|
|
|
693
1832
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
694
1833
|
|
|
695
1834
|
|
|
696
|
-
def
|
|
1835
|
+
def doDescribeInstanceParams(args, parsed_globals):
|
|
697
1836
|
g_param = parse_global_arg(parsed_globals)
|
|
698
1837
|
|
|
699
1838
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -703,7 +1842,10 @@ def doDescribeDBInstances(args, parsed_globals):
|
|
|
703
1842
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
704
1843
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
705
1844
|
)
|
|
706
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
707
1849
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
708
1850
|
else:
|
|
709
1851
|
cred = credential.Credential(
|
|
@@ -715,18 +1857,18 @@ def doDescribeDBInstances(args, parsed_globals):
|
|
|
715
1857
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
716
1858
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
717
1859
|
)
|
|
718
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1860
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
719
1861
|
if g_param[OptionsDefine.Language]:
|
|
720
1862
|
profile.language = g_param[OptionsDefine.Language]
|
|
721
1863
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
722
1864
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
723
1865
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
724
1866
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
725
|
-
model = models.
|
|
1867
|
+
model = models.DescribeInstanceParamsRequest()
|
|
726
1868
|
model.from_json_string(json.dumps(args))
|
|
727
1869
|
start_time = time.time()
|
|
728
1870
|
while True:
|
|
729
|
-
rsp = client.
|
|
1871
|
+
rsp = client.DescribeInstanceParams(model)
|
|
730
1872
|
result = rsp.to_json_string()
|
|
731
1873
|
try:
|
|
732
1874
|
json_obj = json.loads(result)
|
|
@@ -745,7 +1887,7 @@ def doDescribeDBInstances(args, parsed_globals):
|
|
|
745
1887
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
746
1888
|
|
|
747
1889
|
|
|
748
|
-
def
|
|
1890
|
+
def doUpgradeDBInstanceKernelVersion(args, parsed_globals):
|
|
749
1891
|
g_param = parse_global_arg(parsed_globals)
|
|
750
1892
|
|
|
751
1893
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -755,7 +1897,10 @@ def doDescribeSlowLogPatterns(args, parsed_globals):
|
|
|
755
1897
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
756
1898
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
757
1899
|
)
|
|
758
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
759
1904
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
760
1905
|
else:
|
|
761
1906
|
cred = credential.Credential(
|
|
@@ -767,18 +1912,18 @@ def doDescribeSlowLogPatterns(args, parsed_globals):
|
|
|
767
1912
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
768
1913
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
769
1914
|
)
|
|
770
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1915
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
771
1916
|
if g_param[OptionsDefine.Language]:
|
|
772
1917
|
profile.language = g_param[OptionsDefine.Language]
|
|
773
1918
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
774
1919
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
775
1920
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
776
1921
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
777
|
-
model = models.
|
|
1922
|
+
model = models.UpgradeDBInstanceKernelVersionRequest()
|
|
778
1923
|
model.from_json_string(json.dumps(args))
|
|
779
1924
|
start_time = time.time()
|
|
780
1925
|
while True:
|
|
781
|
-
rsp = client.
|
|
1926
|
+
rsp = client.UpgradeDBInstanceKernelVersion(model)
|
|
782
1927
|
result = rsp.to_json_string()
|
|
783
1928
|
try:
|
|
784
1929
|
json_obj = json.loads(result)
|
|
@@ -797,7 +1942,7 @@ def doDescribeSlowLogPatterns(args, parsed_globals):
|
|
|
797
1942
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
798
1943
|
|
|
799
1944
|
|
|
800
|
-
def
|
|
1945
|
+
def doDescribeSpecInfo(args, parsed_globals):
|
|
801
1946
|
g_param = parse_global_arg(parsed_globals)
|
|
802
1947
|
|
|
803
1948
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -807,7 +1952,10 @@ def doDescribeSlowLogs(args, parsed_globals):
|
|
|
807
1952
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
808
1953
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
809
1954
|
)
|
|
810
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
811
1959
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
812
1960
|
else:
|
|
813
1961
|
cred = credential.Credential(
|
|
@@ -819,18 +1967,18 @@ def doDescribeSlowLogs(args, parsed_globals):
|
|
|
819
1967
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
820
1968
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
821
1969
|
)
|
|
822
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
1970
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
823
1971
|
if g_param[OptionsDefine.Language]:
|
|
824
1972
|
profile.language = g_param[OptionsDefine.Language]
|
|
825
1973
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
826
1974
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
827
1975
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
828
1976
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
829
|
-
model = models.
|
|
1977
|
+
model = models.DescribeSpecInfoRequest()
|
|
830
1978
|
model.from_json_string(json.dumps(args))
|
|
831
1979
|
start_time = time.time()
|
|
832
1980
|
while True:
|
|
833
|
-
rsp = client.
|
|
1981
|
+
rsp = client.DescribeSpecInfo(model)
|
|
834
1982
|
result = rsp.to_json_string()
|
|
835
1983
|
try:
|
|
836
1984
|
json_obj = json.loads(result)
|
|
@@ -849,7 +1997,7 @@ def doDescribeSlowLogs(args, parsed_globals):
|
|
|
849
1997
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
850
1998
|
|
|
851
1999
|
|
|
852
|
-
def
|
|
2000
|
+
def doDescribeBackupDownloadTask(args, parsed_globals):
|
|
853
2001
|
g_param = parse_global_arg(parsed_globals)
|
|
854
2002
|
|
|
855
2003
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -859,7 +2007,10 @@ def doCreateDBInstance(args, parsed_globals):
|
|
|
859
2007
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
860
2008
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
861
2009
|
)
|
|
862
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
863
2014
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
864
2015
|
else:
|
|
865
2016
|
cred = credential.Credential(
|
|
@@ -871,18 +2022,18 @@ def doCreateDBInstance(args, parsed_globals):
|
|
|
871
2022
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
872
2023
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
873
2024
|
)
|
|
874
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
2025
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
875
2026
|
if g_param[OptionsDefine.Language]:
|
|
876
2027
|
profile.language = g_param[OptionsDefine.Language]
|
|
877
2028
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
878
2029
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
879
2030
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
880
2031
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
881
|
-
model = models.
|
|
2032
|
+
model = models.DescribeBackupDownloadTaskRequest()
|
|
882
2033
|
model.from_json_string(json.dumps(args))
|
|
883
2034
|
start_time = time.time()
|
|
884
2035
|
while True:
|
|
885
|
-
rsp = client.
|
|
2036
|
+
rsp = client.DescribeBackupDownloadTask(model)
|
|
886
2037
|
result = rsp.to_json_string()
|
|
887
2038
|
try:
|
|
888
2039
|
json_obj = json.loads(result)
|
|
@@ -901,7 +2052,7 @@ def doCreateDBInstance(args, parsed_globals):
|
|
|
901
2052
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
902
2053
|
|
|
903
2054
|
|
|
904
|
-
def
|
|
2055
|
+
def doInquirePriceCreateDBInstances(args, parsed_globals):
|
|
905
2056
|
g_param = parse_global_arg(parsed_globals)
|
|
906
2057
|
|
|
907
2058
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -911,7 +2062,10 @@ def doModifyDBInstanceSpec(args, parsed_globals):
|
|
|
911
2062
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
912
2063
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
913
2064
|
)
|
|
914
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
915
2069
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
916
2070
|
else:
|
|
917
2071
|
cred = credential.Credential(
|
|
@@ -923,18 +2077,18 @@ def doModifyDBInstanceSpec(args, parsed_globals):
|
|
|
923
2077
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
924
2078
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
925
2079
|
)
|
|
926
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
2080
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
927
2081
|
if g_param[OptionsDefine.Language]:
|
|
928
2082
|
profile.language = g_param[OptionsDefine.Language]
|
|
929
2083
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
930
2084
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
931
2085
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
932
2086
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
933
|
-
model = models.
|
|
2087
|
+
model = models.InquirePriceCreateDBInstancesRequest()
|
|
934
2088
|
model.from_json_string(json.dumps(args))
|
|
935
2089
|
start_time = time.time()
|
|
936
2090
|
while True:
|
|
937
|
-
rsp = client.
|
|
2091
|
+
rsp = client.InquirePriceCreateDBInstances(model)
|
|
938
2092
|
result = rsp.to_json_string()
|
|
939
2093
|
try:
|
|
940
2094
|
json_obj = json.loads(result)
|
|
@@ -953,7 +2107,7 @@ def doModifyDBInstanceSpec(args, parsed_globals):
|
|
|
953
2107
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
954
2108
|
|
|
955
2109
|
|
|
956
|
-
def
|
|
2110
|
+
def doDescribeInstanceSSL(args, parsed_globals):
|
|
957
2111
|
g_param = parse_global_arg(parsed_globals)
|
|
958
2112
|
|
|
959
2113
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -963,7 +2117,10 @@ def doDescribeInstanceParams(args, parsed_globals):
|
|
|
963
2117
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
964
2118
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
965
2119
|
)
|
|
966
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
967
2124
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
968
2125
|
else:
|
|
969
2126
|
cred = credential.Credential(
|
|
@@ -975,18 +2132,18 @@ def doDescribeInstanceParams(args, parsed_globals):
|
|
|
975
2132
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
976
2133
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
977
2134
|
)
|
|
978
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
2135
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
979
2136
|
if g_param[OptionsDefine.Language]:
|
|
980
2137
|
profile.language = g_param[OptionsDefine.Language]
|
|
981
2138
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
982
2139
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
983
2140
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
984
2141
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
985
|
-
model = models.
|
|
2142
|
+
model = models.DescribeInstanceSSLRequest()
|
|
986
2143
|
model.from_json_string(json.dumps(args))
|
|
987
2144
|
start_time = time.time()
|
|
988
2145
|
while True:
|
|
989
|
-
rsp = client.
|
|
2146
|
+
rsp = client.DescribeInstanceSSL(model)
|
|
990
2147
|
result = rsp.to_json_string()
|
|
991
2148
|
try:
|
|
992
2149
|
json_obj = json.loads(result)
|
|
@@ -1005,7 +2162,7 @@ def doDescribeInstanceParams(args, parsed_globals):
|
|
|
1005
2162
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1006
2163
|
|
|
1007
2164
|
|
|
1008
|
-
def
|
|
2165
|
+
def doSetDBInstanceDeletionProtection(args, parsed_globals):
|
|
1009
2166
|
g_param = parse_global_arg(parsed_globals)
|
|
1010
2167
|
|
|
1011
2168
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1015,7 +2172,10 @@ def doDescribeSpecInfo(args, parsed_globals):
|
|
|
1015
2172
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1016
2173
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1017
2174
|
)
|
|
1018
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
1019
2179
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1020
2180
|
else:
|
|
1021
2181
|
cred = credential.Credential(
|
|
@@ -1027,18 +2187,18 @@ def doDescribeSpecInfo(args, parsed_globals):
|
|
|
1027
2187
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1028
2188
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1029
2189
|
)
|
|
1030
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
2190
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1031
2191
|
if g_param[OptionsDefine.Language]:
|
|
1032
2192
|
profile.language = g_param[OptionsDefine.Language]
|
|
1033
2193
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1034
2194
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1035
2195
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1036
2196
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1037
|
-
model = models.
|
|
2197
|
+
model = models.SetDBInstanceDeletionProtectionRequest()
|
|
1038
2198
|
model.from_json_string(json.dumps(args))
|
|
1039
2199
|
start_time = time.time()
|
|
1040
2200
|
while True:
|
|
1041
|
-
rsp = client.
|
|
2201
|
+
rsp = client.SetDBInstanceDeletionProtection(model)
|
|
1042
2202
|
result = rsp.to_json_string()
|
|
1043
2203
|
try:
|
|
1044
2204
|
json_obj = json.loads(result)
|
|
@@ -1057,7 +2217,7 @@ def doDescribeSpecInfo(args, parsed_globals):
|
|
|
1057
2217
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1058
2218
|
|
|
1059
2219
|
|
|
1060
|
-
def
|
|
2220
|
+
def doAssignProject(args, parsed_globals):
|
|
1061
2221
|
g_param = parse_global_arg(parsed_globals)
|
|
1062
2222
|
|
|
1063
2223
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1067,7 +2227,10 @@ def doDescribeBackupDownloadTask(args, parsed_globals):
|
|
|
1067
2227
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1068
2228
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1069
2229
|
)
|
|
1070
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
1071
2234
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1072
2235
|
else:
|
|
1073
2236
|
cred = credential.Credential(
|
|
@@ -1079,18 +2242,18 @@ def doDescribeBackupDownloadTask(args, parsed_globals):
|
|
|
1079
2242
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1080
2243
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1081
2244
|
)
|
|
1082
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
2245
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1083
2246
|
if g_param[OptionsDefine.Language]:
|
|
1084
2247
|
profile.language = g_param[OptionsDefine.Language]
|
|
1085
2248
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1086
2249
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1087
2250
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1088
2251
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1089
|
-
model = models.
|
|
2252
|
+
model = models.AssignProjectRequest()
|
|
1090
2253
|
model.from_json_string(json.dumps(args))
|
|
1091
2254
|
start_time = time.time()
|
|
1092
2255
|
while True:
|
|
1093
|
-
rsp = client.
|
|
2256
|
+
rsp = client.AssignProject(model)
|
|
1094
2257
|
result = rsp.to_json_string()
|
|
1095
2258
|
try:
|
|
1096
2259
|
json_obj = json.loads(result)
|
|
@@ -1109,7 +2272,7 @@ def doDescribeBackupDownloadTask(args, parsed_globals):
|
|
|
1109
2272
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1110
2273
|
|
|
1111
2274
|
|
|
1112
|
-
def
|
|
2275
|
+
def doUpgradeDbInstanceVersion(args, parsed_globals):
|
|
1113
2276
|
g_param = parse_global_arg(parsed_globals)
|
|
1114
2277
|
|
|
1115
2278
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1119,7 +2282,10 @@ def doInquirePriceCreateDBInstances(args, parsed_globals):
|
|
|
1119
2282
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1120
2283
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1121
2284
|
)
|
|
1122
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
1123
2289
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1124
2290
|
else:
|
|
1125
2291
|
cred = credential.Credential(
|
|
@@ -1131,18 +2297,18 @@ def doInquirePriceCreateDBInstances(args, parsed_globals):
|
|
|
1131
2297
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1132
2298
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1133
2299
|
)
|
|
1134
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
2300
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1135
2301
|
if g_param[OptionsDefine.Language]:
|
|
1136
2302
|
profile.language = g_param[OptionsDefine.Language]
|
|
1137
2303
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1138
2304
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1139
2305
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1140
2306
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1141
|
-
model = models.
|
|
2307
|
+
model = models.UpgradeDbInstanceVersionRequest()
|
|
1142
2308
|
model.from_json_string(json.dumps(args))
|
|
1143
2309
|
start_time = time.time()
|
|
1144
2310
|
while True:
|
|
1145
|
-
rsp = client.
|
|
2311
|
+
rsp = client.UpgradeDbInstanceVersion(model)
|
|
1146
2312
|
result = rsp.to_json_string()
|
|
1147
2313
|
try:
|
|
1148
2314
|
json_obj = json.loads(result)
|
|
@@ -1161,7 +2327,7 @@ def doInquirePriceCreateDBInstances(args, parsed_globals):
|
|
|
1161
2327
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1162
2328
|
|
|
1163
2329
|
|
|
1164
|
-
def
|
|
2330
|
+
def doSetInstanceMaintenance(args, parsed_globals):
|
|
1165
2331
|
g_param = parse_global_arg(parsed_globals)
|
|
1166
2332
|
|
|
1167
2333
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1171,7 +2337,10 @@ def doAssignProject(args, parsed_globals):
|
|
|
1171
2337
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1172
2338
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1173
2339
|
)
|
|
1174
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
1175
2344
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1176
2345
|
else:
|
|
1177
2346
|
cred = credential.Credential(
|
|
@@ -1183,18 +2352,18 @@ def doAssignProject(args, parsed_globals):
|
|
|
1183
2352
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1184
2353
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1185
2354
|
)
|
|
1186
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
2355
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1187
2356
|
if g_param[OptionsDefine.Language]:
|
|
1188
2357
|
profile.language = g_param[OptionsDefine.Language]
|
|
1189
2358
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1190
2359
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1191
2360
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1192
2361
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1193
|
-
model = models.
|
|
2362
|
+
model = models.SetInstanceMaintenanceRequest()
|
|
1194
2363
|
model.from_json_string(json.dumps(args))
|
|
1195
2364
|
start_time = time.time()
|
|
1196
2365
|
while True:
|
|
1197
|
-
rsp = client.
|
|
2366
|
+
rsp = client.SetInstanceMaintenance(model)
|
|
1198
2367
|
result = rsp.to_json_string()
|
|
1199
2368
|
try:
|
|
1200
2369
|
json_obj = json.loads(result)
|
|
@@ -1213,7 +2382,7 @@ def doAssignProject(args, parsed_globals):
|
|
|
1213
2382
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1214
2383
|
|
|
1215
2384
|
|
|
1216
|
-
def
|
|
2385
|
+
def doModifyInstanceParams(args, parsed_globals):
|
|
1217
2386
|
g_param = parse_global_arg(parsed_globals)
|
|
1218
2387
|
|
|
1219
2388
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1223,7 +2392,10 @@ def doRenameInstance(args, parsed_globals):
|
|
|
1223
2392
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1224
2393
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1225
2394
|
)
|
|
1226
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
1227
2399
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1228
2400
|
else:
|
|
1229
2401
|
cred = credential.Credential(
|
|
@@ -1235,18 +2407,18 @@ def doRenameInstance(args, parsed_globals):
|
|
|
1235
2407
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1236
2408
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1237
2409
|
)
|
|
1238
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
2410
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1239
2411
|
if g_param[OptionsDefine.Language]:
|
|
1240
2412
|
profile.language = g_param[OptionsDefine.Language]
|
|
1241
2413
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1242
2414
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1243
2415
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1244
2416
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1245
|
-
model = models.
|
|
2417
|
+
model = models.ModifyInstanceParamsRequest()
|
|
1246
2418
|
model.from_json_string(json.dumps(args))
|
|
1247
2419
|
start_time = time.time()
|
|
1248
2420
|
while True:
|
|
1249
|
-
rsp = client.
|
|
2421
|
+
rsp = client.ModifyInstanceParams(model)
|
|
1250
2422
|
result = rsp.to_json_string()
|
|
1251
2423
|
try:
|
|
1252
2424
|
json_obj = json.loads(result)
|
|
@@ -1275,7 +2447,10 @@ def doRenewDBInstances(args, parsed_globals):
|
|
|
1275
2447
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1276
2448
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1277
2449
|
)
|
|
1278
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
1279
2454
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1280
2455
|
else:
|
|
1281
2456
|
cred = credential.Credential(
|
|
@@ -1287,7 +2462,7 @@ def doRenewDBInstances(args, parsed_globals):
|
|
|
1287
2462
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1288
2463
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1289
2464
|
)
|
|
1290
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
2465
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1291
2466
|
if g_param[OptionsDefine.Language]:
|
|
1292
2467
|
profile.language = g_param[OptionsDefine.Language]
|
|
1293
2468
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
@@ -1317,7 +2492,7 @@ def doRenewDBInstances(args, parsed_globals):
|
|
|
1317
2492
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1318
2493
|
|
|
1319
2494
|
|
|
1320
|
-
def
|
|
2495
|
+
def doEnableTransparentDataEncryption(args, parsed_globals):
|
|
1321
2496
|
g_param = parse_global_arg(parsed_globals)
|
|
1322
2497
|
|
|
1323
2498
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
@@ -1327,7 +2502,10 @@ def doCreateBackupDBInstance(args, parsed_globals):
|
|
|
1327
2502
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1328
2503
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1329
2504
|
)
|
|
1330
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
1331
2509
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1332
2510
|
else:
|
|
1333
2511
|
cred = credential.Credential(
|
|
@@ -1339,18 +2517,73 @@ def doCreateBackupDBInstance(args, parsed_globals):
|
|
|
1339
2517
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1340
2518
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1341
2519
|
)
|
|
1342
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
2520
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1343
2521
|
if g_param[OptionsDefine.Language]:
|
|
1344
2522
|
profile.language = g_param[OptionsDefine.Language]
|
|
1345
2523
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1346
2524
|
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1347
2525
|
client._sdkVersion += ("_CLI_" + __version__)
|
|
1348
2526
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1349
|
-
model = models.
|
|
2527
|
+
model = models.EnableTransparentDataEncryptionRequest()
|
|
1350
2528
|
model.from_json_string(json.dumps(args))
|
|
1351
2529
|
start_time = time.time()
|
|
1352
2530
|
while True:
|
|
1353
|
-
rsp = client.
|
|
2531
|
+
rsp = client.EnableTransparentDataEncryption(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 doModifyDBInstanceNetworkAddress(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2580
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2581
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2582
|
+
model = models.ModifyDBInstanceNetworkAddressRequest()
|
|
2583
|
+
model.from_json_string(json.dumps(args))
|
|
2584
|
+
start_time = time.time()
|
|
2585
|
+
while True:
|
|
2586
|
+
rsp = client.ModifyDBInstanceNetworkAddress(model)
|
|
1354
2587
|
result = rsp.to_json_string()
|
|
1355
2588
|
try:
|
|
1356
2589
|
json_obj = json.loads(result)
|
|
@@ -1379,7 +2612,10 @@ def doInquirePriceRenewDBInstances(args, parsed_globals):
|
|
|
1379
2612
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1380
2613
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1381
2614
|
)
|
|
1382
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
1383
2619
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1384
2620
|
else:
|
|
1385
2621
|
cred = credential.Credential(
|
|
@@ -1391,7 +2627,7 @@ def doInquirePriceRenewDBInstances(args, parsed_globals):
|
|
|
1391
2627
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1392
2628
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1393
2629
|
)
|
|
1394
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
2630
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1395
2631
|
if g_param[OptionsDefine.Language]:
|
|
1396
2632
|
profile.language = g_param[OptionsDefine.Language]
|
|
1397
2633
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
@@ -1421,6 +2657,61 @@ def doInquirePriceRenewDBInstances(args, parsed_globals):
|
|
|
1421
2657
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1422
2658
|
|
|
1423
2659
|
|
|
2660
|
+
def doDeleteAccountUser(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.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
2690
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
2691
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
2692
|
+
model = models.DeleteAccountUserRequest()
|
|
2693
|
+
model.from_json_string(json.dumps(args))
|
|
2694
|
+
start_time = time.time()
|
|
2695
|
+
while True:
|
|
2696
|
+
rsp = client.DeleteAccountUser(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
|
+
|
|
1424
2715
|
def doModifyDBInstanceSecurityGroup(args, parsed_globals):
|
|
1425
2716
|
g_param = parse_global_arg(parsed_globals)
|
|
1426
2717
|
|
|
@@ -1431,7 +2722,10 @@ def doModifyDBInstanceSecurityGroup(args, parsed_globals):
|
|
|
1431
2722
|
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1432
2723
|
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1433
2724
|
)
|
|
1434
|
-
elif os.getenv(OptionsDefine.ENV_TKE_REGION)
|
|
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):
|
|
1435
2729
|
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1436
2730
|
else:
|
|
1437
2731
|
cred = credential.Credential(
|
|
@@ -1443,7 +2737,7 @@ def doModifyDBInstanceSecurityGroup(args, parsed_globals):
|
|
|
1443
2737
|
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1444
2738
|
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1445
2739
|
)
|
|
1446
|
-
profile = ClientProfile(httpProfile=http_profile, signMethod="
|
|
2740
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1447
2741
|
if g_param[OptionsDefine.Language]:
|
|
1448
2742
|
profile.language = g_param[OptionsDefine.Language]
|
|
1449
2743
|
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
@@ -1484,33 +2778,55 @@ MODELS_MAP = {
|
|
|
1484
2778
|
}
|
|
1485
2779
|
|
|
1486
2780
|
ACTION_MAP = {
|
|
2781
|
+
"TerminateDBInstances": doTerminateDBInstances,
|
|
2782
|
+
"CreateLogDownloadTask": doCreateLogDownloadTask,
|
|
2783
|
+
"DescribeDBInstanceNodeProperty": doDescribeDBInstanceNodeProperty,
|
|
1487
2784
|
"DescribeDBInstanceDeal": doDescribeDBInstanceDeal,
|
|
1488
|
-
"
|
|
2785
|
+
"DescribeCurrentOp": doDescribeCurrentOp,
|
|
2786
|
+
"DescribeDBBackups": doDescribeDBBackups,
|
|
1489
2787
|
"DescribeClientConnections": doDescribeClientConnections,
|
|
1490
2788
|
"ResetDBInstancePassword": doResetDBInstancePassword,
|
|
1491
2789
|
"DescribeSecurityGroup": doDescribeSecurityGroup,
|
|
2790
|
+
"SetAccountUserPrivilege": doSetAccountUserPrivilege,
|
|
1492
2791
|
"FlushInstanceRouterConfig": doFlushInstanceRouterConfig,
|
|
1493
|
-
"
|
|
1494
|
-
"
|
|
2792
|
+
"DescribeDBInstanceNamespace": doDescribeDBInstanceNamespace,
|
|
2793
|
+
"DeleteLogDownloadTask": doDeleteLogDownloadTask,
|
|
2794
|
+
"DescribeDetailedSlowLogs": doDescribeDetailedSlowLogs,
|
|
2795
|
+
"InstanceEnableSSL": doInstanceEnableSSL,
|
|
1495
2796
|
"InquirePriceModifyDBInstanceSpec": doInquirePriceModifyDBInstanceSpec,
|
|
2797
|
+
"DescribeLogDownloadTasks": doDescribeLogDownloadTasks,
|
|
2798
|
+
"DescribeBackupRules": doDescribeBackupRules,
|
|
2799
|
+
"RenameInstance": doRenameInstance,
|
|
1496
2800
|
"DescribeAsyncRequestInfo": doDescribeAsyncRequestInfo,
|
|
1497
|
-
"
|
|
2801
|
+
"CreateAccountUser": doCreateAccountUser,
|
|
1498
2802
|
"CreateDBInstanceHour": doCreateDBInstanceHour,
|
|
2803
|
+
"IsolateDBInstance": doIsolateDBInstance,
|
|
2804
|
+
"KillOps": doKillOps,
|
|
1499
2805
|
"CreateBackupDownloadTask": doCreateBackupDownloadTask,
|
|
2806
|
+
"CreateBackupDBInstance": doCreateBackupDBInstance,
|
|
1500
2807
|
"DescribeDBInstances": doDescribeDBInstances,
|
|
2808
|
+
"OfflineIsolatedDBInstance": doOfflineIsolatedDBInstance,
|
|
1501
2809
|
"DescribeSlowLogPatterns": doDescribeSlowLogPatterns,
|
|
1502
2810
|
"DescribeSlowLogs": doDescribeSlowLogs,
|
|
2811
|
+
"DescribeMongodbLogs": doDescribeMongodbLogs,
|
|
1503
2812
|
"CreateDBInstance": doCreateDBInstance,
|
|
1504
2813
|
"ModifyDBInstanceSpec": doModifyDBInstanceSpec,
|
|
1505
2814
|
"DescribeInstanceParams": doDescribeInstanceParams,
|
|
2815
|
+
"UpgradeDBInstanceKernelVersion": doUpgradeDBInstanceKernelVersion,
|
|
1506
2816
|
"DescribeSpecInfo": doDescribeSpecInfo,
|
|
1507
2817
|
"DescribeBackupDownloadTask": doDescribeBackupDownloadTask,
|
|
1508
2818
|
"InquirePriceCreateDBInstances": doInquirePriceCreateDBInstances,
|
|
2819
|
+
"DescribeInstanceSSL": doDescribeInstanceSSL,
|
|
2820
|
+
"SetDBInstanceDeletionProtection": doSetDBInstanceDeletionProtection,
|
|
1509
2821
|
"AssignProject": doAssignProject,
|
|
1510
|
-
"
|
|
2822
|
+
"UpgradeDbInstanceVersion": doUpgradeDbInstanceVersion,
|
|
2823
|
+
"SetInstanceMaintenance": doSetInstanceMaintenance,
|
|
2824
|
+
"ModifyInstanceParams": doModifyInstanceParams,
|
|
1511
2825
|
"RenewDBInstances": doRenewDBInstances,
|
|
1512
|
-
"
|
|
2826
|
+
"EnableTransparentDataEncryption": doEnableTransparentDataEncryption,
|
|
2827
|
+
"ModifyDBInstanceNetworkAddress": doModifyDBInstanceNetworkAddress,
|
|
1513
2828
|
"InquirePriceRenewDBInstances": doInquirePriceRenewDBInstances,
|
|
2829
|
+
"DeleteAccountUser": doDeleteAccountUser,
|
|
1514
2830
|
"ModifyDBInstanceSecurityGroup": doModifyDBInstanceSecurityGroup,
|
|
1515
2831
|
|
|
1516
2832
|
}
|