tccli-intl-en 3.1.3.1__py2.py3-none-any.whl → 3.1.5.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tccli/__init__.py +1 -1
- tccli/services/__init__.py +3 -0
- tccli/services/autoscaling/v20180419/api.json +36 -14
- tccli/services/clb/clb_client.py +636 -300
- tccli/services/clb/v20180317/api.json +1245 -367
- tccli/services/clb/v20180317/examples.json +172 -112
- tccli/services/faceid/v20180301/api.json +9 -0
- tccli/services/mongodb/mongodb_client.py +448 -0
- tccli/services/mongodb/v20190725/api.json +928 -103
- tccli/services/mongodb/v20190725/examples.json +64 -0
- tccli/services/ocr/v20181119/api.json +1 -1
- tccli/services/tdmq/tdmq_client.py +2406 -278
- tccli/services/tdmq/v20200217/api.json +11607 -3958
- tccli/services/tdmq/v20200217/examples.json +562 -264
- tccli/services/teo/v20220901/api.json +68 -4
- tccli/services/teo/v20220901/examples.json +28 -22
- 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_intl_en-3.1.3.1.dist-info → tccli_intl_en-3.1.5.1.dist-info}/METADATA +2 -2
- {tccli_intl_en-3.1.3.1.dist-info → tccli_intl_en-3.1.5.1.dist-info}/RECORD +26 -22
- {tccli_intl_en-3.1.3.1.dist-info → tccli_intl_en-3.1.5.1.dist-info}/LICENSE +0 -0
- {tccli_intl_en-3.1.3.1.dist-info → tccli_intl_en-3.1.5.1.dist-info}/WHEEL +0 -0
- {tccli_intl_en-3.1.3.1.dist-info → tccli_intl_en-3.1.5.1.dist-info}/entry_points.txt +0 -0
- {tccli_intl_en-3.1.3.1.dist-info → tccli_intl_en-3.1.5.1.dist-info}/top_level.txt +0 -0
|
@@ -485,6 +485,15 @@
|
|
|
485
485
|
"name": "ActionList",
|
|
486
486
|
"required": false,
|
|
487
487
|
"type": "string"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"disabled": false,
|
|
491
|
+
"document": "Whether expired identity documents are permitted to proceed to the liveness detection process. This parameter only takes effect when the document type is Hong Kong Identity Card (HKID).\ntrue (default value): Expired HKID is allowed to enter the liveness process.\nfalse : Expired HKID is rejected and cannot enter the liveness process.",
|
|
492
|
+
"example": "true",
|
|
493
|
+
"member": "bool",
|
|
494
|
+
"name": "AllowExpiredDocument",
|
|
495
|
+
"required": false,
|
|
496
|
+
"type": "bool"
|
|
488
497
|
}
|
|
489
498
|
],
|
|
490
499
|
"type": "object"
|
|
@@ -72,6 +72,61 @@ def doTerminateDBInstances(args, parsed_globals):
|
|
|
72
72
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
73
73
|
|
|
74
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
|
+
|
|
75
130
|
def doDescribeDBInstanceNodeProperty(args, parsed_globals):
|
|
76
131
|
g_param = parse_global_arg(parsed_globals)
|
|
77
132
|
|
|
@@ -237,6 +292,61 @@ def doDescribeDBInstanceNamespace(args, parsed_globals):
|
|
|
237
292
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
238
293
|
|
|
239
294
|
|
|
295
|
+
def doDeleteLogDownloadTask(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.DeleteLogDownloadTaskRequest()
|
|
328
|
+
model.from_json_string(json.dumps(args))
|
|
329
|
+
start_time = time.time()
|
|
330
|
+
while True:
|
|
331
|
+
rsp = client.DeleteLogDownloadTask(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
|
+
|
|
240
350
|
def doDescribeClientConnections(args, parsed_globals):
|
|
241
351
|
g_param = parse_global_arg(parsed_globals)
|
|
242
352
|
|
|
@@ -567,6 +677,61 @@ def doIsolateDBInstance(args, parsed_globals):
|
|
|
567
677
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
568
678
|
|
|
569
679
|
|
|
680
|
+
def doInstanceEnableSSL(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.InstanceEnableSSLRequest()
|
|
713
|
+
model.from_json_string(json.dumps(args))
|
|
714
|
+
start_time = time.time()
|
|
715
|
+
while True:
|
|
716
|
+
rsp = client.InstanceEnableSSL(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
|
+
|
|
570
735
|
def doInquirePriceModifyDBInstanceSpec(args, parsed_globals):
|
|
571
736
|
g_param = parse_global_arg(parsed_globals)
|
|
572
737
|
|
|
@@ -622,6 +787,61 @@ def doInquirePriceModifyDBInstanceSpec(args, parsed_globals):
|
|
|
622
787
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
623
788
|
|
|
624
789
|
|
|
790
|
+
def doDescribeLogDownloadTasks(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.DescribeLogDownloadTasksRequest()
|
|
823
|
+
model.from_json_string(json.dumps(args))
|
|
824
|
+
start_time = time.time()
|
|
825
|
+
while True:
|
|
826
|
+
rsp = client.DescribeLogDownloadTasks(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
|
+
|
|
625
845
|
def doDescribeAsyncRequestInfo(args, parsed_globals):
|
|
626
846
|
g_param = parse_global_arg(parsed_globals)
|
|
627
847
|
|
|
@@ -1117,6 +1337,61 @@ def doDescribeSlowLogs(args, parsed_globals):
|
|
|
1117
1337
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1118
1338
|
|
|
1119
1339
|
|
|
1340
|
+
def doDescribeMongodbLogs(args, parsed_globals):
|
|
1341
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1342
|
+
|
|
1343
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1344
|
+
cred = credential.CVMRoleCredential()
|
|
1345
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1346
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1347
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1348
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1349
|
+
)
|
|
1350
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1351
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1352
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1353
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1354
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1355
|
+
else:
|
|
1356
|
+
cred = credential.Credential(
|
|
1357
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1358
|
+
)
|
|
1359
|
+
http_profile = HttpProfile(
|
|
1360
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1361
|
+
reqMethod="POST",
|
|
1362
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1363
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1364
|
+
)
|
|
1365
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1366
|
+
if g_param[OptionsDefine.Language]:
|
|
1367
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1368
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1369
|
+
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1370
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1371
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1372
|
+
model = models.DescribeMongodbLogsRequest()
|
|
1373
|
+
model.from_json_string(json.dumps(args))
|
|
1374
|
+
start_time = time.time()
|
|
1375
|
+
while True:
|
|
1376
|
+
rsp = client.DescribeMongodbLogs(model)
|
|
1377
|
+
result = rsp.to_json_string()
|
|
1378
|
+
try:
|
|
1379
|
+
json_obj = json.loads(result)
|
|
1380
|
+
except TypeError as e:
|
|
1381
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1382
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1383
|
+
break
|
|
1384
|
+
cur_time = time.time()
|
|
1385
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1386
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1387
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1388
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1389
|
+
else:
|
|
1390
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1391
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1392
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1393
|
+
|
|
1394
|
+
|
|
1120
1395
|
def doCreateDBInstance(args, parsed_globals):
|
|
1121
1396
|
g_param = parse_global_arg(parsed_globals)
|
|
1122
1397
|
|
|
@@ -1282,6 +1557,61 @@ def doDescribeInstanceParams(args, parsed_globals):
|
|
|
1282
1557
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1283
1558
|
|
|
1284
1559
|
|
|
1560
|
+
def doUpgradeDBInstanceKernelVersion(args, parsed_globals):
|
|
1561
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1562
|
+
|
|
1563
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1564
|
+
cred = credential.CVMRoleCredential()
|
|
1565
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1566
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1567
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1568
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1569
|
+
)
|
|
1570
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1571
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1572
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1573
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1574
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1575
|
+
else:
|
|
1576
|
+
cred = credential.Credential(
|
|
1577
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1578
|
+
)
|
|
1579
|
+
http_profile = HttpProfile(
|
|
1580
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1581
|
+
reqMethod="POST",
|
|
1582
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1583
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1584
|
+
)
|
|
1585
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1586
|
+
if g_param[OptionsDefine.Language]:
|
|
1587
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1588
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1589
|
+
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1590
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1591
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1592
|
+
model = models.UpgradeDBInstanceKernelVersionRequest()
|
|
1593
|
+
model.from_json_string(json.dumps(args))
|
|
1594
|
+
start_time = time.time()
|
|
1595
|
+
while True:
|
|
1596
|
+
rsp = client.UpgradeDBInstanceKernelVersion(model)
|
|
1597
|
+
result = rsp.to_json_string()
|
|
1598
|
+
try:
|
|
1599
|
+
json_obj = json.loads(result)
|
|
1600
|
+
except TypeError as e:
|
|
1601
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1602
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1603
|
+
break
|
|
1604
|
+
cur_time = time.time()
|
|
1605
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1606
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1607
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1608
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1609
|
+
else:
|
|
1610
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1611
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1612
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1613
|
+
|
|
1614
|
+
|
|
1285
1615
|
def doDescribeSpecInfo(args, parsed_globals):
|
|
1286
1616
|
g_param = parse_global_arg(parsed_globals)
|
|
1287
1617
|
|
|
@@ -1447,6 +1777,61 @@ def doInquirePriceCreateDBInstances(args, parsed_globals):
|
|
|
1447
1777
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1448
1778
|
|
|
1449
1779
|
|
|
1780
|
+
def doDescribeInstanceSSL(args, parsed_globals):
|
|
1781
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1782
|
+
|
|
1783
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1784
|
+
cred = credential.CVMRoleCredential()
|
|
1785
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1786
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1787
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1788
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1789
|
+
)
|
|
1790
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1791
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1792
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1793
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1794
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1795
|
+
else:
|
|
1796
|
+
cred = credential.Credential(
|
|
1797
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1798
|
+
)
|
|
1799
|
+
http_profile = HttpProfile(
|
|
1800
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1801
|
+
reqMethod="POST",
|
|
1802
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1803
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1804
|
+
)
|
|
1805
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1806
|
+
if g_param[OptionsDefine.Language]:
|
|
1807
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1808
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1809
|
+
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1810
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1811
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1812
|
+
model = models.DescribeInstanceSSLRequest()
|
|
1813
|
+
model.from_json_string(json.dumps(args))
|
|
1814
|
+
start_time = time.time()
|
|
1815
|
+
while True:
|
|
1816
|
+
rsp = client.DescribeInstanceSSL(model)
|
|
1817
|
+
result = rsp.to_json_string()
|
|
1818
|
+
try:
|
|
1819
|
+
json_obj = json.loads(result)
|
|
1820
|
+
except TypeError as e:
|
|
1821
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1822
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1823
|
+
break
|
|
1824
|
+
cur_time = time.time()
|
|
1825
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1826
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1827
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1828
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1829
|
+
else:
|
|
1830
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1831
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1832
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1833
|
+
|
|
1834
|
+
|
|
1450
1835
|
def doSetDBInstanceDeletionProtection(args, parsed_globals):
|
|
1451
1836
|
g_param = parse_global_arg(parsed_globals)
|
|
1452
1837
|
|
|
@@ -1557,6 +1942,61 @@ def doAssignProject(args, parsed_globals):
|
|
|
1557
1942
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1558
1943
|
|
|
1559
1944
|
|
|
1945
|
+
def doUpgradeDbInstanceVersion(args, parsed_globals):
|
|
1946
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1947
|
+
|
|
1948
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1949
|
+
cred = credential.CVMRoleCredential()
|
|
1950
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1951
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1952
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1953
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1954
|
+
)
|
|
1955
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) \
|
|
1956
|
+
and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) \
|
|
1957
|
+
and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) \
|
|
1958
|
+
and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1959
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1960
|
+
else:
|
|
1961
|
+
cred = credential.Credential(
|
|
1962
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1963
|
+
)
|
|
1964
|
+
http_profile = HttpProfile(
|
|
1965
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1966
|
+
reqMethod="POST",
|
|
1967
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1968
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1969
|
+
)
|
|
1970
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="TC3-HMAC-SHA256")
|
|
1971
|
+
if g_param[OptionsDefine.Language]:
|
|
1972
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1973
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1974
|
+
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1975
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1976
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1977
|
+
model = models.UpgradeDbInstanceVersionRequest()
|
|
1978
|
+
model.from_json_string(json.dumps(args))
|
|
1979
|
+
start_time = time.time()
|
|
1980
|
+
while True:
|
|
1981
|
+
rsp = client.UpgradeDbInstanceVersion(model)
|
|
1982
|
+
result = rsp.to_json_string()
|
|
1983
|
+
try:
|
|
1984
|
+
json_obj = json.loads(result)
|
|
1985
|
+
except TypeError as e:
|
|
1986
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1987
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1988
|
+
break
|
|
1989
|
+
cur_time = time.time()
|
|
1990
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1991
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1992
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1993
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1994
|
+
else:
|
|
1995
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1996
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1997
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1998
|
+
|
|
1999
|
+
|
|
1560
2000
|
def doRenameInstance(args, parsed_globals):
|
|
1561
2001
|
g_param = parse_global_arg(parsed_globals)
|
|
1562
2002
|
|
|
@@ -1844,16 +2284,20 @@ MODELS_MAP = {
|
|
|
1844
2284
|
|
|
1845
2285
|
ACTION_MAP = {
|
|
1846
2286
|
"TerminateDBInstances": doTerminateDBInstances,
|
|
2287
|
+
"CreateLogDownloadTask": doCreateLogDownloadTask,
|
|
1847
2288
|
"DescribeDBInstanceNodeProperty": doDescribeDBInstanceNodeProperty,
|
|
1848
2289
|
"DescribeDBInstanceDeal": doDescribeDBInstanceDeal,
|
|
1849
2290
|
"DescribeDBInstanceNamespace": doDescribeDBInstanceNamespace,
|
|
2291
|
+
"DeleteLogDownloadTask": doDeleteLogDownloadTask,
|
|
1850
2292
|
"DescribeClientConnections": doDescribeClientConnections,
|
|
1851
2293
|
"ResetDBInstancePassword": doResetDBInstancePassword,
|
|
1852
2294
|
"DescribeSecurityGroup": doDescribeSecurityGroup,
|
|
1853
2295
|
"FlushInstanceRouterConfig": doFlushInstanceRouterConfig,
|
|
1854
2296
|
"DescribeDBBackups": doDescribeDBBackups,
|
|
1855
2297
|
"IsolateDBInstance": doIsolateDBInstance,
|
|
2298
|
+
"InstanceEnableSSL": doInstanceEnableSSL,
|
|
1856
2299
|
"InquirePriceModifyDBInstanceSpec": doInquirePriceModifyDBInstanceSpec,
|
|
2300
|
+
"DescribeLogDownloadTasks": doDescribeLogDownloadTasks,
|
|
1857
2301
|
"DescribeAsyncRequestInfo": doDescribeAsyncRequestInfo,
|
|
1858
2302
|
"ModifyDBInstanceNetworkAddress": doModifyDBInstanceNetworkAddress,
|
|
1859
2303
|
"CreateDBInstanceHour": doCreateDBInstanceHour,
|
|
@@ -1863,14 +2307,18 @@ ACTION_MAP = {
|
|
|
1863
2307
|
"OfflineIsolatedDBInstance": doOfflineIsolatedDBInstance,
|
|
1864
2308
|
"DescribeSlowLogPatterns": doDescribeSlowLogPatterns,
|
|
1865
2309
|
"DescribeSlowLogs": doDescribeSlowLogs,
|
|
2310
|
+
"DescribeMongodbLogs": doDescribeMongodbLogs,
|
|
1866
2311
|
"CreateDBInstance": doCreateDBInstance,
|
|
1867
2312
|
"ModifyDBInstanceSpec": doModifyDBInstanceSpec,
|
|
1868
2313
|
"DescribeInstanceParams": doDescribeInstanceParams,
|
|
2314
|
+
"UpgradeDBInstanceKernelVersion": doUpgradeDBInstanceKernelVersion,
|
|
1869
2315
|
"DescribeSpecInfo": doDescribeSpecInfo,
|
|
1870
2316
|
"DescribeBackupDownloadTask": doDescribeBackupDownloadTask,
|
|
1871
2317
|
"InquirePriceCreateDBInstances": doInquirePriceCreateDBInstances,
|
|
2318
|
+
"DescribeInstanceSSL": doDescribeInstanceSSL,
|
|
1872
2319
|
"SetDBInstanceDeletionProtection": doSetDBInstanceDeletionProtection,
|
|
1873
2320
|
"AssignProject": doAssignProject,
|
|
2321
|
+
"UpgradeDbInstanceVersion": doUpgradeDbInstanceVersion,
|
|
1874
2322
|
"RenameInstance": doRenameInstance,
|
|
1875
2323
|
"RenewDBInstances": doRenewDBInstances,
|
|
1876
2324
|
"CreateBackupDBInstance": doCreateBackupDBInstance,
|