tccli 3.0.1338.1__py2.py3-none-any.whl → 3.0.1339.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/apm/v20210622/api.json +10 -0
- tccli/services/ccc/v20200210/api.json +100 -1
- tccli/services/cdb/v20170320/api.json +37 -37
- tccli/services/cdb/v20170320/examples.json +7 -7
- tccli/services/cdn/v20180606/api.json +2 -2
- tccli/services/cfs/v20190719/api.json +9 -0
- tccli/services/cfw/v20190904/examples.json +12 -0
- tccli/services/ckafka/v20190819/api.json +19 -0
- tccli/services/cls/v20201016/api.json +1 -1
- tccli/services/csip/csip_client.py +791 -102
- tccli/services/csip/v20221121/api.json +6108 -3458
- tccli/services/csip/v20221121/examples.json +104 -0
- tccli/services/dts/v20211206/api.json +11 -0
- tccli/services/es/v20180416/api.json +55 -0
- tccli/services/ess/ess_client.py +53 -0
- tccli/services/ess/v20201111/api.json +115 -4
- tccli/services/ess/v20201111/examples.json +12 -4
- tccli/services/essbasic/essbasic_client.py +57 -4
- tccli/services/essbasic/v20210526/api.json +103 -3
- tccli/services/essbasic/v20210526/examples.json +9 -1
- tccli/services/gwlb/v20240906/api.json +1 -1
- tccli/services/gwlb/v20240906/examples.json +1 -1
- tccli/services/ioa/v20220601/api.json +55 -0
- tccli/services/ioa/v20220601/examples.json +1 -1
- tccli/services/iotexplorer/iotexplorer_client.py +57 -4
- tccli/services/iotexplorer/v20190423/api.json +145 -19
- tccli/services/iotexplorer/v20190423/examples.json +8 -0
- tccli/services/live/live_client.py +0 -106
- tccli/services/live/v20180801/api.json +14 -138
- tccli/services/live/v20180801/examples.json +0 -16
- tccli/services/lkeap/lkeap_client.py +0 -53
- tccli/services/lkeap/v20240522/api.json +0 -90
- tccli/services/lkeap/v20240522/examples.json +0 -8
- tccli/services/ocr/v20181119/api.json +21 -1
- tccli/services/ocr/v20181119/examples.json +1 -1
- tccli/services/ssl/ssl_client.py +212 -0
- tccli/services/ssl/v20191205/api.json +625 -10
- tccli/services/ssl/v20191205/examples.json +38 -0
- tccli/services/tcbr/v20220217/api.json +11 -0
- tccli/services/tdmq/v20200217/api.json +56 -47
- tccli/services/tdmq/v20200217/examples.json +8 -8
- tccli/services/trocket/v20230308/api.json +111 -92
- tccli/services/trocket/v20230308/examples.json +13 -13
- tccli/services/trtc/v20190722/api.json +3 -3
- tccli/services/tse/v20201207/api.json +19 -0
- tccli/services/tsf/v20180326/api.json +1 -1
- tccli/services/wedata/v20210820/api.json +607 -3
- tccli/services/wedata/v20210820/examples.json +18 -8
- tccli/services/wedata/wedata_client.py +106 -0
- {tccli-3.0.1338.1.dist-info → tccli-3.0.1339.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1338.1.dist-info → tccli-3.0.1339.1.dist-info}/RECORD +55 -55
- {tccli-3.0.1338.1.dist-info → tccli-3.0.1339.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1338.1.dist-info → tccli-3.0.1339.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1338.1.dist-info → tccli-3.0.1339.1.dist-info}/license_files/LICENSE +0 -0
@@ -121,6 +121,58 @@ def doDeleteDomainAndIp(args, parsed_globals):
|
|
121
121
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
122
|
|
123
123
|
|
124
|
+
def doDescribeRiskRuleDetail(args, parsed_globals):
|
125
|
+
g_param = parse_global_arg(parsed_globals)
|
126
|
+
|
127
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
128
|
+
cred = credential.CVMRoleCredential()
|
129
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
130
|
+
cred = credential.STSAssumeRoleCredential(
|
131
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
132
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
133
|
+
)
|
134
|
+
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):
|
135
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
136
|
+
else:
|
137
|
+
cred = credential.Credential(
|
138
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
139
|
+
)
|
140
|
+
http_profile = HttpProfile(
|
141
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
142
|
+
reqMethod="POST",
|
143
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
144
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
145
|
+
)
|
146
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
147
|
+
if g_param[OptionsDefine.Language]:
|
148
|
+
profile.language = g_param[OptionsDefine.Language]
|
149
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
150
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
151
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
152
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
+
model = models.DescribeRiskRuleDetailRequest()
|
154
|
+
model.from_json_string(json.dumps(args))
|
155
|
+
start_time = time.time()
|
156
|
+
while True:
|
157
|
+
rsp = client.DescribeRiskRuleDetail(model)
|
158
|
+
result = rsp.to_json_string()
|
159
|
+
try:
|
160
|
+
json_obj = json.loads(result)
|
161
|
+
except TypeError as e:
|
162
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
163
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
164
|
+
break
|
165
|
+
cur_time = time.time()
|
166
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
167
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
168
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
169
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
170
|
+
else:
|
171
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
172
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
173
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
174
|
+
|
175
|
+
|
124
176
|
def doDescribeDbAssetInfo(args, parsed_globals):
|
125
177
|
g_param = parse_global_arg(parsed_globals)
|
126
178
|
|
@@ -433,7 +485,7 @@ def doAddNewBindRoleUser(args, parsed_globals):
|
|
433
485
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
434
486
|
|
435
487
|
|
436
|
-
def
|
488
|
+
def doDescribeVULList(args, parsed_globals):
|
437
489
|
g_param = parse_global_arg(parsed_globals)
|
438
490
|
|
439
491
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -462,11 +514,63 @@ def doDescribeSubnetAssets(args, parsed_globals):
|
|
462
514
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
463
515
|
client._sdkVersion += ("_CLI_" + __version__)
|
464
516
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
465
|
-
model = models.
|
517
|
+
model = models.DescribeVULListRequest()
|
466
518
|
model.from_json_string(json.dumps(args))
|
467
519
|
start_time = time.time()
|
468
520
|
while True:
|
469
|
-
rsp = client.
|
521
|
+
rsp = client.DescribeVULList(model)
|
522
|
+
result = rsp.to_json_string()
|
523
|
+
try:
|
524
|
+
json_obj = json.loads(result)
|
525
|
+
except TypeError as e:
|
526
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
527
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
528
|
+
break
|
529
|
+
cur_time = time.time()
|
530
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
531
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
532
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
533
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
534
|
+
else:
|
535
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
536
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
537
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
538
|
+
|
539
|
+
|
540
|
+
def doDescribeOtherCloudAssets(args, parsed_globals):
|
541
|
+
g_param = parse_global_arg(parsed_globals)
|
542
|
+
|
543
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
544
|
+
cred = credential.CVMRoleCredential()
|
545
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
546
|
+
cred = credential.STSAssumeRoleCredential(
|
547
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
548
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
549
|
+
)
|
550
|
+
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):
|
551
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
552
|
+
else:
|
553
|
+
cred = credential.Credential(
|
554
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
555
|
+
)
|
556
|
+
http_profile = HttpProfile(
|
557
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
558
|
+
reqMethod="POST",
|
559
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
560
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
561
|
+
)
|
562
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
563
|
+
if g_param[OptionsDefine.Language]:
|
564
|
+
profile.language = g_param[OptionsDefine.Language]
|
565
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
566
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
567
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
568
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
569
|
+
model = models.DescribeOtherCloudAssetsRequest()
|
570
|
+
model.from_json_string(json.dumps(args))
|
571
|
+
start_time = time.time()
|
572
|
+
while True:
|
573
|
+
rsp = client.DescribeOtherCloudAssets(model)
|
470
574
|
result = rsp.to_json_string()
|
471
575
|
try:
|
472
576
|
json_obj = json.loads(result)
|
@@ -1057,7 +1161,7 @@ def doModifyRiskCenterScanTask(args, parsed_globals):
|
|
1057
1161
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1058
1162
|
|
1059
1163
|
|
1060
|
-
def
|
1164
|
+
def doDescribeCFWAssetStatistics(args, parsed_globals):
|
1061
1165
|
g_param = parse_global_arg(parsed_globals)
|
1062
1166
|
|
1063
1167
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1086,11 +1190,11 @@ def doDescribeOrganizationInfo(args, parsed_globals):
|
|
1086
1190
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1087
1191
|
client._sdkVersion += ("_CLI_" + __version__)
|
1088
1192
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1089
|
-
model = models.
|
1193
|
+
model = models.DescribeCFWAssetStatisticsRequest()
|
1090
1194
|
model.from_json_string(json.dumps(args))
|
1091
1195
|
start_time = time.time()
|
1092
1196
|
while True:
|
1093
|
-
rsp = client.
|
1197
|
+
rsp = client.DescribeCFWAssetStatistics(model)
|
1094
1198
|
result = rsp.to_json_string()
|
1095
1199
|
try:
|
1096
1200
|
json_obj = json.loads(result)
|
@@ -1213,7 +1317,7 @@ def doDescribeVULRiskDetail(args, parsed_globals):
|
|
1213
1317
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
1318
|
|
1215
1319
|
|
1216
|
-
def
|
1320
|
+
def doDescribeCheckViewRisks(args, parsed_globals):
|
1217
1321
|
g_param = parse_global_arg(parsed_globals)
|
1218
1322
|
|
1219
1323
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1242,11 +1346,11 @@ def doDescribeRiskCenterWebsiteRiskList(args, parsed_globals):
|
|
1242
1346
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1243
1347
|
client._sdkVersion += ("_CLI_" + __version__)
|
1244
1348
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1245
|
-
model = models.
|
1349
|
+
model = models.DescribeCheckViewRisksRequest()
|
1246
1350
|
model.from_json_string(json.dumps(args))
|
1247
1351
|
start_time = time.time()
|
1248
1352
|
while True:
|
1249
|
-
rsp = client.
|
1353
|
+
rsp = client.DescribeCheckViewRisks(model)
|
1250
1354
|
result = rsp.to_json_string()
|
1251
1355
|
try:
|
1252
1356
|
json_obj = json.loads(result)
|
@@ -1265,7 +1369,7 @@ def doDescribeRiskCenterWebsiteRiskList(args, parsed_globals):
|
|
1265
1369
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1266
1370
|
|
1267
1371
|
|
1268
|
-
def
|
1372
|
+
def doDescribeRiskCenterWebsiteRiskList(args, parsed_globals):
|
1269
1373
|
g_param = parse_global_arg(parsed_globals)
|
1270
1374
|
|
1271
1375
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1294,11 +1398,11 @@ def doDescribeCFWAssetStatistics(args, parsed_globals):
|
|
1294
1398
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1295
1399
|
client._sdkVersion += ("_CLI_" + __version__)
|
1296
1400
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1297
|
-
model = models.
|
1401
|
+
model = models.DescribeRiskCenterWebsiteRiskListRequest()
|
1298
1402
|
model.from_json_string(json.dumps(args))
|
1299
1403
|
start_time = time.time()
|
1300
1404
|
while True:
|
1301
|
-
rsp = client.
|
1405
|
+
rsp = client.DescribeRiskCenterWebsiteRiskList(model)
|
1302
1406
|
result = rsp.to_json_string()
|
1303
1407
|
try:
|
1304
1408
|
json_obj = json.loads(result)
|
@@ -1317,7 +1421,7 @@ def doDescribeCFWAssetStatistics(args, parsed_globals):
|
|
1317
1421
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1318
1422
|
|
1319
1423
|
|
1320
|
-
def
|
1424
|
+
def doDescribeOrganizationInfo(args, parsed_globals):
|
1321
1425
|
g_param = parse_global_arg(parsed_globals)
|
1322
1426
|
|
1323
1427
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1346,11 +1450,11 @@ def doStopRiskCenterTask(args, parsed_globals):
|
|
1346
1450
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1347
1451
|
client._sdkVersion += ("_CLI_" + __version__)
|
1348
1452
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1349
|
-
model = models.
|
1453
|
+
model = models.DescribeOrganizationInfoRequest()
|
1350
1454
|
model.from_json_string(json.dumps(args))
|
1351
1455
|
start_time = time.time()
|
1352
1456
|
while True:
|
1353
|
-
rsp = client.
|
1457
|
+
rsp = client.DescribeOrganizationInfo(model)
|
1354
1458
|
result = rsp.to_json_string()
|
1355
1459
|
try:
|
1356
1460
|
json_obj = json.loads(result)
|
@@ -1369,7 +1473,7 @@ def doStopRiskCenterTask(args, parsed_globals):
|
|
1369
1473
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1370
1474
|
|
1371
1475
|
|
1372
|
-
def
|
1476
|
+
def doStopRiskCenterTask(args, parsed_globals):
|
1373
1477
|
g_param = parse_global_arg(parsed_globals)
|
1374
1478
|
|
1375
1479
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1398,11 +1502,11 @@ def doModifyUebaRuleSwitch(args, parsed_globals):
|
|
1398
1502
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1399
1503
|
client._sdkVersion += ("_CLI_" + __version__)
|
1400
1504
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1401
|
-
model = models.
|
1505
|
+
model = models.StopRiskCenterTaskRequest()
|
1402
1506
|
model.from_json_string(json.dumps(args))
|
1403
1507
|
start_time = time.time()
|
1404
1508
|
while True:
|
1405
|
-
rsp = client.
|
1509
|
+
rsp = client.StopRiskCenterTask(model)
|
1406
1510
|
result = rsp.to_json_string()
|
1407
1511
|
try:
|
1408
1512
|
json_obj = json.loads(result)
|
@@ -1421,7 +1525,7 @@ def doModifyUebaRuleSwitch(args, parsed_globals):
|
|
1421
1525
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1422
1526
|
|
1423
1527
|
|
1424
|
-
def
|
1528
|
+
def doDescribeAssetRiskList(args, parsed_globals):
|
1425
1529
|
g_param = parse_global_arg(parsed_globals)
|
1426
1530
|
|
1427
1531
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1450,11 +1554,11 @@ def doCreateRiskCenterScanTask(args, parsed_globals):
|
|
1450
1554
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1451
1555
|
client._sdkVersion += ("_CLI_" + __version__)
|
1452
1556
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1453
|
-
model = models.
|
1557
|
+
model = models.DescribeAssetRiskListRequest()
|
1454
1558
|
model.from_json_string(json.dumps(args))
|
1455
1559
|
start_time = time.time()
|
1456
1560
|
while True:
|
1457
|
-
rsp = client.
|
1561
|
+
rsp = client.DescribeAssetRiskList(model)
|
1458
1562
|
result = rsp.to_json_string()
|
1459
1563
|
try:
|
1460
1564
|
json_obj = json.loads(result)
|
@@ -1473,7 +1577,7 @@ def doCreateRiskCenterScanTask(args, parsed_globals):
|
|
1473
1577
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1474
1578
|
|
1475
1579
|
|
1476
|
-
def
|
1580
|
+
def doModifyUebaRuleSwitch(args, parsed_globals):
|
1477
1581
|
g_param = parse_global_arg(parsed_globals)
|
1478
1582
|
|
1479
1583
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1502,11 +1606,11 @@ def doDescribeGatewayAssets(args, parsed_globals):
|
|
1502
1606
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1503
1607
|
client._sdkVersion += ("_CLI_" + __version__)
|
1504
1608
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1505
|
-
model = models.
|
1609
|
+
model = models.ModifyUebaRuleSwitchRequest()
|
1506
1610
|
model.from_json_string(json.dumps(args))
|
1507
1611
|
start_time = time.time()
|
1508
1612
|
while True:
|
1509
|
-
rsp = client.
|
1613
|
+
rsp = client.ModifyUebaRuleSwitch(model)
|
1510
1614
|
result = rsp.to_json_string()
|
1511
1615
|
try:
|
1512
1616
|
json_obj = json.loads(result)
|
@@ -1525,7 +1629,7 @@ def doDescribeGatewayAssets(args, parsed_globals):
|
|
1525
1629
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1526
1630
|
|
1527
1631
|
|
1528
|
-
def
|
1632
|
+
def doDescribeRiskRules(args, parsed_globals):
|
1529
1633
|
g_param = parse_global_arg(parsed_globals)
|
1530
1634
|
|
1531
1635
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1554,11 +1658,11 @@ def doDescribeSearchBugInfo(args, parsed_globals):
|
|
1554
1658
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1555
1659
|
client._sdkVersion += ("_CLI_" + __version__)
|
1556
1660
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1557
|
-
model = models.
|
1661
|
+
model = models.DescribeRiskRulesRequest()
|
1558
1662
|
model.from_json_string(json.dumps(args))
|
1559
1663
|
start_time = time.time()
|
1560
1664
|
while True:
|
1561
|
-
rsp = client.
|
1665
|
+
rsp = client.DescribeRiskRules(model)
|
1562
1666
|
result = rsp.to_json_string()
|
1563
1667
|
try:
|
1564
1668
|
json_obj = json.loads(result)
|
@@ -1577,7 +1681,7 @@ def doDescribeSearchBugInfo(args, parsed_globals):
|
|
1577
1681
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1578
1682
|
|
1579
1683
|
|
1580
|
-
def
|
1684
|
+
def doDescribeExposePath(args, parsed_globals):
|
1581
1685
|
g_param = parse_global_arg(parsed_globals)
|
1582
1686
|
|
1583
1687
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1606,11 +1710,11 @@ def doDescribeRiskCenterAssetViewWeakPasswordRiskList(args, parsed_globals):
|
|
1606
1710
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1607
1711
|
client._sdkVersion += ("_CLI_" + __version__)
|
1608
1712
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1609
|
-
model = models.
|
1713
|
+
model = models.DescribeExposePathRequest()
|
1610
1714
|
model.from_json_string(json.dumps(args))
|
1611
1715
|
start_time = time.time()
|
1612
1716
|
while True:
|
1613
|
-
rsp = client.
|
1717
|
+
rsp = client.DescribeExposePath(model)
|
1614
1718
|
result = rsp.to_json_string()
|
1615
1719
|
try:
|
1616
1720
|
json_obj = json.loads(result)
|
@@ -1629,7 +1733,7 @@ def doDescribeRiskCenterAssetViewWeakPasswordRiskList(args, parsed_globals):
|
|
1629
1733
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1630
1734
|
|
1631
1735
|
|
1632
|
-
def
|
1736
|
+
def doDescribeGatewayAssets(args, parsed_globals):
|
1633
1737
|
g_param = parse_global_arg(parsed_globals)
|
1634
1738
|
|
1635
1739
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1658,11 +1762,11 @@ def doDescribeVulViewVulRiskList(args, parsed_globals):
|
|
1658
1762
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1659
1763
|
client._sdkVersion += ("_CLI_" + __version__)
|
1660
1764
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1661
|
-
model = models.
|
1765
|
+
model = models.DescribeGatewayAssetsRequest()
|
1662
1766
|
model.from_json_string(json.dumps(args))
|
1663
1767
|
start_time = time.time()
|
1664
1768
|
while True:
|
1665
|
-
rsp = client.
|
1769
|
+
rsp = client.DescribeGatewayAssets(model)
|
1666
1770
|
result = rsp.to_json_string()
|
1667
1771
|
try:
|
1668
1772
|
json_obj = json.loads(result)
|
@@ -1681,7 +1785,7 @@ def doDescribeVulViewVulRiskList(args, parsed_globals):
|
|
1681
1785
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1682
1786
|
|
1683
1787
|
|
1684
|
-
def
|
1788
|
+
def doDescribeCSIPRiskStatistics(args, parsed_globals):
|
1685
1789
|
g_param = parse_global_arg(parsed_globals)
|
1686
1790
|
|
1687
1791
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1710,11 +1814,11 @@ def doDescribeScanReportList(args, parsed_globals):
|
|
1710
1814
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1711
1815
|
client._sdkVersion += ("_CLI_" + __version__)
|
1712
1816
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1713
|
-
model = models.
|
1817
|
+
model = models.DescribeCSIPRiskStatisticsRequest()
|
1714
1818
|
model.from_json_string(json.dumps(args))
|
1715
1819
|
start_time = time.time()
|
1716
1820
|
while True:
|
1717
|
-
rsp = client.
|
1821
|
+
rsp = client.DescribeCSIPRiskStatistics(model)
|
1718
1822
|
result = rsp.to_json_string()
|
1719
1823
|
try:
|
1720
1824
|
json_obj = json.loads(result)
|
@@ -1733,7 +1837,7 @@ def doDescribeScanReportList(args, parsed_globals):
|
|
1733
1837
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1734
1838
|
|
1735
1839
|
|
1736
|
-
def
|
1840
|
+
def doDescribeSearchBugInfo(args, parsed_globals):
|
1737
1841
|
g_param = parse_global_arg(parsed_globals)
|
1738
1842
|
|
1739
1843
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1762,11 +1866,11 @@ def doDescribeSubUserInfo(args, parsed_globals):
|
|
1762
1866
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1763
1867
|
client._sdkVersion += ("_CLI_" + __version__)
|
1764
1868
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1765
|
-
model = models.
|
1869
|
+
model = models.DescribeSearchBugInfoRequest()
|
1766
1870
|
model.from_json_string(json.dumps(args))
|
1767
1871
|
start_time = time.time()
|
1768
1872
|
while True:
|
1769
|
-
rsp = client.
|
1873
|
+
rsp = client.DescribeSearchBugInfo(model)
|
1770
1874
|
result = rsp.to_json_string()
|
1771
1875
|
try:
|
1772
1876
|
json_obj = json.loads(result)
|
@@ -1785,7 +1889,7 @@ def doDescribeSubUserInfo(args, parsed_globals):
|
|
1785
1889
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1786
1890
|
|
1787
1891
|
|
1788
|
-
def
|
1892
|
+
def doDescribeRiskCenterAssetViewWeakPasswordRiskList(args, parsed_globals):
|
1789
1893
|
g_param = parse_global_arg(parsed_globals)
|
1790
1894
|
|
1791
1895
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1814,11 +1918,11 @@ def doDescribeAlertList(args, parsed_globals):
|
|
1814
1918
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1815
1919
|
client._sdkVersion += ("_CLI_" + __version__)
|
1816
1920
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1817
|
-
model = models.
|
1921
|
+
model = models.DescribeRiskCenterAssetViewWeakPasswordRiskListRequest()
|
1818
1922
|
model.from_json_string(json.dumps(args))
|
1819
1923
|
start_time = time.time()
|
1820
1924
|
while True:
|
1821
|
-
rsp = client.
|
1925
|
+
rsp = client.DescribeRiskCenterAssetViewWeakPasswordRiskList(model)
|
1822
1926
|
result = rsp.to_json_string()
|
1823
1927
|
try:
|
1824
1928
|
json_obj = json.loads(result)
|
@@ -1837,7 +1941,7 @@ def doDescribeAlertList(args, parsed_globals):
|
|
1837
1941
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1838
1942
|
|
1839
1943
|
|
1840
|
-
def
|
1944
|
+
def doDescribeVulViewVulRiskList(args, parsed_globals):
|
1841
1945
|
g_param = parse_global_arg(parsed_globals)
|
1842
1946
|
|
1843
1947
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1866,11 +1970,11 @@ def doModifyRiskCenterRiskStatus(args, parsed_globals):
|
|
1866
1970
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1867
1971
|
client._sdkVersion += ("_CLI_" + __version__)
|
1868
1972
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1869
|
-
model = models.
|
1973
|
+
model = models.DescribeVulViewVulRiskListRequest()
|
1870
1974
|
model.from_json_string(json.dumps(args))
|
1871
1975
|
start_time = time.time()
|
1872
1976
|
while True:
|
1873
|
-
rsp = client.
|
1977
|
+
rsp = client.DescribeVulViewVulRiskList(model)
|
1874
1978
|
result = rsp.to_json_string()
|
1875
1979
|
try:
|
1876
1980
|
json_obj = json.loads(result)
|
@@ -1889,7 +1993,7 @@ def doModifyRiskCenterRiskStatus(args, parsed_globals):
|
|
1889
1993
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1890
1994
|
|
1891
1995
|
|
1892
|
-
def
|
1996
|
+
def doDescribeScanReportList(args, parsed_globals):
|
1893
1997
|
g_param = parse_global_arg(parsed_globals)
|
1894
1998
|
|
1895
1999
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1918,11 +2022,11 @@ def doUpdateAlertStatusList(args, parsed_globals):
|
|
1918
2022
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1919
2023
|
client._sdkVersion += ("_CLI_" + __version__)
|
1920
2024
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1921
|
-
model = models.
|
2025
|
+
model = models.DescribeScanReportListRequest()
|
1922
2026
|
model.from_json_string(json.dumps(args))
|
1923
2027
|
start_time = time.time()
|
1924
2028
|
while True:
|
1925
|
-
rsp = client.
|
2029
|
+
rsp = client.DescribeScanReportList(model)
|
1926
2030
|
result = rsp.to_json_string()
|
1927
2031
|
try:
|
1928
2032
|
json_obj = json.loads(result)
|
@@ -1941,7 +2045,7 @@ def doUpdateAlertStatusList(args, parsed_globals):
|
|
1941
2045
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1942
2046
|
|
1943
2047
|
|
1944
|
-
def
|
2048
|
+
def doDescribeSubUserInfo(args, parsed_globals):
|
1945
2049
|
g_param = parse_global_arg(parsed_globals)
|
1946
2050
|
|
1947
2051
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -1970,11 +2074,11 @@ def doDescribeScanTaskList(args, parsed_globals):
|
|
1970
2074
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1971
2075
|
client._sdkVersion += ("_CLI_" + __version__)
|
1972
2076
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1973
|
-
model = models.
|
2077
|
+
model = models.DescribeSubUserInfoRequest()
|
1974
2078
|
model.from_json_string(json.dumps(args))
|
1975
2079
|
start_time = time.time()
|
1976
2080
|
while True:
|
1977
|
-
rsp = client.
|
2081
|
+
rsp = client.DescribeSubUserInfo(model)
|
1978
2082
|
result = rsp.to_json_string()
|
1979
2083
|
try:
|
1980
2084
|
json_obj = json.loads(result)
|
@@ -1993,7 +2097,7 @@ def doDescribeScanTaskList(args, parsed_globals):
|
|
1993
2097
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1994
2098
|
|
1995
2099
|
|
1996
|
-
def
|
2100
|
+
def doDescribeAlertList(args, parsed_globals):
|
1997
2101
|
g_param = parse_global_arg(parsed_globals)
|
1998
2102
|
|
1999
2103
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2022,11 +2126,11 @@ def doDescribeDbAssets(args, parsed_globals):
|
|
2022
2126
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2023
2127
|
client._sdkVersion += ("_CLI_" + __version__)
|
2024
2128
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2025
|
-
model = models.
|
2129
|
+
model = models.DescribeAlertListRequest()
|
2026
2130
|
model.from_json_string(json.dumps(args))
|
2027
2131
|
start_time = time.time()
|
2028
2132
|
while True:
|
2029
|
-
rsp = client.
|
2133
|
+
rsp = client.DescribeAlertList(model)
|
2030
2134
|
result = rsp.to_json_string()
|
2031
2135
|
try:
|
2032
2136
|
json_obj = json.loads(result)
|
@@ -2045,7 +2149,7 @@ def doDescribeDbAssets(args, parsed_globals):
|
|
2045
2149
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2046
2150
|
|
2047
2151
|
|
2048
|
-
def
|
2152
|
+
def doModifyRiskCenterRiskStatus(args, parsed_globals):
|
2049
2153
|
g_param = parse_global_arg(parsed_globals)
|
2050
2154
|
|
2051
2155
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2074,11 +2178,11 @@ def doDescribeRiskCenterPortViewPortRiskList(args, parsed_globals):
|
|
2074
2178
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2075
2179
|
client._sdkVersion += ("_CLI_" + __version__)
|
2076
2180
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2077
|
-
model = models.
|
2181
|
+
model = models.ModifyRiskCenterRiskStatusRequest()
|
2078
2182
|
model.from_json_string(json.dumps(args))
|
2079
2183
|
start_time = time.time()
|
2080
2184
|
while True:
|
2081
|
-
rsp = client.
|
2185
|
+
rsp = client.ModifyRiskCenterRiskStatus(model)
|
2082
2186
|
result = rsp.to_json_string()
|
2083
2187
|
try:
|
2084
2188
|
json_obj = json.loads(result)
|
@@ -2097,7 +2201,7 @@ def doDescribeRiskCenterPortViewPortRiskList(args, parsed_globals):
|
|
2097
2201
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2098
2202
|
|
2099
2203
|
|
2100
|
-
def
|
2204
|
+
def doUpdateAlertStatusList(args, parsed_globals):
|
2101
2205
|
g_param = parse_global_arg(parsed_globals)
|
2102
2206
|
|
2103
2207
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2126,11 +2230,11 @@ def doDescribeRiskCenterAssetViewPortRiskList(args, parsed_globals):
|
|
2126
2230
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2127
2231
|
client._sdkVersion += ("_CLI_" + __version__)
|
2128
2232
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2129
|
-
model = models.
|
2233
|
+
model = models.UpdateAlertStatusListRequest()
|
2130
2234
|
model.from_json_string(json.dumps(args))
|
2131
2235
|
start_time = time.time()
|
2132
2236
|
while True:
|
2133
|
-
rsp = client.
|
2237
|
+
rsp = client.UpdateAlertStatusList(model)
|
2134
2238
|
result = rsp.to_json_string()
|
2135
2239
|
try:
|
2136
2240
|
json_obj = json.loads(result)
|
@@ -2149,7 +2253,7 @@ def doDescribeRiskCenterAssetViewPortRiskList(args, parsed_globals):
|
|
2149
2253
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2150
2254
|
|
2151
2255
|
|
2152
|
-
def
|
2256
|
+
def doDescribeScanStatistic(args, parsed_globals):
|
2153
2257
|
g_param = parse_global_arg(parsed_globals)
|
2154
2258
|
|
2155
2259
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2178,11 +2282,11 @@ def doDescribeVULRiskAdvanceCFGList(args, parsed_globals):
|
|
2178
2282
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2179
2283
|
client._sdkVersion += ("_CLI_" + __version__)
|
2180
2284
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2181
|
-
model = models.
|
2285
|
+
model = models.DescribeScanStatisticRequest()
|
2182
2286
|
model.from_json_string(json.dumps(args))
|
2183
2287
|
start_time = time.time()
|
2184
2288
|
while True:
|
2185
|
-
rsp = client.
|
2289
|
+
rsp = client.DescribeScanStatistic(model)
|
2186
2290
|
result = rsp.to_json_string()
|
2187
2291
|
try:
|
2188
2292
|
json_obj = json.loads(result)
|
@@ -2201,7 +2305,7 @@ def doDescribeVULRiskAdvanceCFGList(args, parsed_globals):
|
|
2201
2305
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2202
2306
|
|
2203
2307
|
|
2204
|
-
def
|
2308
|
+
def doDescribeExposeAssetCategory(args, parsed_globals):
|
2205
2309
|
g_param = parse_global_arg(parsed_globals)
|
2206
2310
|
|
2207
2311
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2230,11 +2334,11 @@ def doDescribeExposures(args, parsed_globals):
|
|
2230
2334
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2231
2335
|
client._sdkVersion += ("_CLI_" + __version__)
|
2232
2336
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2233
|
-
model = models.
|
2337
|
+
model = models.DescribeExposeAssetCategoryRequest()
|
2234
2338
|
model.from_json_string(json.dumps(args))
|
2235
2339
|
start_time = time.time()
|
2236
2340
|
while True:
|
2237
|
-
rsp = client.
|
2341
|
+
rsp = client.DescribeExposeAssetCategory(model)
|
2238
2342
|
result = rsp.to_json_string()
|
2239
2343
|
try:
|
2240
2344
|
json_obj = json.loads(result)
|
@@ -2253,7 +2357,7 @@ def doDescribeExposures(args, parsed_globals):
|
|
2253
2357
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2254
2358
|
|
2255
2359
|
|
2256
|
-
def
|
2360
|
+
def doDescribeScanTaskList(args, parsed_globals):
|
2257
2361
|
g_param = parse_global_arg(parsed_globals)
|
2258
2362
|
|
2259
2363
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2282,11 +2386,11 @@ def doCreateDomainAndIp(args, parsed_globals):
|
|
2282
2386
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2283
2387
|
client._sdkVersion += ("_CLI_" + __version__)
|
2284
2388
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2285
|
-
model = models.
|
2389
|
+
model = models.DescribeScanTaskListRequest()
|
2286
2390
|
model.from_json_string(json.dumps(args))
|
2287
2391
|
start_time = time.time()
|
2288
2392
|
while True:
|
2289
|
-
rsp = client.
|
2393
|
+
rsp = client.DescribeScanTaskList(model)
|
2290
2394
|
result = rsp.to_json_string()
|
2291
2395
|
try:
|
2292
2396
|
json_obj = json.loads(result)
|
@@ -2305,7 +2409,7 @@ def doCreateDomainAndIp(args, parsed_globals):
|
|
2305
2409
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2306
2410
|
|
2307
2411
|
|
2308
|
-
def
|
2412
|
+
def doCreateRiskCenterScanTask(args, parsed_globals):
|
2309
2413
|
g_param = parse_global_arg(parsed_globals)
|
2310
2414
|
|
2311
2415
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2334,11 +2438,11 @@ def doModifyOrganizationAccountStatus(args, parsed_globals):
|
|
2334
2438
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2335
2439
|
client._sdkVersion += ("_CLI_" + __version__)
|
2336
2440
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2337
|
-
model = models.
|
2441
|
+
model = models.CreateRiskCenterScanTaskRequest()
|
2338
2442
|
model.from_json_string(json.dumps(args))
|
2339
2443
|
start_time = time.time()
|
2340
2444
|
while True:
|
2341
|
-
rsp = client.
|
2445
|
+
rsp = client.CreateRiskCenterScanTask(model)
|
2342
2446
|
result = rsp.to_json_string()
|
2343
2447
|
try:
|
2344
2448
|
json_obj = json.loads(result)
|
@@ -2357,7 +2461,7 @@ def doModifyOrganizationAccountStatus(args, parsed_globals):
|
|
2357
2461
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2358
2462
|
|
2359
2463
|
|
2360
|
-
def
|
2464
|
+
def doDescribeRiskCenterPortViewPortRiskList(args, parsed_globals):
|
2361
2465
|
g_param = parse_global_arg(parsed_globals)
|
2362
2466
|
|
2363
2467
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2386,11 +2490,11 @@ def doDescribeTopAttackInfo(args, parsed_globals):
|
|
2386
2490
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2387
2491
|
client._sdkVersion += ("_CLI_" + __version__)
|
2388
2492
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2389
|
-
model = models.
|
2493
|
+
model = models.DescribeRiskCenterPortViewPortRiskListRequest()
|
2390
2494
|
model.from_json_string(json.dumps(args))
|
2391
2495
|
start_time = time.time()
|
2392
2496
|
while True:
|
2393
|
-
rsp = client.
|
2497
|
+
rsp = client.DescribeRiskCenterPortViewPortRiskList(model)
|
2394
2498
|
result = rsp.to_json_string()
|
2395
2499
|
try:
|
2396
2500
|
json_obj = json.loads(result)
|
@@ -2409,7 +2513,7 @@ def doDescribeTopAttackInfo(args, parsed_globals):
|
|
2409
2513
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2410
2514
|
|
2411
2515
|
|
2412
|
-
def
|
2516
|
+
def doDescribeRiskCenterAssetViewPortRiskList(args, parsed_globals):
|
2413
2517
|
g_param = parse_global_arg(parsed_globals)
|
2414
2518
|
|
2415
2519
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2438,11 +2542,11 @@ def doDescribeClusterAssets(args, parsed_globals):
|
|
2438
2542
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2439
2543
|
client._sdkVersion += ("_CLI_" + __version__)
|
2440
2544
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2441
|
-
model = models.
|
2545
|
+
model = models.DescribeRiskCenterAssetViewPortRiskListRequest()
|
2442
2546
|
model.from_json_string(json.dumps(args))
|
2443
2547
|
start_time = time.time()
|
2444
2548
|
while True:
|
2445
|
-
rsp = client.
|
2549
|
+
rsp = client.DescribeRiskCenterAssetViewPortRiskList(model)
|
2446
2550
|
result = rsp.to_json_string()
|
2447
2551
|
try:
|
2448
2552
|
json_obj = json.loads(result)
|
@@ -2461,7 +2565,7 @@ def doDescribeClusterAssets(args, parsed_globals):
|
|
2461
2565
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2462
2566
|
|
2463
2567
|
|
2464
|
-
def
|
2568
|
+
def doDescribeVULRiskAdvanceCFGList(args, parsed_globals):
|
2465
2569
|
g_param = parse_global_arg(parsed_globals)
|
2466
2570
|
|
2467
2571
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2490,11 +2594,11 @@ def doDescribeTaskLogURL(args, parsed_globals):
|
|
2490
2594
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2491
2595
|
client._sdkVersion += ("_CLI_" + __version__)
|
2492
2596
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2493
|
-
model = models.
|
2597
|
+
model = models.DescribeVULRiskAdvanceCFGListRequest()
|
2494
2598
|
model.from_json_string(json.dumps(args))
|
2495
2599
|
start_time = time.time()
|
2496
2600
|
while True:
|
2497
|
-
rsp = client.
|
2601
|
+
rsp = client.DescribeVULRiskAdvanceCFGList(model)
|
2498
2602
|
result = rsp.to_json_string()
|
2499
2603
|
try:
|
2500
2604
|
json_obj = json.loads(result)
|
@@ -2513,7 +2617,7 @@ def doDescribeTaskLogURL(args, parsed_globals):
|
|
2513
2617
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2514
2618
|
|
2515
2619
|
|
2516
|
-
def
|
2620
|
+
def doDescribeExposures(args, parsed_globals):
|
2517
2621
|
g_param = parse_global_arg(parsed_globals)
|
2518
2622
|
|
2519
2623
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -2542,11 +2646,11 @@ def doDescribeCVMAssetInfo(args, parsed_globals):
|
|
2542
2646
|
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2543
2647
|
client._sdkVersion += ("_CLI_" + __version__)
|
2544
2648
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2545
|
-
model = models.
|
2649
|
+
model = models.DescribeExposuresRequest()
|
2546
2650
|
model.from_json_string(json.dumps(args))
|
2547
2651
|
start_time = time.time()
|
2548
2652
|
while True:
|
2549
|
-
rsp = client.
|
2653
|
+
rsp = client.DescribeExposures(model)
|
2550
2654
|
result = rsp.to_json_string()
|
2551
2655
|
try:
|
2552
2656
|
json_obj = json.loads(result)
|
@@ -2565,26 +2669,600 @@ def doDescribeCVMAssetInfo(args, parsed_globals):
|
|
2565
2669
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2566
2670
|
|
2567
2671
|
|
2568
|
-
|
2569
|
-
|
2570
|
-
|
2571
|
-
}
|
2572
|
-
|
2573
|
-
MODELS_MAP = {
|
2574
|
-
"v20221121": models_v20221121,
|
2575
|
-
|
2576
|
-
}
|
2672
|
+
def doDescribeRiskDetailList(args, parsed_globals):
|
2673
|
+
g_param = parse_global_arg(parsed_globals)
|
2577
2674
|
|
2578
|
-
|
2579
|
-
|
2580
|
-
|
2581
|
-
|
2675
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2676
|
+
cred = credential.CVMRoleCredential()
|
2677
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2678
|
+
cred = credential.STSAssumeRoleCredential(
|
2679
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2680
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2681
|
+
)
|
2682
|
+
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):
|
2683
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2684
|
+
else:
|
2685
|
+
cred = credential.Credential(
|
2686
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2687
|
+
)
|
2688
|
+
http_profile = HttpProfile(
|
2689
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2690
|
+
reqMethod="POST",
|
2691
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2692
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2693
|
+
)
|
2694
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2695
|
+
if g_param[OptionsDefine.Language]:
|
2696
|
+
profile.language = g_param[OptionsDefine.Language]
|
2697
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2698
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2699
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2700
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2701
|
+
model = models.DescribeRiskDetailListRequest()
|
2702
|
+
model.from_json_string(json.dumps(args))
|
2703
|
+
start_time = time.time()
|
2704
|
+
while True:
|
2705
|
+
rsp = client.DescribeRiskDetailList(model)
|
2706
|
+
result = rsp.to_json_string()
|
2707
|
+
try:
|
2708
|
+
json_obj = json.loads(result)
|
2709
|
+
except TypeError as e:
|
2710
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2711
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2712
|
+
break
|
2713
|
+
cur_time = time.time()
|
2714
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2715
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2716
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2717
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2718
|
+
else:
|
2719
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2720
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2721
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2722
|
+
|
2723
|
+
|
2724
|
+
def doCreateDomainAndIp(args, parsed_globals):
|
2725
|
+
g_param = parse_global_arg(parsed_globals)
|
2726
|
+
|
2727
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2728
|
+
cred = credential.CVMRoleCredential()
|
2729
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2730
|
+
cred = credential.STSAssumeRoleCredential(
|
2731
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2732
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2733
|
+
)
|
2734
|
+
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):
|
2735
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2736
|
+
else:
|
2737
|
+
cred = credential.Credential(
|
2738
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2739
|
+
)
|
2740
|
+
http_profile = HttpProfile(
|
2741
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2742
|
+
reqMethod="POST",
|
2743
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2744
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2745
|
+
)
|
2746
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2747
|
+
if g_param[OptionsDefine.Language]:
|
2748
|
+
profile.language = g_param[OptionsDefine.Language]
|
2749
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2750
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2751
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2752
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2753
|
+
model = models.CreateDomainAndIpRequest()
|
2754
|
+
model.from_json_string(json.dumps(args))
|
2755
|
+
start_time = time.time()
|
2756
|
+
while True:
|
2757
|
+
rsp = client.CreateDomainAndIp(model)
|
2758
|
+
result = rsp.to_json_string()
|
2759
|
+
try:
|
2760
|
+
json_obj = json.loads(result)
|
2761
|
+
except TypeError as e:
|
2762
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2763
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2764
|
+
break
|
2765
|
+
cur_time = time.time()
|
2766
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2767
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2768
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2769
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2770
|
+
else:
|
2771
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2772
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2773
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2774
|
+
|
2775
|
+
|
2776
|
+
def doModifyOrganizationAccountStatus(args, parsed_globals):
|
2777
|
+
g_param = parse_global_arg(parsed_globals)
|
2778
|
+
|
2779
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2780
|
+
cred = credential.CVMRoleCredential()
|
2781
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2782
|
+
cred = credential.STSAssumeRoleCredential(
|
2783
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2784
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2785
|
+
)
|
2786
|
+
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):
|
2787
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2788
|
+
else:
|
2789
|
+
cred = credential.Credential(
|
2790
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2791
|
+
)
|
2792
|
+
http_profile = HttpProfile(
|
2793
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2794
|
+
reqMethod="POST",
|
2795
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2796
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2797
|
+
)
|
2798
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2799
|
+
if g_param[OptionsDefine.Language]:
|
2800
|
+
profile.language = g_param[OptionsDefine.Language]
|
2801
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2802
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2803
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2804
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2805
|
+
model = models.ModifyOrganizationAccountStatusRequest()
|
2806
|
+
model.from_json_string(json.dumps(args))
|
2807
|
+
start_time = time.time()
|
2808
|
+
while True:
|
2809
|
+
rsp = client.ModifyOrganizationAccountStatus(model)
|
2810
|
+
result = rsp.to_json_string()
|
2811
|
+
try:
|
2812
|
+
json_obj = json.loads(result)
|
2813
|
+
except TypeError as e:
|
2814
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2815
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2816
|
+
break
|
2817
|
+
cur_time = time.time()
|
2818
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2819
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2820
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2821
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2822
|
+
else:
|
2823
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2824
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2825
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2826
|
+
|
2827
|
+
|
2828
|
+
def doDescribeSubnetAssets(args, parsed_globals):
|
2829
|
+
g_param = parse_global_arg(parsed_globals)
|
2830
|
+
|
2831
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2832
|
+
cred = credential.CVMRoleCredential()
|
2833
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2834
|
+
cred = credential.STSAssumeRoleCredential(
|
2835
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2836
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2837
|
+
)
|
2838
|
+
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):
|
2839
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2840
|
+
else:
|
2841
|
+
cred = credential.Credential(
|
2842
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2843
|
+
)
|
2844
|
+
http_profile = HttpProfile(
|
2845
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2846
|
+
reqMethod="POST",
|
2847
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2848
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2849
|
+
)
|
2850
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2851
|
+
if g_param[OptionsDefine.Language]:
|
2852
|
+
profile.language = g_param[OptionsDefine.Language]
|
2853
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2854
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2855
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2856
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2857
|
+
model = models.DescribeSubnetAssetsRequest()
|
2858
|
+
model.from_json_string(json.dumps(args))
|
2859
|
+
start_time = time.time()
|
2860
|
+
while True:
|
2861
|
+
rsp = client.DescribeSubnetAssets(model)
|
2862
|
+
result = rsp.to_json_string()
|
2863
|
+
try:
|
2864
|
+
json_obj = json.loads(result)
|
2865
|
+
except TypeError as e:
|
2866
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2867
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2868
|
+
break
|
2869
|
+
cur_time = time.time()
|
2870
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2871
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2872
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2873
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2874
|
+
else:
|
2875
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2876
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2877
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2878
|
+
|
2879
|
+
|
2880
|
+
def doDescribeRiskCenterCFGViewCFGRiskList(args, parsed_globals):
|
2881
|
+
g_param = parse_global_arg(parsed_globals)
|
2882
|
+
|
2883
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2884
|
+
cred = credential.CVMRoleCredential()
|
2885
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2886
|
+
cred = credential.STSAssumeRoleCredential(
|
2887
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2888
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2889
|
+
)
|
2890
|
+
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):
|
2891
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2892
|
+
else:
|
2893
|
+
cred = credential.Credential(
|
2894
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2895
|
+
)
|
2896
|
+
http_profile = HttpProfile(
|
2897
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2898
|
+
reqMethod="POST",
|
2899
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2900
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2901
|
+
)
|
2902
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2903
|
+
if g_param[OptionsDefine.Language]:
|
2904
|
+
profile.language = g_param[OptionsDefine.Language]
|
2905
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2906
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2907
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2908
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2909
|
+
model = models.DescribeRiskCenterCFGViewCFGRiskListRequest()
|
2910
|
+
model.from_json_string(json.dumps(args))
|
2911
|
+
start_time = time.time()
|
2912
|
+
while True:
|
2913
|
+
rsp = client.DescribeRiskCenterCFGViewCFGRiskList(model)
|
2914
|
+
result = rsp.to_json_string()
|
2915
|
+
try:
|
2916
|
+
json_obj = json.loads(result)
|
2917
|
+
except TypeError as e:
|
2918
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2919
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2920
|
+
break
|
2921
|
+
cur_time = time.time()
|
2922
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2923
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2924
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2925
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2926
|
+
else:
|
2927
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2928
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2929
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2930
|
+
|
2931
|
+
|
2932
|
+
def doDescribeTopAttackInfo(args, parsed_globals):
|
2933
|
+
g_param = parse_global_arg(parsed_globals)
|
2934
|
+
|
2935
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2936
|
+
cred = credential.CVMRoleCredential()
|
2937
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2938
|
+
cred = credential.STSAssumeRoleCredential(
|
2939
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2940
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2941
|
+
)
|
2942
|
+
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):
|
2943
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2944
|
+
else:
|
2945
|
+
cred = credential.Credential(
|
2946
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2947
|
+
)
|
2948
|
+
http_profile = HttpProfile(
|
2949
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
2950
|
+
reqMethod="POST",
|
2951
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
2952
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
2953
|
+
)
|
2954
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
2955
|
+
if g_param[OptionsDefine.Language]:
|
2956
|
+
profile.language = g_param[OptionsDefine.Language]
|
2957
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
2958
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
2959
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
2960
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
2961
|
+
model = models.DescribeTopAttackInfoRequest()
|
2962
|
+
model.from_json_string(json.dumps(args))
|
2963
|
+
start_time = time.time()
|
2964
|
+
while True:
|
2965
|
+
rsp = client.DescribeTopAttackInfo(model)
|
2966
|
+
result = rsp.to_json_string()
|
2967
|
+
try:
|
2968
|
+
json_obj = json.loads(result)
|
2969
|
+
except TypeError as e:
|
2970
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
2971
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
2972
|
+
break
|
2973
|
+
cur_time = time.time()
|
2974
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
2975
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
2976
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
2977
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
2978
|
+
else:
|
2979
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
2980
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
2981
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
2982
|
+
|
2983
|
+
|
2984
|
+
def doDescribeClusterAssets(args, parsed_globals):
|
2985
|
+
g_param = parse_global_arg(parsed_globals)
|
2986
|
+
|
2987
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
2988
|
+
cred = credential.CVMRoleCredential()
|
2989
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
2990
|
+
cred = credential.STSAssumeRoleCredential(
|
2991
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
2992
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
2993
|
+
)
|
2994
|
+
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):
|
2995
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
2996
|
+
else:
|
2997
|
+
cred = credential.Credential(
|
2998
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
2999
|
+
)
|
3000
|
+
http_profile = HttpProfile(
|
3001
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3002
|
+
reqMethod="POST",
|
3003
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3004
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3005
|
+
)
|
3006
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3007
|
+
if g_param[OptionsDefine.Language]:
|
3008
|
+
profile.language = g_param[OptionsDefine.Language]
|
3009
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3010
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
3011
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3012
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3013
|
+
model = models.DescribeClusterAssetsRequest()
|
3014
|
+
model.from_json_string(json.dumps(args))
|
3015
|
+
start_time = time.time()
|
3016
|
+
while True:
|
3017
|
+
rsp = client.DescribeClusterAssets(model)
|
3018
|
+
result = rsp.to_json_string()
|
3019
|
+
try:
|
3020
|
+
json_obj = json.loads(result)
|
3021
|
+
except TypeError as e:
|
3022
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3023
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3024
|
+
break
|
3025
|
+
cur_time = time.time()
|
3026
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3027
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3028
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3029
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3030
|
+
else:
|
3031
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3032
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3033
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3034
|
+
|
3035
|
+
|
3036
|
+
def doDescribeTaskLogURL(args, parsed_globals):
|
3037
|
+
g_param = parse_global_arg(parsed_globals)
|
3038
|
+
|
3039
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3040
|
+
cred = credential.CVMRoleCredential()
|
3041
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3042
|
+
cred = credential.STSAssumeRoleCredential(
|
3043
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3044
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3045
|
+
)
|
3046
|
+
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):
|
3047
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3048
|
+
else:
|
3049
|
+
cred = credential.Credential(
|
3050
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3051
|
+
)
|
3052
|
+
http_profile = HttpProfile(
|
3053
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3054
|
+
reqMethod="POST",
|
3055
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3056
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3057
|
+
)
|
3058
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3059
|
+
if g_param[OptionsDefine.Language]:
|
3060
|
+
profile.language = g_param[OptionsDefine.Language]
|
3061
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3062
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
3063
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3064
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3065
|
+
model = models.DescribeTaskLogURLRequest()
|
3066
|
+
model.from_json_string(json.dumps(args))
|
3067
|
+
start_time = time.time()
|
3068
|
+
while True:
|
3069
|
+
rsp = client.DescribeTaskLogURL(model)
|
3070
|
+
result = rsp.to_json_string()
|
3071
|
+
try:
|
3072
|
+
json_obj = json.loads(result)
|
3073
|
+
except TypeError as e:
|
3074
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3075
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3076
|
+
break
|
3077
|
+
cur_time = time.time()
|
3078
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3079
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3080
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3081
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3082
|
+
else:
|
3083
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3084
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3085
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3086
|
+
|
3087
|
+
|
3088
|
+
def doDescribeRepositoryImageAssets(args, parsed_globals):
|
3089
|
+
g_param = parse_global_arg(parsed_globals)
|
3090
|
+
|
3091
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3092
|
+
cred = credential.CVMRoleCredential()
|
3093
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3094
|
+
cred = credential.STSAssumeRoleCredential(
|
3095
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3096
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3097
|
+
)
|
3098
|
+
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):
|
3099
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3100
|
+
else:
|
3101
|
+
cred = credential.Credential(
|
3102
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3103
|
+
)
|
3104
|
+
http_profile = HttpProfile(
|
3105
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3106
|
+
reqMethod="POST",
|
3107
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3108
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3109
|
+
)
|
3110
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3111
|
+
if g_param[OptionsDefine.Language]:
|
3112
|
+
profile.language = g_param[OptionsDefine.Language]
|
3113
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3114
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
3115
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3116
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3117
|
+
model = models.DescribeRepositoryImageAssetsRequest()
|
3118
|
+
model.from_json_string(json.dumps(args))
|
3119
|
+
start_time = time.time()
|
3120
|
+
while True:
|
3121
|
+
rsp = client.DescribeRepositoryImageAssets(model)
|
3122
|
+
result = rsp.to_json_string()
|
3123
|
+
try:
|
3124
|
+
json_obj = json.loads(result)
|
3125
|
+
except TypeError as e:
|
3126
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3127
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3128
|
+
break
|
3129
|
+
cur_time = time.time()
|
3130
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3131
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3132
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3133
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3134
|
+
else:
|
3135
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3136
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3137
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3138
|
+
|
3139
|
+
|
3140
|
+
def doDescribeDbAssets(args, parsed_globals):
|
3141
|
+
g_param = parse_global_arg(parsed_globals)
|
3142
|
+
|
3143
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3144
|
+
cred = credential.CVMRoleCredential()
|
3145
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3146
|
+
cred = credential.STSAssumeRoleCredential(
|
3147
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3148
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3149
|
+
)
|
3150
|
+
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):
|
3151
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3152
|
+
else:
|
3153
|
+
cred = credential.Credential(
|
3154
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3155
|
+
)
|
3156
|
+
http_profile = HttpProfile(
|
3157
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3158
|
+
reqMethod="POST",
|
3159
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3160
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3161
|
+
)
|
3162
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3163
|
+
if g_param[OptionsDefine.Language]:
|
3164
|
+
profile.language = g_param[OptionsDefine.Language]
|
3165
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3166
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
3167
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3168
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3169
|
+
model = models.DescribeDbAssetsRequest()
|
3170
|
+
model.from_json_string(json.dumps(args))
|
3171
|
+
start_time = time.time()
|
3172
|
+
while True:
|
3173
|
+
rsp = client.DescribeDbAssets(model)
|
3174
|
+
result = rsp.to_json_string()
|
3175
|
+
try:
|
3176
|
+
json_obj = json.loads(result)
|
3177
|
+
except TypeError as e:
|
3178
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3179
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3180
|
+
break
|
3181
|
+
cur_time = time.time()
|
3182
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3183
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3184
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3185
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3186
|
+
else:
|
3187
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3188
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3189
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3190
|
+
|
3191
|
+
|
3192
|
+
def doDescribeCVMAssetInfo(args, parsed_globals):
|
3193
|
+
g_param = parse_global_arg(parsed_globals)
|
3194
|
+
|
3195
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3196
|
+
cred = credential.CVMRoleCredential()
|
3197
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3198
|
+
cred = credential.STSAssumeRoleCredential(
|
3199
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3200
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3201
|
+
)
|
3202
|
+
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):
|
3203
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3204
|
+
else:
|
3205
|
+
cred = credential.Credential(
|
3206
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3207
|
+
)
|
3208
|
+
http_profile = HttpProfile(
|
3209
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3210
|
+
reqMethod="POST",
|
3211
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3212
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3213
|
+
)
|
3214
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3215
|
+
if g_param[OptionsDefine.Language]:
|
3216
|
+
profile.language = g_param[OptionsDefine.Language]
|
3217
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3218
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
3219
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3220
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3221
|
+
model = models.DescribeCVMAssetInfoRequest()
|
3222
|
+
model.from_json_string(json.dumps(args))
|
3223
|
+
start_time = time.time()
|
3224
|
+
while True:
|
3225
|
+
rsp = client.DescribeCVMAssetInfo(model)
|
3226
|
+
result = rsp.to_json_string()
|
3227
|
+
try:
|
3228
|
+
json_obj = json.loads(result)
|
3229
|
+
except TypeError as e:
|
3230
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3231
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3232
|
+
break
|
3233
|
+
cur_time = time.time()
|
3234
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3235
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3236
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3237
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3238
|
+
else:
|
3239
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3240
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3241
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3242
|
+
|
3243
|
+
|
3244
|
+
CLIENT_MAP = {
|
3245
|
+
"v20221121": csip_client_v20221121,
|
3246
|
+
|
3247
|
+
}
|
3248
|
+
|
3249
|
+
MODELS_MAP = {
|
3250
|
+
"v20221121": models_v20221121,
|
3251
|
+
|
3252
|
+
}
|
3253
|
+
|
3254
|
+
ACTION_MAP = {
|
3255
|
+
"DescribeUebaRule": doDescribeUebaRule,
|
3256
|
+
"DeleteDomainAndIp": doDeleteDomainAndIp,
|
3257
|
+
"DescribeRiskRuleDetail": doDescribeRiskRuleDetail,
|
3258
|
+
"DescribeDbAssetInfo": doDescribeDbAssetInfo,
|
2582
3259
|
"DescribeNICAssets": doDescribeNICAssets,
|
2583
3260
|
"DescribeRiskCenterVULViewVULRiskList": doDescribeRiskCenterVULViewVULRiskList,
|
2584
3261
|
"DescribeDomainAssets": doDescribeDomainAssets,
|
2585
3262
|
"DescribePublicIpAssets": doDescribePublicIpAssets,
|
2586
3263
|
"AddNewBindRoleUser": doAddNewBindRoleUser,
|
2587
|
-
"
|
3264
|
+
"DescribeVULList": doDescribeVULList,
|
3265
|
+
"DescribeOtherCloudAssets": doDescribeOtherCloudAssets,
|
2588
3266
|
"DescribeListenerList": doDescribeListenerList,
|
2589
3267
|
"DescribeOrganizationUserInfo": doDescribeOrganizationUserInfo,
|
2590
3268
|
"DeleteRiskScanTask": doDeleteRiskScanTask,
|
@@ -2596,15 +3274,19 @@ ACTION_MAP = {
|
|
2596
3274
|
"DescribeRiskCenterServerRiskList": doDescribeRiskCenterServerRiskList,
|
2597
3275
|
"DescribeCVMAssets": doDescribeCVMAssets,
|
2598
3276
|
"ModifyRiskCenterScanTask": doModifyRiskCenterScanTask,
|
2599
|
-
"
|
3277
|
+
"DescribeCFWAssetStatistics": doDescribeCFWAssetStatistics,
|
2600
3278
|
"DescribeAssetViewVulRiskList": doDescribeAssetViewVulRiskList,
|
2601
3279
|
"DescribeVULRiskDetail": doDescribeVULRiskDetail,
|
3280
|
+
"DescribeCheckViewRisks": doDescribeCheckViewRisks,
|
2602
3281
|
"DescribeRiskCenterWebsiteRiskList": doDescribeRiskCenterWebsiteRiskList,
|
2603
|
-
"
|
3282
|
+
"DescribeOrganizationInfo": doDescribeOrganizationInfo,
|
2604
3283
|
"StopRiskCenterTask": doStopRiskCenterTask,
|
3284
|
+
"DescribeAssetRiskList": doDescribeAssetRiskList,
|
2605
3285
|
"ModifyUebaRuleSwitch": doModifyUebaRuleSwitch,
|
2606
|
-
"
|
3286
|
+
"DescribeRiskRules": doDescribeRiskRules,
|
3287
|
+
"DescribeExposePath": doDescribeExposePath,
|
2607
3288
|
"DescribeGatewayAssets": doDescribeGatewayAssets,
|
3289
|
+
"DescribeCSIPRiskStatistics": doDescribeCSIPRiskStatistics,
|
2608
3290
|
"DescribeSearchBugInfo": doDescribeSearchBugInfo,
|
2609
3291
|
"DescribeRiskCenterAssetViewWeakPasswordRiskList": doDescribeRiskCenterAssetViewWeakPasswordRiskList,
|
2610
3292
|
"DescribeVulViewVulRiskList": doDescribeVulViewVulRiskList,
|
@@ -2613,17 +3295,24 @@ ACTION_MAP = {
|
|
2613
3295
|
"DescribeAlertList": doDescribeAlertList,
|
2614
3296
|
"ModifyRiskCenterRiskStatus": doModifyRiskCenterRiskStatus,
|
2615
3297
|
"UpdateAlertStatusList": doUpdateAlertStatusList,
|
3298
|
+
"DescribeScanStatistic": doDescribeScanStatistic,
|
3299
|
+
"DescribeExposeAssetCategory": doDescribeExposeAssetCategory,
|
2616
3300
|
"DescribeScanTaskList": doDescribeScanTaskList,
|
2617
|
-
"
|
3301
|
+
"CreateRiskCenterScanTask": doCreateRiskCenterScanTask,
|
2618
3302
|
"DescribeRiskCenterPortViewPortRiskList": doDescribeRiskCenterPortViewPortRiskList,
|
2619
3303
|
"DescribeRiskCenterAssetViewPortRiskList": doDescribeRiskCenterAssetViewPortRiskList,
|
2620
3304
|
"DescribeVULRiskAdvanceCFGList": doDescribeVULRiskAdvanceCFGList,
|
2621
3305
|
"DescribeExposures": doDescribeExposures,
|
3306
|
+
"DescribeRiskDetailList": doDescribeRiskDetailList,
|
2622
3307
|
"CreateDomainAndIp": doCreateDomainAndIp,
|
2623
3308
|
"ModifyOrganizationAccountStatus": doModifyOrganizationAccountStatus,
|
3309
|
+
"DescribeSubnetAssets": doDescribeSubnetAssets,
|
3310
|
+
"DescribeRiskCenterCFGViewCFGRiskList": doDescribeRiskCenterCFGViewCFGRiskList,
|
2624
3311
|
"DescribeTopAttackInfo": doDescribeTopAttackInfo,
|
2625
3312
|
"DescribeClusterAssets": doDescribeClusterAssets,
|
2626
3313
|
"DescribeTaskLogURL": doDescribeTaskLogURL,
|
3314
|
+
"DescribeRepositoryImageAssets": doDescribeRepositoryImageAssets,
|
3315
|
+
"DescribeDbAssets": doDescribeDbAssets,
|
2627
3316
|
"DescribeCVMAssetInfo": doDescribeCVMAssetInfo,
|
2628
3317
|
|
2629
3318
|
}
|