tccli 3.0.1288.1__py2.py3-none-any.whl → 3.0.1289.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/plugins/sso/__init__.py +11 -1
- tccli/plugins/sso/login.py +3 -3
- tccli/services/asr/v20190614/api.json +6 -6
- tccli/services/asr/v20190614/examples.json +4 -4
- tccli/services/bi/v20220105/api.json +43 -0
- tccli/services/billing/v20180709/api.json +310 -250
- tccli/services/cdwpg/v20201230/api.json +5 -5
- tccli/services/cdwpg/v20201230/examples.json +6 -6
- tccli/services/cdz/v20221123/api.json +4 -4
- tccli/services/cfg/v20210820/api.json +197 -197
- tccli/services/cfg/v20210820/examples.json +1 -1
- tccli/services/clb/v20180317/api.json +2 -2
- tccli/services/cwp/v20180228/api.json +39 -9
- tccli/services/dbbrain/dbbrain_client.py +383 -12
- tccli/services/dbbrain/v20210527/api.json +884 -101
- tccli/services/dbbrain/v20210527/examples.json +56 -0
- tccli/services/domain/v20180808/api.json +3 -3
- tccli/services/dts/v20180330/api.json +34 -34
- tccli/services/dts/v20180330/examples.json +1 -1
- tccli/services/dts/v20211206/api.json +225 -223
- tccli/services/dts/v20211206/examples.json +2 -2
- tccli/services/ess/v20201111/api.json +30 -3
- tccli/services/essbasic/v20210526/api.json +29 -2
- tccli/services/iotexplorer/iotexplorer_client.py +159 -0
- tccli/services/iotexplorer/v20190423/api.json +561 -0
- tccli/services/iotexplorer/v20190423/examples.json +24 -0
- tccli/services/iotvideo/iotvideo_client.py +106 -0
- tccli/services/iotvideo/v20211125/api.json +105 -0
- tccli/services/iotvideo/v20211125/examples.json +16 -0
- tccli/services/lighthouse/v20200324/api.json +46 -46
- tccli/services/lighthouse/v20200324/examples.json +2 -2
- tccli/services/lke/v20231130/api.json +2 -2
- tccli/services/lkeap/v20240522/api.json +2 -2
- tccli/services/mps/v20190612/api.json +88 -6
- tccli/services/mqtt/v20240516/api.json +3 -3
- tccli/services/mqtt/v20240516/examples.json +5 -11
- tccli/services/organization/v20210331/api.json +113 -113
- tccli/services/svp/v20240125/api.json +1 -1
- tccli/services/tcb/v20180608/api.json +4 -4
- tccli/services/teo/v20220901/api.json +541 -5
- tccli/services/teo/v20220901/examples.json +21 -3
- tccli/services/tione/v20211111/api.json +64 -6
- tccli/services/vdb/v20230616/api.json +31 -2
- tccli/services/vdb/v20230616/examples.json +8 -2
- tccli/services/vrs/v20200824/api.json +14 -2
- tccli/services/vrs/v20200824/examples.json +1 -1
- tccli/services/wedata/v20210820/api.json +48 -0
- {tccli-3.0.1288.1.dist-info → tccli-3.0.1289.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1288.1.dist-info → tccli-3.0.1289.1.dist-info}/RECORD +53 -53
- {tccli-3.0.1288.1.dist-info → tccli-3.0.1289.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1288.1.dist-info → tccli-3.0.1289.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1288.1.dist-info → tccli-3.0.1289.1.dist-info}/license_files/LICENSE +0 -0
@@ -19,6 +19,58 @@ from tencentcloud.dbbrain.v20191016 import models as models_v20191016
|
|
19
19
|
from jmespath import search
|
20
20
|
import time
|
21
21
|
|
22
|
+
def doDescribeDBAutonomyEvents(args, parsed_globals):
|
23
|
+
g_param = parse_global_arg(parsed_globals)
|
24
|
+
|
25
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
26
|
+
cred = credential.CVMRoleCredential()
|
27
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
28
|
+
cred = credential.STSAssumeRoleCredential(
|
29
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
30
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
31
|
+
)
|
32
|
+
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):
|
33
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
34
|
+
else:
|
35
|
+
cred = credential.Credential(
|
36
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
37
|
+
)
|
38
|
+
http_profile = HttpProfile(
|
39
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
40
|
+
reqMethod="POST",
|
41
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
42
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
43
|
+
)
|
44
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
45
|
+
if g_param[OptionsDefine.Language]:
|
46
|
+
profile.language = g_param[OptionsDefine.Language]
|
47
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
48
|
+
client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
|
49
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
50
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
51
|
+
model = models.DescribeDBAutonomyEventsRequest()
|
52
|
+
model.from_json_string(json.dumps(args))
|
53
|
+
start_time = time.time()
|
54
|
+
while True:
|
55
|
+
rsp = client.DescribeDBAutonomyEvents(model)
|
56
|
+
result = rsp.to_json_string()
|
57
|
+
try:
|
58
|
+
json_obj = json.loads(result)
|
59
|
+
except TypeError as e:
|
60
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
61
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
62
|
+
break
|
63
|
+
cur_time = time.time()
|
64
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
65
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
66
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
67
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
68
|
+
else:
|
69
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
70
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
71
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
72
|
+
|
73
|
+
|
22
74
|
def doDescribeSecurityAuditLogDownloadUrls(args, parsed_globals):
|
23
75
|
g_param = parse_global_arg(parsed_globals)
|
24
76
|
|
@@ -539,6 +591,58 @@ def doDescribeDBDiagReportTasks(args, parsed_globals):
|
|
539
591
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
540
592
|
|
541
593
|
|
594
|
+
def doDescribeRedisTopKeyPrefixList(args, parsed_globals):
|
595
|
+
g_param = parse_global_arg(parsed_globals)
|
596
|
+
|
597
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
598
|
+
cred = credential.CVMRoleCredential()
|
599
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
600
|
+
cred = credential.STSAssumeRoleCredential(
|
601
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
602
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
603
|
+
)
|
604
|
+
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):
|
605
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
606
|
+
else:
|
607
|
+
cred = credential.Credential(
|
608
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
609
|
+
)
|
610
|
+
http_profile = HttpProfile(
|
611
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
612
|
+
reqMethod="POST",
|
613
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
614
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
615
|
+
)
|
616
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
617
|
+
if g_param[OptionsDefine.Language]:
|
618
|
+
profile.language = g_param[OptionsDefine.Language]
|
619
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
620
|
+
client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
|
621
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
622
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
623
|
+
model = models.DescribeRedisTopKeyPrefixListRequest()
|
624
|
+
model.from_json_string(json.dumps(args))
|
625
|
+
start_time = time.time()
|
626
|
+
while True:
|
627
|
+
rsp = client.DescribeRedisTopKeyPrefixList(model)
|
628
|
+
result = rsp.to_json_string()
|
629
|
+
try:
|
630
|
+
json_obj = json.loads(result)
|
631
|
+
except TypeError as e:
|
632
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
633
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
634
|
+
break
|
635
|
+
cur_time = time.time()
|
636
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
637
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
638
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
639
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
640
|
+
else:
|
641
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
642
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
643
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
644
|
+
|
645
|
+
|
542
646
|
def doDescribeAuditLogFiles(args, parsed_globals):
|
543
647
|
g_param = parse_global_arg(parsed_globals)
|
544
648
|
|
@@ -1579,6 +1683,58 @@ def doCloseAuditService(args, parsed_globals):
|
|
1579
1683
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1580
1684
|
|
1581
1685
|
|
1686
|
+
def doCancelRedisBigKeyAnalysisTasks(args, parsed_globals):
|
1687
|
+
g_param = parse_global_arg(parsed_globals)
|
1688
|
+
|
1689
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1690
|
+
cred = credential.CVMRoleCredential()
|
1691
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1692
|
+
cred = credential.STSAssumeRoleCredential(
|
1693
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1694
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1695
|
+
)
|
1696
|
+
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):
|
1697
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1698
|
+
else:
|
1699
|
+
cred = credential.Credential(
|
1700
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1701
|
+
)
|
1702
|
+
http_profile = HttpProfile(
|
1703
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1704
|
+
reqMethod="POST",
|
1705
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1706
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1707
|
+
)
|
1708
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1709
|
+
if g_param[OptionsDefine.Language]:
|
1710
|
+
profile.language = g_param[OptionsDefine.Language]
|
1711
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1712
|
+
client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
|
1713
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1714
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1715
|
+
model = models.CancelRedisBigKeyAnalysisTasksRequest()
|
1716
|
+
model.from_json_string(json.dumps(args))
|
1717
|
+
start_time = time.time()
|
1718
|
+
while True:
|
1719
|
+
rsp = client.CancelRedisBigKeyAnalysisTasks(model)
|
1720
|
+
result = rsp.to_json_string()
|
1721
|
+
try:
|
1722
|
+
json_obj = json.loads(result)
|
1723
|
+
except TypeError as e:
|
1724
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1725
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1726
|
+
break
|
1727
|
+
cur_time = time.time()
|
1728
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1729
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1730
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1731
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1732
|
+
else:
|
1733
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1734
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1735
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1736
|
+
|
1737
|
+
|
1582
1738
|
def doDeleteSecurityAuditLogExportTasks(args, parsed_globals):
|
1583
1739
|
g_param = parse_global_arg(parsed_globals)
|
1584
1740
|
|
@@ -1631,7 +1787,7 @@ def doDeleteSecurityAuditLogExportTasks(args, parsed_globals):
|
|
1631
1787
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1632
1788
|
|
1633
1789
|
|
1634
|
-
def
|
1790
|
+
def doDescribeDBAutonomyActions(args, parsed_globals):
|
1635
1791
|
g_param = parse_global_arg(parsed_globals)
|
1636
1792
|
|
1637
1793
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1660,11 +1816,11 @@ def doModifySqlFilters(args, parsed_globals):
|
|
1660
1816
|
client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
|
1661
1817
|
client._sdkVersion += ("_CLI_" + __version__)
|
1662
1818
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1663
|
-
model = models.
|
1819
|
+
model = models.DescribeDBAutonomyActionsRequest()
|
1664
1820
|
model.from_json_string(json.dumps(args))
|
1665
1821
|
start_time = time.time()
|
1666
1822
|
while True:
|
1667
|
-
rsp = client.
|
1823
|
+
rsp = client.DescribeDBAutonomyActions(model)
|
1668
1824
|
result = rsp.to_json_string()
|
1669
1825
|
try:
|
1670
1826
|
json_obj = json.loads(result)
|
@@ -2047,6 +2203,58 @@ def doDescribeSlowLogs(args, parsed_globals):
|
|
2047
2203
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2048
2204
|
|
2049
2205
|
|
2206
|
+
def doDescribeUserAutonomyProfile(args, parsed_globals):
|
2207
|
+
g_param = parse_global_arg(parsed_globals)
|
2208
|
+
|
2209
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2210
|
+
cred = credential.CVMRoleCredential()
|
2211
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2212
|
+
cred = credential.STSAssumeRoleCredential(
|
2213
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2214
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2215
|
+
)
|
2216
|
+
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):
|
2217
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2218
|
+
else:
|
2219
|
+
cred = credential.Credential(
|
2220
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2221
|
+
)
|
2222
|
+
http_profile = HttpProfile(
|
2223
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2224
|
+
reqMethod="POST",
|
2225
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2226
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2227
|
+
)
|
2228
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2229
|
+
if g_param[OptionsDefine.Language]:
|
2230
|
+
profile.language = g_param[OptionsDefine.Language]
|
2231
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2232
|
+
client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
|
2233
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2234
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2235
|
+
model = models.DescribeUserAutonomyProfileRequest()
|
2236
|
+
model.from_json_string(json.dumps(args))
|
2237
|
+
start_time = time.time()
|
2238
|
+
while True:
|
2239
|
+
rsp = client.DescribeUserAutonomyProfile(model)
|
2240
|
+
result = rsp.to_json_string()
|
2241
|
+
try:
|
2242
|
+
json_obj = json.loads(result)
|
2243
|
+
except TypeError as e:
|
2244
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2245
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2246
|
+
break
|
2247
|
+
cur_time = time.time()
|
2248
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2249
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2250
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2251
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2252
|
+
else:
|
2253
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2254
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2255
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2256
|
+
|
2257
|
+
|
2050
2258
|
def doDescribeDBDiagEvent(args, parsed_globals):
|
2051
2259
|
g_param = parse_global_arg(parsed_globals)
|
2052
2260
|
|
@@ -2151,7 +2359,7 @@ def doDescribeDBDiagHistory(args, parsed_globals):
|
|
2151
2359
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2152
2360
|
|
2153
2361
|
|
2154
|
-
def
|
2362
|
+
def doDescribeProxyProcessStatistics(args, parsed_globals):
|
2155
2363
|
g_param = parse_global_arg(parsed_globals)
|
2156
2364
|
|
2157
2365
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2180,11 +2388,11 @@ def doDescribeRedisTopKeyPrefixList(args, parsed_globals):
|
|
2180
2388
|
client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
|
2181
2389
|
client._sdkVersion += ("_CLI_" + __version__)
|
2182
2390
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2183
|
-
model = models.
|
2391
|
+
model = models.DescribeProxyProcessStatisticsRequest()
|
2184
2392
|
model.from_json_string(json.dumps(args))
|
2185
2393
|
start_time = time.time()
|
2186
2394
|
while True:
|
2187
|
-
rsp = client.
|
2395
|
+
rsp = client.DescribeProxyProcessStatistics(model)
|
2188
2396
|
result = rsp.to_json_string()
|
2189
2397
|
try:
|
2190
2398
|
json_obj = json.loads(result)
|
@@ -2463,6 +2671,58 @@ def doDescribeDiagDBInstances(args, parsed_globals):
|
|
2463
2671
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2464
2672
|
|
2465
2673
|
|
2674
|
+
def doCreateUserAutonomyProfile(args, parsed_globals):
|
2675
|
+
g_param = parse_global_arg(parsed_globals)
|
2676
|
+
|
2677
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2678
|
+
cred = credential.CVMRoleCredential()
|
2679
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2680
|
+
cred = credential.STSAssumeRoleCredential(
|
2681
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2682
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2683
|
+
)
|
2684
|
+
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):
|
2685
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2686
|
+
else:
|
2687
|
+
cred = credential.Credential(
|
2688
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2689
|
+
)
|
2690
|
+
http_profile = HttpProfile(
|
2691
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2692
|
+
reqMethod="POST",
|
2693
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2694
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2695
|
+
)
|
2696
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2697
|
+
if g_param[OptionsDefine.Language]:
|
2698
|
+
profile.language = g_param[OptionsDefine.Language]
|
2699
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2700
|
+
client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
|
2701
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2702
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2703
|
+
model = models.CreateUserAutonomyProfileRequest()
|
2704
|
+
model.from_json_string(json.dumps(args))
|
2705
|
+
start_time = time.time()
|
2706
|
+
while True:
|
2707
|
+
rsp = client.CreateUserAutonomyProfile(model)
|
2708
|
+
result = rsp.to_json_string()
|
2709
|
+
try:
|
2710
|
+
json_obj = json.loads(result)
|
2711
|
+
except TypeError as e:
|
2712
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2713
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2714
|
+
break
|
2715
|
+
cur_time = time.time()
|
2716
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2717
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2718
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2719
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2720
|
+
else:
|
2721
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2722
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2723
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2724
|
+
|
2725
|
+
|
2466
2726
|
def doAddUserContact(args, parsed_globals):
|
2467
2727
|
g_param = parse_global_arg(parsed_globals)
|
2468
2728
|
|
@@ -2671,7 +2931,7 @@ def doModifyDiagDBInstanceConf(args, parsed_globals):
|
|
2671
2931
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2672
2932
|
|
2673
2933
|
|
2674
|
-
def
|
2934
|
+
def doCancelDBAutonomyAction(args, parsed_globals):
|
2675
2935
|
g_param = parse_global_arg(parsed_globals)
|
2676
2936
|
|
2677
2937
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2700,11 +2960,11 @@ def doDescribeProxyProcessStatistics(args, parsed_globals):
|
|
2700
2960
|
client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
|
2701
2961
|
client._sdkVersion += ("_CLI_" + __version__)
|
2702
2962
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2703
|
-
model = models.
|
2963
|
+
model = models.CancelDBAutonomyActionRequest()
|
2704
2964
|
model.from_json_string(json.dumps(args))
|
2705
2965
|
start_time = time.time()
|
2706
2966
|
while True:
|
2707
|
-
rsp = client.
|
2967
|
+
rsp = client.CancelDBAutonomyAction(model)
|
2708
2968
|
result = rsp.to_json_string()
|
2709
2969
|
try:
|
2710
2970
|
json_obj = json.loads(result)
|
@@ -3295,6 +3555,58 @@ def doCreateDBDiagReportUrl(args, parsed_globals):
|
|
3295
3555
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3296
3556
|
|
3297
3557
|
|
3558
|
+
def doModifySqlFilters(args, parsed_globals):
|
3559
|
+
g_param = parse_global_arg(parsed_globals)
|
3560
|
+
|
3561
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3562
|
+
cred = credential.CVMRoleCredential()
|
3563
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3564
|
+
cred = credential.STSAssumeRoleCredential(
|
3565
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3566
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3567
|
+
)
|
3568
|
+
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):
|
3569
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3570
|
+
else:
|
3571
|
+
cred = credential.Credential(
|
3572
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3573
|
+
)
|
3574
|
+
http_profile = HttpProfile(
|
3575
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3576
|
+
reqMethod="POST",
|
3577
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3578
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3579
|
+
)
|
3580
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3581
|
+
if g_param[OptionsDefine.Language]:
|
3582
|
+
profile.language = g_param[OptionsDefine.Language]
|
3583
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3584
|
+
client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
|
3585
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3586
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3587
|
+
model = models.ModifySqlFiltersRequest()
|
3588
|
+
model.from_json_string(json.dumps(args))
|
3589
|
+
start_time = time.time()
|
3590
|
+
while True:
|
3591
|
+
rsp = client.ModifySqlFilters(model)
|
3592
|
+
result = rsp.to_json_string()
|
3593
|
+
try:
|
3594
|
+
json_obj = json.loads(result)
|
3595
|
+
except TypeError as e:
|
3596
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3597
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3598
|
+
break
|
3599
|
+
cur_time = time.time()
|
3600
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3601
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3602
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3603
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3604
|
+
else:
|
3605
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3606
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3607
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3608
|
+
|
3609
|
+
|
3298
3610
|
def doDescribeProxySessionKillTasks(args, parsed_globals):
|
3299
3611
|
g_param = parse_global_arg(parsed_globals)
|
3300
3612
|
|
@@ -3347,6 +3659,58 @@ def doDescribeProxySessionKillTasks(args, parsed_globals):
|
|
3347
3659
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3348
3660
|
|
3349
3661
|
|
3662
|
+
def doModifyUserAutonomyProfile(args, parsed_globals):
|
3663
|
+
g_param = parse_global_arg(parsed_globals)
|
3664
|
+
|
3665
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3666
|
+
cred = credential.CVMRoleCredential()
|
3667
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3668
|
+
cred = credential.STSAssumeRoleCredential(
|
3669
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3670
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3671
|
+
)
|
3672
|
+
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):
|
3673
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3674
|
+
else:
|
3675
|
+
cred = credential.Credential(
|
3676
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3677
|
+
)
|
3678
|
+
http_profile = HttpProfile(
|
3679
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3680
|
+
reqMethod="POST",
|
3681
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3682
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3683
|
+
)
|
3684
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3685
|
+
if g_param[OptionsDefine.Language]:
|
3686
|
+
profile.language = g_param[OptionsDefine.Language]
|
3687
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3688
|
+
client = mod.DbbrainClient(cred, g_param[OptionsDefine.Region], profile)
|
3689
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3690
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3691
|
+
model = models.ModifyUserAutonomyProfileRequest()
|
3692
|
+
model.from_json_string(json.dumps(args))
|
3693
|
+
start_time = time.time()
|
3694
|
+
while True:
|
3695
|
+
rsp = client.ModifyUserAutonomyProfile(model)
|
3696
|
+
result = rsp.to_json_string()
|
3697
|
+
try:
|
3698
|
+
json_obj = json.loads(result)
|
3699
|
+
except TypeError as e:
|
3700
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3701
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3702
|
+
break
|
3703
|
+
cur_time = time.time()
|
3704
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3705
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3706
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3707
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3708
|
+
else:
|
3709
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3710
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3711
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3712
|
+
|
3713
|
+
|
3350
3714
|
CLIENT_MAP = {
|
3351
3715
|
"v20210527": dbbrain_client_v20210527,
|
3352
3716
|
"v20191016": dbbrain_client_v20191016,
|
@@ -3360,6 +3724,7 @@ MODELS_MAP = {
|
|
3360
3724
|
}
|
3361
3725
|
|
3362
3726
|
ACTION_MAP = {
|
3727
|
+
"DescribeDBAutonomyEvents": doDescribeDBAutonomyEvents,
|
3363
3728
|
"DescribeSecurityAuditLogDownloadUrls": doDescribeSecurityAuditLogDownloadUrls,
|
3364
3729
|
"DeleteDBDiagReportTasks": doDeleteDBDiagReportTasks,
|
3365
3730
|
"DescribeMailProfile": doDescribeMailProfile,
|
@@ -3370,6 +3735,7 @@ ACTION_MAP = {
|
|
3370
3735
|
"DescribeMySqlProcessList": doDescribeMySqlProcessList,
|
3371
3736
|
"CreateMailProfile": doCreateMailProfile,
|
3372
3737
|
"DescribeDBDiagReportTasks": doDescribeDBDiagReportTasks,
|
3738
|
+
"DescribeRedisTopKeyPrefixList": doDescribeRedisTopKeyPrefixList,
|
3373
3739
|
"DescribeAuditLogFiles": doDescribeAuditLogFiles,
|
3374
3740
|
"CreateRedisBigKeyAnalysisTask": doCreateRedisBigKeyAnalysisTask,
|
3375
3741
|
"ModifyAlarmPolicy": doModifyAlarmPolicy,
|
@@ -3390,8 +3756,9 @@ ACTION_MAP = {
|
|
3390
3756
|
"DescribeRedisTopHotKeys": doDescribeRedisTopHotKeys,
|
3391
3757
|
"CreateSecurityAuditLogExportTask": doCreateSecurityAuditLogExportTask,
|
3392
3758
|
"CloseAuditService": doCloseAuditService,
|
3759
|
+
"CancelRedisBigKeyAnalysisTasks": doCancelRedisBigKeyAnalysisTasks,
|
3393
3760
|
"DeleteSecurityAuditLogExportTasks": doDeleteSecurityAuditLogExportTasks,
|
3394
|
-
"
|
3761
|
+
"DescribeDBAutonomyActions": doDescribeDBAutonomyActions,
|
3395
3762
|
"ModifyAuditService": doModifyAuditService,
|
3396
3763
|
"CreateAuditLogFile": doCreateAuditLogFile,
|
3397
3764
|
"DescribeSlowLogTopSqls": doDescribeSlowLogTopSqls,
|
@@ -3399,19 +3766,21 @@ ACTION_MAP = {
|
|
3399
3766
|
"DescribeAllUserContact": doDescribeAllUserContact,
|
3400
3767
|
"DescribeRedisBigKeyAnalysisTasks": doDescribeRedisBigKeyAnalysisTasks,
|
3401
3768
|
"DescribeSlowLogs": doDescribeSlowLogs,
|
3769
|
+
"DescribeUserAutonomyProfile": doDescribeUserAutonomyProfile,
|
3402
3770
|
"DescribeDBDiagEvent": doDescribeDBDiagEvent,
|
3403
3771
|
"DescribeDBDiagHistory": doDescribeDBDiagHistory,
|
3404
|
-
"
|
3772
|
+
"DescribeProxyProcessStatistics": doDescribeProxyProcessStatistics,
|
3405
3773
|
"DescribeSlowLogTimeSeriesStats": doDescribeSlowLogTimeSeriesStats,
|
3406
3774
|
"DescribeTopSpaceSchemaTimeSeries": doDescribeTopSpaceSchemaTimeSeries,
|
3407
3775
|
"DeleteSqlFilters": doDeleteSqlFilters,
|
3408
3776
|
"CancelKillTask": doCancelKillTask,
|
3409
3777
|
"DescribeDiagDBInstances": doDescribeDiagDBInstances,
|
3778
|
+
"CreateUserAutonomyProfile": doCreateUserAutonomyProfile,
|
3410
3779
|
"AddUserContact": doAddUserContact,
|
3411
3780
|
"DescribeIndexRecommendInfo": doDescribeIndexRecommendInfo,
|
3412
3781
|
"DescribeIndexRecommendAggregationSlowLogs": doDescribeIndexRecommendAggregationSlowLogs,
|
3413
3782
|
"ModifyDiagDBInstanceConf": doModifyDiagDBInstanceConf,
|
3414
|
-
"
|
3783
|
+
"CancelDBAutonomyAction": doCancelDBAutonomyAction,
|
3415
3784
|
"CreateKillTask": doCreateKillTask,
|
3416
3785
|
"UpdateAgentSwitch": doUpdateAgentSwitch,
|
3417
3786
|
"UpdateMonitorSwitch": doUpdateMonitorSwitch,
|
@@ -3423,7 +3792,9 @@ ACTION_MAP = {
|
|
3423
3792
|
"DescribeRedisTopBigKeys": doDescribeRedisTopBigKeys,
|
3424
3793
|
"VerifyUserAccount": doVerifyUserAccount,
|
3425
3794
|
"CreateDBDiagReportUrl": doCreateDBDiagReportUrl,
|
3795
|
+
"ModifySqlFilters": doModifySqlFilters,
|
3426
3796
|
"DescribeProxySessionKillTasks": doDescribeProxySessionKillTasks,
|
3797
|
+
"ModifyUserAutonomyProfile": doModifyUserAutonomyProfile,
|
3427
3798
|
|
3428
3799
|
}
|
3429
3800
|
|