tccli-intl-en 3.0.1271.1__py2.py3-none-any.whl → 3.0.1272.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/mongodb/mongodb_client.py +159 -0
- tccli/services/mongodb/v20190725/api.json +533 -226
- tccli/services/mongodb/v20190725/examples.json +46 -22
- {tccli_intl_en-3.0.1271.1.dist-info → tccli_intl_en-3.0.1272.1.dist-info}/METADATA +2 -2
- {tccli_intl_en-3.0.1271.1.dist-info → tccli_intl_en-3.0.1272.1.dist-info}/RECORD +10 -10
- {tccli_intl_en-3.0.1271.1.dist-info → tccli_intl_en-3.0.1272.1.dist-info}/LICENSE +0 -0
- {tccli_intl_en-3.0.1271.1.dist-info → tccli_intl_en-3.0.1272.1.dist-info}/WHEEL +0 -0
- {tccli_intl_en-3.0.1271.1.dist-info → tccli_intl_en-3.0.1272.1.dist-info}/entry_points.txt +0 -0
- {tccli_intl_en-3.0.1271.1.dist-info → tccli_intl_en-3.0.1272.1.dist-info}/top_level.txt +0 -0
tccli/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '3.0.
|
|
1
|
+
__version__ = '3.0.1272.1'
|
|
@@ -17,6 +17,58 @@ 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) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
31
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
32
|
+
else:
|
|
33
|
+
cred = credential.Credential(
|
|
34
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
35
|
+
)
|
|
36
|
+
http_profile = HttpProfile(
|
|
37
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
38
|
+
reqMethod="POST",
|
|
39
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
40
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
41
|
+
)
|
|
42
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
43
|
+
if g_param[OptionsDefine.Language]:
|
|
44
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
45
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
46
|
+
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
47
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
48
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
49
|
+
model = models.TerminateDBInstancesRequest()
|
|
50
|
+
model.from_json_string(json.dumps(args))
|
|
51
|
+
start_time = time.time()
|
|
52
|
+
while True:
|
|
53
|
+
rsp = client.TerminateDBInstances(model)
|
|
54
|
+
result = rsp.to_json_string()
|
|
55
|
+
try:
|
|
56
|
+
json_obj = json.loads(result)
|
|
57
|
+
except TypeError as e:
|
|
58
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
59
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
60
|
+
break
|
|
61
|
+
cur_time = time.time()
|
|
62
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
63
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
64
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
65
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
66
|
+
else:
|
|
67
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
68
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
69
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
70
|
+
|
|
71
|
+
|
|
20
72
|
def doDescribeDBInstanceDeal(args, parsed_globals):
|
|
21
73
|
g_param = parse_global_arg(parsed_globals)
|
|
22
74
|
|
|
@@ -641,6 +693,58 @@ def doCreateDBInstanceHour(args, parsed_globals):
|
|
|
641
693
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
642
694
|
|
|
643
695
|
|
|
696
|
+
def doDescribeDetailedSlowLogs(args, parsed_globals):
|
|
697
|
+
g_param = parse_global_arg(parsed_globals)
|
|
698
|
+
|
|
699
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
700
|
+
cred = credential.CVMRoleCredential()
|
|
701
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
702
|
+
cred = credential.STSAssumeRoleCredential(
|
|
703
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
704
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
705
|
+
)
|
|
706
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
707
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
708
|
+
else:
|
|
709
|
+
cred = credential.Credential(
|
|
710
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
711
|
+
)
|
|
712
|
+
http_profile = HttpProfile(
|
|
713
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
714
|
+
reqMethod="POST",
|
|
715
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
716
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
717
|
+
)
|
|
718
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
719
|
+
if g_param[OptionsDefine.Language]:
|
|
720
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
721
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
722
|
+
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
723
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
724
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
725
|
+
model = models.DescribeDetailedSlowLogsRequest()
|
|
726
|
+
model.from_json_string(json.dumps(args))
|
|
727
|
+
start_time = time.time()
|
|
728
|
+
while True:
|
|
729
|
+
rsp = client.DescribeDetailedSlowLogs(model)
|
|
730
|
+
result = rsp.to_json_string()
|
|
731
|
+
try:
|
|
732
|
+
json_obj = json.loads(result)
|
|
733
|
+
except TypeError as e:
|
|
734
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
735
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
736
|
+
break
|
|
737
|
+
cur_time = time.time()
|
|
738
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
739
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
740
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
741
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
742
|
+
else:
|
|
743
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
744
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
745
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
746
|
+
|
|
747
|
+
|
|
644
748
|
def doCreateBackupDownloadTask(args, parsed_globals):
|
|
645
749
|
g_param = parse_global_arg(parsed_globals)
|
|
646
750
|
|
|
@@ -1213,6 +1317,58 @@ def doInquirePriceCreateDBInstances(args, parsed_globals):
|
|
|
1213
1317
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1214
1318
|
|
|
1215
1319
|
|
|
1320
|
+
def doSetDBInstanceDeletionProtection(args, parsed_globals):
|
|
1321
|
+
g_param = parse_global_arg(parsed_globals)
|
|
1322
|
+
|
|
1323
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
|
1324
|
+
cred = credential.CVMRoleCredential()
|
|
1325
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
|
1326
|
+
cred = credential.STSAssumeRoleCredential(
|
|
1327
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
|
1328
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
|
1329
|
+
)
|
|
1330
|
+
elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
|
|
1331
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
|
1332
|
+
else:
|
|
1333
|
+
cred = credential.Credential(
|
|
1334
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
|
1335
|
+
)
|
|
1336
|
+
http_profile = HttpProfile(
|
|
1337
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
|
1338
|
+
reqMethod="POST",
|
|
1339
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
|
1340
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
|
1341
|
+
)
|
|
1342
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
|
1343
|
+
if g_param[OptionsDefine.Language]:
|
|
1344
|
+
profile.language = g_param[OptionsDefine.Language]
|
|
1345
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
|
1346
|
+
client = mod.MongodbClient(cred, g_param[OptionsDefine.Region], profile)
|
|
1347
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
|
1348
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
|
1349
|
+
model = models.SetDBInstanceDeletionProtectionRequest()
|
|
1350
|
+
model.from_json_string(json.dumps(args))
|
|
1351
|
+
start_time = time.time()
|
|
1352
|
+
while True:
|
|
1353
|
+
rsp = client.SetDBInstanceDeletionProtection(model)
|
|
1354
|
+
result = rsp.to_json_string()
|
|
1355
|
+
try:
|
|
1356
|
+
json_obj = json.loads(result)
|
|
1357
|
+
except TypeError as e:
|
|
1358
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
|
1359
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
|
1360
|
+
break
|
|
1361
|
+
cur_time = time.time()
|
|
1362
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
|
1363
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
|
1364
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
|
1365
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
|
1366
|
+
else:
|
|
1367
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
|
1368
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
|
1369
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
|
1370
|
+
|
|
1371
|
+
|
|
1216
1372
|
def doAssignProject(args, parsed_globals):
|
|
1217
1373
|
g_param = parse_global_arg(parsed_globals)
|
|
1218
1374
|
|
|
@@ -1536,6 +1692,7 @@ MODELS_MAP = {
|
|
|
1536
1692
|
}
|
|
1537
1693
|
|
|
1538
1694
|
ACTION_MAP = {
|
|
1695
|
+
"TerminateDBInstances": doTerminateDBInstances,
|
|
1539
1696
|
"DescribeDBInstanceDeal": doDescribeDBInstanceDeal,
|
|
1540
1697
|
"DescribeDBInstanceNamespace": doDescribeDBInstanceNamespace,
|
|
1541
1698
|
"DescribeClientConnections": doDescribeClientConnections,
|
|
@@ -1548,6 +1705,7 @@ ACTION_MAP = {
|
|
|
1548
1705
|
"DescribeAsyncRequestInfo": doDescribeAsyncRequestInfo,
|
|
1549
1706
|
"ModifyDBInstanceNetworkAddress": doModifyDBInstanceNetworkAddress,
|
|
1550
1707
|
"CreateDBInstanceHour": doCreateDBInstanceHour,
|
|
1708
|
+
"DescribeDetailedSlowLogs": doDescribeDetailedSlowLogs,
|
|
1551
1709
|
"CreateBackupDownloadTask": doCreateBackupDownloadTask,
|
|
1552
1710
|
"DescribeDBInstances": doDescribeDBInstances,
|
|
1553
1711
|
"OfflineIsolatedDBInstance": doOfflineIsolatedDBInstance,
|
|
@@ -1559,6 +1717,7 @@ ACTION_MAP = {
|
|
|
1559
1717
|
"DescribeSpecInfo": doDescribeSpecInfo,
|
|
1560
1718
|
"DescribeBackupDownloadTask": doDescribeBackupDownloadTask,
|
|
1561
1719
|
"InquirePriceCreateDBInstances": doInquirePriceCreateDBInstances,
|
|
1720
|
+
"SetDBInstanceDeletionProtection": doSetDBInstanceDeletionProtection,
|
|
1562
1721
|
"AssignProject": doAssignProject,
|
|
1563
1722
|
"RenameInstance": doRenameInstance,
|
|
1564
1723
|
"RenewDBInstances": doRenewDBInstances,
|