tccli 3.0.1239.1__py2.py3-none-any.whl → 3.0.1240.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/csip/csip_client.py +281 -16
- tccli/services/csip/v20221121/api.json +1631 -101
- tccli/services/csip/v20221121/examples.json +40 -0
- tccli/services/ess/v20201111/api.json +2 -2
- tccli/services/ess/v20201111/examples.json +12 -0
- tccli/services/sms/v20190711/api.json +81 -81
- tccli/services/sms/v20190711/examples.json +8 -8
- tccli/services/sms/v20210111/api.json +39 -39
- {tccli-3.0.1239.1.dist-info → tccli-3.0.1240.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1239.1.dist-info → tccli-3.0.1240.1.dist-info}/RECORD +14 -14
- {tccli-3.0.1239.1.dist-info → tccli-3.0.1240.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1239.1.dist-info → tccli-3.0.1240.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1239.1.dist-info → tccli-3.0.1240.1.dist-info}/license_files/LICENSE +0 -0
tccli/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '3.0.
|
1
|
+
__version__ = '3.0.1240.1'
|
@@ -17,6 +17,58 @@ from tencentcloud.csip.v20221121 import models as models_v20221121
|
|
17
17
|
from jmespath import search
|
18
18
|
import time
|
19
19
|
|
20
|
+
def doDescribeUebaRule(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.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
47
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
48
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
+
model = models.DescribeUebaRuleRequest()
|
50
|
+
model.from_json_string(json.dumps(args))
|
51
|
+
start_time = time.time()
|
52
|
+
while True:
|
53
|
+
rsp = client.DescribeUebaRule(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 doDeleteDomainAndIp(args, parsed_globals):
|
21
73
|
g_param = parse_global_arg(parsed_globals)
|
22
74
|
|
@@ -589,7 +641,7 @@ def doDeleteRiskScanTask(args, parsed_globals):
|
|
589
641
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
590
642
|
|
591
643
|
|
592
|
-
def
|
644
|
+
def doDescribeTaskLogList(args, parsed_globals):
|
593
645
|
g_param = parse_global_arg(parsed_globals)
|
594
646
|
|
595
647
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -618,11 +670,11 @@ def doDescribeRiskCenterAssetViewWeakPasswordRiskList(args, parsed_globals):
|
|
618
670
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
619
671
|
client._sdkVersion += ("_CLI_" + __version__)
|
620
672
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
621
|
-
model = models.
|
673
|
+
model = models.DescribeTaskLogListRequest()
|
622
674
|
model.from_json_string(json.dumps(args))
|
623
675
|
start_time = time.time()
|
624
676
|
while True:
|
625
|
-
rsp = client.
|
677
|
+
rsp = client.DescribeTaskLogList(model)
|
626
678
|
result = rsp.to_json_string()
|
627
679
|
try:
|
628
680
|
json_obj = json.loads(result)
|
@@ -1005,6 +1057,58 @@ def doModifyRiskCenterScanTask(args, parsed_globals):
|
|
1005
1057
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1006
1058
|
|
1007
1059
|
|
1060
|
+
def doDescribeOrganizationInfo(args, parsed_globals):
|
1061
|
+
g_param = parse_global_arg(parsed_globals)
|
1062
|
+
|
1063
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1064
|
+
cred = credential.CVMRoleCredential()
|
1065
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1066
|
+
cred = credential.STSAssumeRoleCredential(
|
1067
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1068
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1069
|
+
)
|
1070
|
+
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):
|
1071
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1072
|
+
else:
|
1073
|
+
cred = credential.Credential(
|
1074
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1075
|
+
)
|
1076
|
+
http_profile = HttpProfile(
|
1077
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1078
|
+
reqMethod="POST",
|
1079
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1080
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1081
|
+
)
|
1082
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1083
|
+
if g_param[OptionsDefine.Language]:
|
1084
|
+
profile.language = g_param[OptionsDefine.Language]
|
1085
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1086
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1087
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1088
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1089
|
+
model = models.DescribeOrganizationInfoRequest()
|
1090
|
+
model.from_json_string(json.dumps(args))
|
1091
|
+
start_time = time.time()
|
1092
|
+
while True:
|
1093
|
+
rsp = client.DescribeOrganizationInfo(model)
|
1094
|
+
result = rsp.to_json_string()
|
1095
|
+
try:
|
1096
|
+
json_obj = json.loads(result)
|
1097
|
+
except TypeError as e:
|
1098
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1099
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1100
|
+
break
|
1101
|
+
cur_time = time.time()
|
1102
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1103
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1104
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1105
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1106
|
+
else:
|
1107
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1108
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1109
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1110
|
+
|
1111
|
+
|
1008
1112
|
def doDescribeAssetViewVulRiskList(args, parsed_globals):
|
1009
1113
|
g_param = parse_global_arg(parsed_globals)
|
1010
1114
|
|
@@ -1265,6 +1369,58 @@ def doStopRiskCenterTask(args, parsed_globals):
|
|
1265
1369
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1266
1370
|
|
1267
1371
|
|
1372
|
+
def doModifyUebaRuleSwitch(args, parsed_globals):
|
1373
|
+
g_param = parse_global_arg(parsed_globals)
|
1374
|
+
|
1375
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1376
|
+
cred = credential.CVMRoleCredential()
|
1377
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1378
|
+
cred = credential.STSAssumeRoleCredential(
|
1379
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1380
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1381
|
+
)
|
1382
|
+
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):
|
1383
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1384
|
+
else:
|
1385
|
+
cred = credential.Credential(
|
1386
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1387
|
+
)
|
1388
|
+
http_profile = HttpProfile(
|
1389
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1390
|
+
reqMethod="POST",
|
1391
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1392
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1393
|
+
)
|
1394
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1395
|
+
if g_param[OptionsDefine.Language]:
|
1396
|
+
profile.language = g_param[OptionsDefine.Language]
|
1397
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1398
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1399
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1400
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1401
|
+
model = models.ModifyUebaRuleSwitchRequest()
|
1402
|
+
model.from_json_string(json.dumps(args))
|
1403
|
+
start_time = time.time()
|
1404
|
+
while True:
|
1405
|
+
rsp = client.ModifyUebaRuleSwitch(model)
|
1406
|
+
result = rsp.to_json_string()
|
1407
|
+
try:
|
1408
|
+
json_obj = json.loads(result)
|
1409
|
+
except TypeError as e:
|
1410
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1411
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1412
|
+
break
|
1413
|
+
cur_time = time.time()
|
1414
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1415
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1416
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1417
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1418
|
+
else:
|
1419
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1420
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1421
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1422
|
+
|
1423
|
+
|
1268
1424
|
def doCreateRiskCenterScanTask(args, parsed_globals):
|
1269
1425
|
g_param = parse_global_arg(parsed_globals)
|
1270
1426
|
|
@@ -1421,7 +1577,7 @@ def doDescribeSearchBugInfo(args, parsed_globals):
|
|
1421
1577
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1422
1578
|
|
1423
1579
|
|
1424
|
-
def
|
1580
|
+
def doDescribeRiskCenterAssetViewWeakPasswordRiskList(args, parsed_globals):
|
1425
1581
|
g_param = parse_global_arg(parsed_globals)
|
1426
1582
|
|
1427
1583
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1450,11 +1606,11 @@ def doDescribeTaskLogList(args, parsed_globals):
|
|
1450
1606
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1451
1607
|
client._sdkVersion += ("_CLI_" + __version__)
|
1452
1608
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1453
|
-
model = models.
|
1609
|
+
model = models.DescribeRiskCenterAssetViewWeakPasswordRiskListRequest()
|
1454
1610
|
model.from_json_string(json.dumps(args))
|
1455
1611
|
start_time = time.time()
|
1456
1612
|
while True:
|
1457
|
-
rsp = client.
|
1613
|
+
rsp = client.DescribeRiskCenterAssetViewWeakPasswordRiskList(model)
|
1458
1614
|
result = rsp.to_json_string()
|
1459
1615
|
try:
|
1460
1616
|
json_obj = json.loads(result)
|
@@ -1577,7 +1733,7 @@ def doDescribeScanReportList(args, parsed_globals):
|
|
1577
1733
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1578
1734
|
|
1579
1735
|
|
1580
|
-
def
|
1736
|
+
def doDescribeSubUserInfo(args, parsed_globals):
|
1581
1737
|
g_param = parse_global_arg(parsed_globals)
|
1582
1738
|
|
1583
1739
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1606,11 +1762,11 @@ def doCreateDomainAndIp(args, parsed_globals):
|
|
1606
1762
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1607
1763
|
client._sdkVersion += ("_CLI_" + __version__)
|
1608
1764
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1609
|
-
model = models.
|
1765
|
+
model = models.DescribeSubUserInfoRequest()
|
1610
1766
|
model.from_json_string(json.dumps(args))
|
1611
1767
|
start_time = time.time()
|
1612
1768
|
while True:
|
1613
|
-
rsp = client.
|
1769
|
+
rsp = client.DescribeSubUserInfo(model)
|
1614
1770
|
result = rsp.to_json_string()
|
1615
1771
|
try:
|
1616
1772
|
json_obj = json.loads(result)
|
@@ -1681,6 +1837,58 @@ def doDescribeAlertList(args, parsed_globals):
|
|
1681
1837
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1682
1838
|
|
1683
1839
|
|
1840
|
+
def doModifyRiskCenterRiskStatus(args, parsed_globals):
|
1841
|
+
g_param = parse_global_arg(parsed_globals)
|
1842
|
+
|
1843
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1844
|
+
cred = credential.CVMRoleCredential()
|
1845
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1846
|
+
cred = credential.STSAssumeRoleCredential(
|
1847
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1848
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1849
|
+
)
|
1850
|
+
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):
|
1851
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1852
|
+
else:
|
1853
|
+
cred = credential.Credential(
|
1854
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1855
|
+
)
|
1856
|
+
http_profile = HttpProfile(
|
1857
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1858
|
+
reqMethod="POST",
|
1859
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1860
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1861
|
+
)
|
1862
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1863
|
+
if g_param[OptionsDefine.Language]:
|
1864
|
+
profile.language = g_param[OptionsDefine.Language]
|
1865
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1866
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1867
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1868
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1869
|
+
model = models.ModifyRiskCenterRiskStatusRequest()
|
1870
|
+
model.from_json_string(json.dumps(args))
|
1871
|
+
start_time = time.time()
|
1872
|
+
while True:
|
1873
|
+
rsp = client.ModifyRiskCenterRiskStatus(model)
|
1874
|
+
result = rsp.to_json_string()
|
1875
|
+
try:
|
1876
|
+
json_obj = json.loads(result)
|
1877
|
+
except TypeError as e:
|
1878
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1879
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1880
|
+
break
|
1881
|
+
cur_time = time.time()
|
1882
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1883
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1884
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1885
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1886
|
+
else:
|
1887
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1888
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1889
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1890
|
+
|
1891
|
+
|
1684
1892
|
def doUpdateAlertStatusList(args, parsed_globals):
|
1685
1893
|
g_param = parse_global_arg(parsed_globals)
|
1686
1894
|
|
@@ -1993,7 +2201,7 @@ def doDescribeVULRiskAdvanceCFGList(args, parsed_globals):
|
|
1993
2201
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1994
2202
|
|
1995
2203
|
|
1996
|
-
def
|
2204
|
+
def doCreateDomainAndIp(args, parsed_globals):
|
1997
2205
|
g_param = parse_global_arg(parsed_globals)
|
1998
2206
|
|
1999
2207
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2022,11 +2230,11 @@ def doModifyRiskCenterRiskStatus(args, parsed_globals):
|
|
2022
2230
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2023
2231
|
client._sdkVersion += ("_CLI_" + __version__)
|
2024
2232
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2025
|
-
model = models.
|
2233
|
+
model = models.CreateDomainAndIpRequest()
|
2026
2234
|
model.from_json_string(json.dumps(args))
|
2027
2235
|
start_time = time.time()
|
2028
2236
|
while True:
|
2029
|
-
rsp = client.
|
2237
|
+
rsp = client.CreateDomainAndIp(model)
|
2030
2238
|
result = rsp.to_json_string()
|
2031
2239
|
try:
|
2032
2240
|
json_obj = json.loads(result)
|
@@ -2149,6 +2357,58 @@ def doDescribeTopAttackInfo(args, parsed_globals):
|
|
2149
2357
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2150
2358
|
|
2151
2359
|
|
2360
|
+
def doDescribeClusterAssets(args, parsed_globals):
|
2361
|
+
g_param = parse_global_arg(parsed_globals)
|
2362
|
+
|
2363
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2364
|
+
cred = credential.CVMRoleCredential()
|
2365
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2366
|
+
cred = credential.STSAssumeRoleCredential(
|
2367
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2368
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2369
|
+
)
|
2370
|
+
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):
|
2371
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2372
|
+
else:
|
2373
|
+
cred = credential.Credential(
|
2374
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2375
|
+
)
|
2376
|
+
http_profile = HttpProfile(
|
2377
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2378
|
+
reqMethod="POST",
|
2379
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2380
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2381
|
+
)
|
2382
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2383
|
+
if g_param[OptionsDefine.Language]:
|
2384
|
+
profile.language = g_param[OptionsDefine.Language]
|
2385
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2386
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2387
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2388
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2389
|
+
model = models.DescribeClusterAssetsRequest()
|
2390
|
+
model.from_json_string(json.dumps(args))
|
2391
|
+
start_time = time.time()
|
2392
|
+
while True:
|
2393
|
+
rsp = client.DescribeClusterAssets(model)
|
2394
|
+
result = rsp.to_json_string()
|
2395
|
+
try:
|
2396
|
+
json_obj = json.loads(result)
|
2397
|
+
except TypeError as e:
|
2398
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2399
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2400
|
+
break
|
2401
|
+
cur_time = time.time()
|
2402
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2403
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2404
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2405
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2406
|
+
else:
|
2407
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2408
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2409
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2410
|
+
|
2411
|
+
|
2152
2412
|
def doDescribeTaskLogURL(args, parsed_globals):
|
2153
2413
|
g_param = parse_global_arg(parsed_globals)
|
2154
2414
|
|
@@ -2264,6 +2524,7 @@ MODELS_MAP = {
|
|
2264
2524
|
}
|
2265
2525
|
|
2266
2526
|
ACTION_MAP = {
|
2527
|
+
"DescribeUebaRule": doDescribeUebaRule,
|
2267
2528
|
"DeleteDomainAndIp": doDeleteDomainAndIp,
|
2268
2529
|
"DescribeDbAssetInfo": doDescribeDbAssetInfo,
|
2269
2530
|
"DescribeNICAssets": doDescribeNICAssets,
|
@@ -2275,7 +2536,7 @@ ACTION_MAP = {
|
|
2275
2536
|
"DescribeListenerList": doDescribeListenerList,
|
2276
2537
|
"DescribeOrganizationUserInfo": doDescribeOrganizationUserInfo,
|
2277
2538
|
"DeleteRiskScanTask": doDeleteRiskScanTask,
|
2278
|
-
"
|
2539
|
+
"DescribeTaskLogList": doDescribeTaskLogList,
|
2279
2540
|
"DescribeRiskCenterAssetViewVULRiskList": doDescribeRiskCenterAssetViewVULRiskList,
|
2280
2541
|
"DescribeClusterPodAssets": doDescribeClusterPodAssets,
|
2281
2542
|
"DescribeRiskCenterAssetViewCFGRiskList": doDescribeRiskCenterAssetViewCFGRiskList,
|
@@ -2283,28 +2544,32 @@ ACTION_MAP = {
|
|
2283
2544
|
"DescribeRiskCenterServerRiskList": doDescribeRiskCenterServerRiskList,
|
2284
2545
|
"DescribeCVMAssets": doDescribeCVMAssets,
|
2285
2546
|
"ModifyRiskCenterScanTask": doModifyRiskCenterScanTask,
|
2547
|
+
"DescribeOrganizationInfo": doDescribeOrganizationInfo,
|
2286
2548
|
"DescribeAssetViewVulRiskList": doDescribeAssetViewVulRiskList,
|
2287
2549
|
"DescribeVULRiskDetail": doDescribeVULRiskDetail,
|
2288
2550
|
"DescribeRiskCenterWebsiteRiskList": doDescribeRiskCenterWebsiteRiskList,
|
2289
2551
|
"DescribeCFWAssetStatistics": doDescribeCFWAssetStatistics,
|
2290
2552
|
"StopRiskCenterTask": doStopRiskCenterTask,
|
2553
|
+
"ModifyUebaRuleSwitch": doModifyUebaRuleSwitch,
|
2291
2554
|
"CreateRiskCenterScanTask": doCreateRiskCenterScanTask,
|
2292
2555
|
"DescribeGatewayAssets": doDescribeGatewayAssets,
|
2293
2556
|
"DescribeSearchBugInfo": doDescribeSearchBugInfo,
|
2294
|
-
"
|
2557
|
+
"DescribeRiskCenterAssetViewWeakPasswordRiskList": doDescribeRiskCenterAssetViewWeakPasswordRiskList,
|
2295
2558
|
"DescribeVulViewVulRiskList": doDescribeVulViewVulRiskList,
|
2296
2559
|
"DescribeScanReportList": doDescribeScanReportList,
|
2297
|
-
"
|
2560
|
+
"DescribeSubUserInfo": doDescribeSubUserInfo,
|
2298
2561
|
"DescribeAlertList": doDescribeAlertList,
|
2562
|
+
"ModifyRiskCenterRiskStatus": doModifyRiskCenterRiskStatus,
|
2299
2563
|
"UpdateAlertStatusList": doUpdateAlertStatusList,
|
2300
2564
|
"DescribeScanTaskList": doDescribeScanTaskList,
|
2301
2565
|
"DescribeDbAssets": doDescribeDbAssets,
|
2302
2566
|
"DescribeRiskCenterPortViewPortRiskList": doDescribeRiskCenterPortViewPortRiskList,
|
2303
2567
|
"DescribeRiskCenterAssetViewPortRiskList": doDescribeRiskCenterAssetViewPortRiskList,
|
2304
2568
|
"DescribeVULRiskAdvanceCFGList": doDescribeVULRiskAdvanceCFGList,
|
2305
|
-
"
|
2569
|
+
"CreateDomainAndIp": doCreateDomainAndIp,
|
2306
2570
|
"ModifyOrganizationAccountStatus": doModifyOrganizationAccountStatus,
|
2307
2571
|
"DescribeTopAttackInfo": doDescribeTopAttackInfo,
|
2572
|
+
"DescribeClusterAssets": doDescribeClusterAssets,
|
2308
2573
|
"DescribeTaskLogURL": doDescribeTaskLogURL,
|
2309
2574
|
"DescribeCVMAssetInfo": doDescribeCVMAssetInfo,
|
2310
2575
|
|