tccli 3.0.1380.1__py2.py3-none-any.whl → 3.0.1382.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/autoscaling/v20180419/api.json +27 -27
- tccli/services/ckafka/v20190819/api.json +174 -174
- tccli/services/ckafka/v20190819/examples.json +15 -15
- tccli/services/gs/v20191118/api.json +30 -1
- tccli/services/ioa/v20220601/api.json +22 -13
- tccli/services/iotexplorer/v20190423/api.json +1 -1
- tccli/services/lighthouse/lighthouse_client.py +375 -4
- tccli/services/lighthouse/v20200324/api.json +598 -0
- tccli/services/lighthouse/v20200324/examples.json +56 -0
- tccli/services/lke/v20231130/api.json +91 -8
- tccli/services/lkeap/v20240522/api.json +47 -1
- tccli/services/lkeap/v20240522/examples.json +6 -0
- tccli/services/mna/mna_client.py +53 -0
- tccli/services/mna/v20210119/api.json +137 -0
- tccli/services/mna/v20210119/examples.json +8 -0
- tccli/services/monitor/v20180724/api.json +2 -2
- tccli/services/mqtt/v20240516/api.json +1 -1
- tccli/services/oceanus/v20190422/api.json +105 -17
- tccli/services/omics/v20221128/api.json +1 -1
- tccli/services/redis/v20180412/api.json +3 -3
- tccli/services/redis/v20180412/examples.json +1 -1
- tccli/services/tcb/v20180608/api.json +10 -0
- tccli/services/tcbr/v20220217/api.json +10 -0
- tccli/services/teo/v20220901/api.json +6 -6
- tccli/services/thpc/v20230321/api.json +18 -14
- tccli/services/tke/v20180525/api.json +11 -11
- tccli/services/trtc/v20190722/api.json +4 -4
- tccli/services/tsf/v20180326/api.json +28 -28
- tccli/services/waf/v20180125/api.json +1442 -102
- tccli/services/waf/v20180125/examples.json +48 -0
- tccli/services/waf/waf_client.py +338 -20
- {tccli-3.0.1380.1.dist-info → tccli-3.0.1382.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1380.1.dist-info → tccli-3.0.1382.1.dist-info}/RECORD +37 -37
- {tccli-3.0.1380.1.dist-info → tccli-3.0.1382.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1380.1.dist-info → tccli-3.0.1382.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1380.1.dist-info → tccli-3.0.1382.1.dist-info}/license_files/LICENSE +0 -0
@@ -102,6 +102,14 @@
|
|
102
102
|
"title": "样例"
|
103
103
|
}
|
104
104
|
],
|
105
|
+
"CreateExport": [
|
106
|
+
{
|
107
|
+
"document": "本接口仅创建下载任务,任务返回的下载地址,请用户调用DescribeExports查看任务列表。其中有下载地址CosPath参数。",
|
108
|
+
"input": "POST / HTTP/1.1\nHost: cls.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateExport\n<公共请求参数>\n\n{\n \"TopicId\": \"ee20bb16-3025-4048-b81a-dd436373062e\",\n \"Query\": \"status:200\",\n \"Count\": 100,\n \"Order\": \"desc\",\n \"Format\": \"json\",\n \"From\": 1607499107000,\n \"To\": 1607499207000\n}",
|
109
|
+
"output": "{\n \"Response\": {\n \"ExportId\": \"57196a6a-7622-47be-bc92-d2ebea959a0f\",\n \"RequestId\": \"6ef60bec-0242-43af-bb20-270359fb54a7\"\n }\n}",
|
110
|
+
"title": "创建日志导出"
|
111
|
+
}
|
112
|
+
],
|
105
113
|
"CreateHost": [
|
106
114
|
{
|
107
115
|
"document": "",
|
@@ -228,6 +236,14 @@
|
|
228
236
|
"title": "删除域名规则白名单"
|
229
237
|
}
|
230
238
|
],
|
239
|
+
"DeleteExport": [
|
240
|
+
{
|
241
|
+
"document": "",
|
242
|
+
"input": "POST / HTTP/1.1\nHost: cls.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DeleteExport\n<公共请求参数>\n\n{\n \"ExportId\": \"57196a6a-7622-47be-bc92-d2ebea959a0f\"\n}",
|
243
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"6ef60bec-0242-43af-bb20-270359fb54a7\"\n }\n}",
|
244
|
+
"title": "删除日志导出"
|
245
|
+
}
|
246
|
+
],
|
231
247
|
"DeleteHost": [
|
232
248
|
{
|
233
249
|
"document": "",
|
@@ -566,6 +582,14 @@
|
|
566
582
|
"title": "查询用户SAASWAF某个实例的域名信息"
|
567
583
|
}
|
568
584
|
],
|
585
|
+
"DescribeExports": [
|
586
|
+
{
|
587
|
+
"document": "",
|
588
|
+
"input": "POST / HTTP/1.1\nHost: cls.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeExports\n<公共请求参数>\n\n{\n \"TopicId\": \"ee20bb16-3025-4048-b81a-dd436373062e\",\n \"Offset\": 0,\n \"Limit\": 5\n}",
|
589
|
+
"output": "{\n \"Response\": {\n \"Exports\": [\n {\n \"TopicId\": \"ee20bb16-3025-4048-b81a-dd436373062e\",\n \"ExportId\": \"export-57196a6a-7622-47be-bc92-d2ebea959a0f\",\n \"Query\": \"status:200\",\n \"FileName\": \"log_2075178708_ee20bb16-3025-4048-b81a-dd436373062f_20210107_xxxxxx_1610001073.tar.gz\",\n \"CosPath\": \"https://clstest01-xxxxxx.cos.ap-shanghai.myqcloud.com/xxxxxx\",\n \"FileSize\": 6112993,\n \"Order\": \"desc\",\n \"Format\": \"json\",\n \"Count\": 100000,\n \"Status\": \"Completed\",\n \"From\": 1607499207000,\n \"To\": 1607499207000,\n \"CreateTime\": \"2020-08-08 12:12:12\",\n \"SyntaxRule\": 1\n }\n ],\n \"TotalCount\": 1,\n \"RequestId\": \"6ef60bec-0242-43af-bb20-270359fb54a7\"\n }\n}",
|
590
|
+
"title": "获取日志导出列表"
|
591
|
+
}
|
592
|
+
],
|
569
593
|
"DescribeFindDomainList": [
|
570
594
|
{
|
571
595
|
"document": "",
|
@@ -638,6 +662,14 @@
|
|
638
662
|
"title": "Waf IP封堵状态查询"
|
639
663
|
}
|
640
664
|
],
|
665
|
+
"DescribeLogHistogram": [
|
666
|
+
{
|
667
|
+
"document": "根据指定的检索条件,获取符合检索条件的日志分布直方图",
|
668
|
+
"input": "POST / HTTP/1.1\nHost: cls.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeLogHistogram\n<公共请求参数>\n\n{\n \"From\": 1685086740862,\n \"To\": 1685087640862,\n \"Interval\": 30000,\n \"TopicId\": \"2e7b5c4d-1be3-484a-xxxx-8705adb56dcd\",\n \"Query\": \"\",\n \"SyntaxRule\": 1\n}",
|
669
|
+
"output": "{\n \"Response\": {\n \"TotalCount\": 14,\n \"Interval\": 30000,\n \"HistogramInfos\": [\n {\n \"Count\": 0,\n \"BTime\": 1685086740000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685086770000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685086800000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685086830000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685086860000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685086890000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685086920000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685086950000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685086980000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087010000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087040000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087070000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087100000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087130000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087160000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087190000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087220000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087250000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087280000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087310000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087340000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087370000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087400000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087430000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087460000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087490000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087520000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087550000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087580000\n },\n {\n \"Count\": 14,\n \"BTime\": 1685087610000\n },\n {\n \"Count\": 0,\n \"BTime\": 1685087640000\n }\n ],\n \"RequestId\": \"4279ae1f-cbd6-438b-xxxx-6df5a8152afd\"\n }\n}",
|
670
|
+
"title": "获取日志分布直方图"
|
671
|
+
}
|
672
|
+
],
|
641
673
|
"DescribeModuleStatus": [
|
642
674
|
{
|
643
675
|
"document": "",
|
@@ -782,6 +814,14 @@
|
|
782
814
|
"title": "查询Top5的攻击域名"
|
783
815
|
}
|
784
816
|
],
|
817
|
+
"DescribeTopics": [
|
818
|
+
{
|
819
|
+
"document": "获取日志主题列表",
|
820
|
+
"input": "POST / HTTP/1.1\nHost: cls.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeTopics\n<公共请求参数>\n\n{\n \"Filters\": [],\n \"Offset\": 10,\n \"Limit\": 30\n}",
|
821
|
+
"output": "{\n \"Response\": {\n \"Topics\": [\n {\n \"LogsetId\": \"46c34030-f7fd-xxxx-91ee-053215c2bf9c\",\n \"TopicId\": \"305f8be8-25a9-xxxx-8f05-361dafab39fe\",\n \"TopicName\": \"attack-log\",\n \"PartitionCount\": 1,\n \"Index\": true,\n \"AssumerName\": \"\",\n \"SubAssumerName\": \"\",\n \"CreateTime\": \"2022-12-30 16:02:52\",\n \"Status\": true,\n \"Tags\": [],\n \"AutoSplit\": true,\n \"MaxSplitPartitions\": 50,\n \"StorageType\": \"hot\",\n \"Period\": 27,\n \"Describes\": \"\",\n \"HotPeriod\": 0,\n \"BizType\": 0,\n \"IsWebTracking\": false,\n \"Extends\": {\n \"AnonymousAccess\": null\n }\n }\n ],\n \"RequestId\": \"cdb48d76-9be0-xxxx-8654-56290de7442e\",\n \"TotalCount\": 1\n }\n}",
|
822
|
+
"title": "获取日志主题列表"
|
823
|
+
}
|
824
|
+
],
|
785
825
|
"DescribeUserCdcClbWafRegions": [
|
786
826
|
{
|
787
827
|
"document": "",
|
@@ -1424,6 +1464,14 @@
|
|
1424
1464
|
"title": "搜索攻击日志详情内容"
|
1425
1465
|
}
|
1426
1466
|
],
|
1467
|
+
"SearchLog": [
|
1468
|
+
{
|
1469
|
+
"document": "查询http响应状态码(http_code)为200的日志",
|
1470
|
+
"input": "POST / HTTP/1.1\nHost: cls.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: SearchLog\n<公共请求参数>\n\n{\n \"TopicId\": \"601c2a87-ca8e-49c9-xxxx-27286a970db5\",\n \"From\": 1679901909686,\n \"To\": 1679902809686,\n \"Query\": \"http_code:\\\"200\\\"\",\n \"Limit\": 1,\n \"Sort\": \"desc\",\n \"UseNewAnalysis\": true,\n \"SyntaxRule\": 1\n}",
|
1471
|
+
"output": "{\n \"Response\": {\n \"Context\": \"Y29udGV4dC0zZDVmZGI2NC1jNDZkLTQ2NzktYWM2OC1jYzg2NjUxYmVlMWExNjc5OTAyODEwNDM0\",\n \"ListOver\": false,\n \"Analysis\": false,\n \"ColNames\": [],\n \"Columns\": null,\n \"Results\": [\n {\n \"Time\": 1679902806070,\n \"TopicId\": \"601c2a87-ca8e-49c9-xxxx-27286a970db5\",\n \"TopicName\": \"CDN Demo访问日志日志主题_10000100xxxx\",\n \"Source\": \"\",\n \"FileName\": \"\",\n \"HostName\": \"\",\n \"PkgId\": \"\",\n \"PkgLogId\": \"\",\n \"LogJson\": \"{\\\"referer\\\":\\\"http://qwunsag.2022.qq.com/prizes?activity_code=AVGCHaQFX02Eb\\\",\\\"method\\\":\\\"GET\\\",\\\"isp\\\":\\\"中国联通\\\",\\\"remote_port\\\":\\\"45088\\\",\\\"ua\\\":\\\"Mozilla/5.0 (Linux; Android 9; INE-AL00 Build/HUAWEIINE-AL00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 XWEB/3211 MMWEBSDK/20210601 Mobile Safari/537.36 MMWEBID/6389 MicroMessenger/8.0.11.1980(0x28000B5B) Process/toolsmp WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64\\\",\\\"uuid\\\":\\\"acf1010c853f4a24bb3e92cc34e283e2\\\",\\\"version\\\":\\\"1\\\",\\\"file_size\\\":\\\"186358\\\",\\\"url\\\":\\\"/loxtxt/979884858.png\\\",\\\"request_range\\\":\\\"-\\\",\\\"rsp_size\\\":\\\"186830\\\",\\\"hit\\\":\\\"hit\\\",\\\"request_time\\\":\\\"2808\\\",\\\"http_code\\\":\\\"200\\\",\\\"param\\\":\\\"-\\\",\\\"sys_address\\\":\\\"9.130.154.208\\\",\\\"proto\\\":\\\"HTTPS\\\",\\\"host\\\":\\\"test.2022.cls.cn\\\",\\\"sys_datasource\\\":\\\"cq.3.4.v1.2.17\\\",\\\"client_ip\\\":\\\"116.116.247.167\\\",\\\"time\\\":\\\"1679902806070\\\",\\\"app_id\\\":\\\"1302700768\\\",\\\"prov\\\":\\\"内蒙古自治区\\\",\\\"timestamp\\\":\\\"2023-03-27T15:40:06+08:00\\\"}\",\n \"RawLog\": \"\",\n \"IndexStatus\": \"\"\n }\n ],\n \"AnalysisResults\": [],\n \"AnalysisRecords\": null,\n \"RequestId\": \"79f593e5-1374-4463-xxxx-c49d0b3c5290\",\n \"SamplingRate\": 0\n }\n}",
|
1472
|
+
"title": "查询日志"
|
1473
|
+
}
|
1474
|
+
],
|
1427
1475
|
"SwitchDomainRules": [
|
1428
1476
|
{
|
1429
1477
|
"document": "切换域名的规则开关",
|
tccli/services/waf/waf_client.py
CHANGED
@@ -173,6 +173,58 @@ def doDescribeDomainDetailsClb(args, parsed_globals):
|
|
173
173
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
174
174
|
|
175
175
|
|
176
|
+
def doDescribeExports(args, parsed_globals):
|
177
|
+
g_param = parse_global_arg(parsed_globals)
|
178
|
+
|
179
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
180
|
+
cred = credential.CVMRoleCredential()
|
181
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
182
|
+
cred = credential.STSAssumeRoleCredential(
|
183
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
184
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
185
|
+
)
|
186
|
+
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):
|
187
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
188
|
+
else:
|
189
|
+
cred = credential.Credential(
|
190
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
191
|
+
)
|
192
|
+
http_profile = HttpProfile(
|
193
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
194
|
+
reqMethod="POST",
|
195
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
196
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
197
|
+
)
|
198
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
199
|
+
if g_param[OptionsDefine.Language]:
|
200
|
+
profile.language = g_param[OptionsDefine.Language]
|
201
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
202
|
+
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
203
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
204
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
205
|
+
model = models.DescribeExportsRequest()
|
206
|
+
model.from_json_string(json.dumps(args))
|
207
|
+
start_time = time.time()
|
208
|
+
while True:
|
209
|
+
rsp = client.DescribeExports(model)
|
210
|
+
result = rsp.to_json_string()
|
211
|
+
try:
|
212
|
+
json_obj = json.loads(result)
|
213
|
+
except TypeError as e:
|
214
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
215
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
216
|
+
break
|
217
|
+
cur_time = time.time()
|
218
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
219
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
220
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
221
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
222
|
+
else:
|
223
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
224
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
225
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
226
|
+
|
227
|
+
|
176
228
|
def doAddAntiInfoLeakRules(args, parsed_globals):
|
177
229
|
g_param = parse_global_arg(parsed_globals)
|
178
230
|
|
@@ -1057,6 +1109,58 @@ def doDescribeScanIp(args, parsed_globals):
|
|
1057
1109
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1058
1110
|
|
1059
1111
|
|
1112
|
+
def doModifyObject(args, parsed_globals):
|
1113
|
+
g_param = parse_global_arg(parsed_globals)
|
1114
|
+
|
1115
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1116
|
+
cred = credential.CVMRoleCredential()
|
1117
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1118
|
+
cred = credential.STSAssumeRoleCredential(
|
1119
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1120
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1121
|
+
)
|
1122
|
+
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):
|
1123
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1124
|
+
else:
|
1125
|
+
cred = credential.Credential(
|
1126
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1127
|
+
)
|
1128
|
+
http_profile = HttpProfile(
|
1129
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1130
|
+
reqMethod="POST",
|
1131
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1132
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1133
|
+
)
|
1134
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1135
|
+
if g_param[OptionsDefine.Language]:
|
1136
|
+
profile.language = g_param[OptionsDefine.Language]
|
1137
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1138
|
+
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
1139
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1140
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1141
|
+
model = models.ModifyObjectRequest()
|
1142
|
+
model.from_json_string(json.dumps(args))
|
1143
|
+
start_time = time.time()
|
1144
|
+
while True:
|
1145
|
+
rsp = client.ModifyObject(model)
|
1146
|
+
result = rsp.to_json_string()
|
1147
|
+
try:
|
1148
|
+
json_obj = json.loads(result)
|
1149
|
+
except TypeError as e:
|
1150
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1151
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1152
|
+
break
|
1153
|
+
cur_time = time.time()
|
1154
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1155
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1156
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1157
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1158
|
+
else:
|
1159
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1160
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1161
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1162
|
+
|
1163
|
+
|
1060
1164
|
def doDeleteOwaspRuleStatus(args, parsed_globals):
|
1061
1165
|
g_param = parse_global_arg(parsed_globals)
|
1062
1166
|
|
@@ -1369,7 +1473,7 @@ def doModifyInstanceElasticMode(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 doDescribeTopics(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 doDescribeUserCdcClbWafRegions(args, parsed_globals):
|
|
1398
1502
|
client = mod.WafClient(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.DescribeTopicsRequest()
|
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.DescribeTopics(model)
|
1406
1510
|
result = rsp.to_json_string()
|
1407
1511
|
try:
|
1408
1512
|
json_obj = json.loads(result)
|
@@ -1837,7 +1941,7 @@ def doDescribeIpHitItems(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 doCreateExport(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 doDescribeOwaspRuleTypes(args, parsed_globals):
|
|
1866
1970
|
client = mod.WafClient(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.CreateExportRequest()
|
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.CreateExport(model)
|
1874
1978
|
result = rsp.to_json_string()
|
1875
1979
|
try:
|
1876
1980
|
json_obj = json.loads(result)
|
@@ -3501,7 +3605,7 @@ def doDescribeCCRule(args, parsed_globals):
|
|
3501
3605
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3502
3606
|
|
3503
3607
|
|
3504
|
-
def
|
3608
|
+
def doDescribeLogHistogram(args, parsed_globals):
|
3505
3609
|
g_param = parse_global_arg(parsed_globals)
|
3506
3610
|
|
3507
3611
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -3530,11 +3634,11 @@ def doDescribeUserLevel(args, parsed_globals):
|
|
3530
3634
|
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
3531
3635
|
client._sdkVersion += ("_CLI_" + __version__)
|
3532
3636
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3533
|
-
model = models.
|
3637
|
+
model = models.DescribeLogHistogramRequest()
|
3534
3638
|
model.from_json_string(json.dumps(args))
|
3535
3639
|
start_time = time.time()
|
3536
3640
|
while True:
|
3537
|
-
rsp = client.
|
3641
|
+
rsp = client.DescribeLogHistogram(model)
|
3538
3642
|
result = rsp.to_json_string()
|
3539
3643
|
try:
|
3540
3644
|
json_obj = json.loads(result)
|
@@ -3709,6 +3813,58 @@ def doModifyWafThreatenIntelligence(args, parsed_globals):
|
|
3709
3813
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3710
3814
|
|
3711
3815
|
|
3816
|
+
def doDescribeOwaspRuleTypes(args, parsed_globals):
|
3817
|
+
g_param = parse_global_arg(parsed_globals)
|
3818
|
+
|
3819
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
3820
|
+
cred = credential.CVMRoleCredential()
|
3821
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
3822
|
+
cred = credential.STSAssumeRoleCredential(
|
3823
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
3824
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
3825
|
+
)
|
3826
|
+
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):
|
3827
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
3828
|
+
else:
|
3829
|
+
cred = credential.Credential(
|
3830
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
3831
|
+
)
|
3832
|
+
http_profile = HttpProfile(
|
3833
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
3834
|
+
reqMethod="POST",
|
3835
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
3836
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
3837
|
+
)
|
3838
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
3839
|
+
if g_param[OptionsDefine.Language]:
|
3840
|
+
profile.language = g_param[OptionsDefine.Language]
|
3841
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
3842
|
+
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
3843
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
3844
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
3845
|
+
model = models.DescribeOwaspRuleTypesRequest()
|
3846
|
+
model.from_json_string(json.dumps(args))
|
3847
|
+
start_time = time.time()
|
3848
|
+
while True:
|
3849
|
+
rsp = client.DescribeOwaspRuleTypes(model)
|
3850
|
+
result = rsp.to_json_string()
|
3851
|
+
try:
|
3852
|
+
json_obj = json.loads(result)
|
3853
|
+
except TypeError as e:
|
3854
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
3855
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
3856
|
+
break
|
3857
|
+
cur_time = time.time()
|
3858
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
3859
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
3860
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
3861
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
3862
|
+
else:
|
3863
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
3864
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
3865
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3866
|
+
|
3867
|
+
|
3712
3868
|
def doDeleteAttackDownloadRecord(args, parsed_globals):
|
3713
3869
|
g_param = parse_global_arg(parsed_globals)
|
3714
3870
|
|
@@ -3865,6 +4021,58 @@ def doDescribeAttackOverview(args, parsed_globals):
|
|
3865
4021
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
3866
4022
|
|
3867
4023
|
|
4024
|
+
def doDescribeUserLevel(args, parsed_globals):
|
4025
|
+
g_param = parse_global_arg(parsed_globals)
|
4026
|
+
|
4027
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
4028
|
+
cred = credential.CVMRoleCredential()
|
4029
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
4030
|
+
cred = credential.STSAssumeRoleCredential(
|
4031
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
4032
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
4033
|
+
)
|
4034
|
+
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):
|
4035
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
4036
|
+
else:
|
4037
|
+
cred = credential.Credential(
|
4038
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
4039
|
+
)
|
4040
|
+
http_profile = HttpProfile(
|
4041
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
4042
|
+
reqMethod="POST",
|
4043
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
4044
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
4045
|
+
)
|
4046
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
4047
|
+
if g_param[OptionsDefine.Language]:
|
4048
|
+
profile.language = g_param[OptionsDefine.Language]
|
4049
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
4050
|
+
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
4051
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
4052
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
4053
|
+
model = models.DescribeUserLevelRequest()
|
4054
|
+
model.from_json_string(json.dumps(args))
|
4055
|
+
start_time = time.time()
|
4056
|
+
while True:
|
4057
|
+
rsp = client.DescribeUserLevel(model)
|
4058
|
+
result = rsp.to_json_string()
|
4059
|
+
try:
|
4060
|
+
json_obj = json.loads(result)
|
4061
|
+
except TypeError as e:
|
4062
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
4063
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
4064
|
+
break
|
4065
|
+
cur_time = time.time()
|
4066
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
4067
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
4068
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
4069
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
4070
|
+
else:
|
4071
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
4072
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
4073
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
4074
|
+
|
4075
|
+
|
3868
4076
|
def doModifyOwaspWhiteRule(args, parsed_globals):
|
3869
4077
|
g_param = parse_global_arg(parsed_globals)
|
3870
4078
|
|
@@ -6517,7 +6725,7 @@ def doDestroyPostCKafkaFlow(args, parsed_globals):
|
|
6517
6725
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
6518
6726
|
|
6519
6727
|
|
6520
|
-
def
|
6728
|
+
def doDeleteExport(args, parsed_globals):
|
6521
6729
|
g_param = parse_global_arg(parsed_globals)
|
6522
6730
|
|
6523
6731
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -6546,11 +6754,11 @@ def doPostAttackDownloadTask(args, parsed_globals):
|
|
6546
6754
|
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
6547
6755
|
client._sdkVersion += ("_CLI_" + __version__)
|
6548
6756
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
6549
|
-
model = models.
|
6757
|
+
model = models.DeleteExportRequest()
|
6550
6758
|
model.from_json_string(json.dumps(args))
|
6551
6759
|
start_time = time.time()
|
6552
6760
|
while True:
|
6553
|
-
rsp = client.
|
6761
|
+
rsp = client.DeleteExport(model)
|
6554
6762
|
result = rsp.to_json_string()
|
6555
6763
|
try:
|
6556
6764
|
json_obj = json.loads(result)
|
@@ -7817,6 +8025,58 @@ def doModifyAreaBanRule(args, parsed_globals):
|
|
7817
8025
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
7818
8026
|
|
7819
8027
|
|
8028
|
+
def doDescribeUserCdcClbWafRegions(args, parsed_globals):
|
8029
|
+
g_param = parse_global_arg(parsed_globals)
|
8030
|
+
|
8031
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
8032
|
+
cred = credential.CVMRoleCredential()
|
8033
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
8034
|
+
cred = credential.STSAssumeRoleCredential(
|
8035
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
8036
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
8037
|
+
)
|
8038
|
+
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):
|
8039
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
8040
|
+
else:
|
8041
|
+
cred = credential.Credential(
|
8042
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
8043
|
+
)
|
8044
|
+
http_profile = HttpProfile(
|
8045
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
8046
|
+
reqMethod="POST",
|
8047
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
8048
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
8049
|
+
)
|
8050
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
8051
|
+
if g_param[OptionsDefine.Language]:
|
8052
|
+
profile.language = g_param[OptionsDefine.Language]
|
8053
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
8054
|
+
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
8055
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
8056
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
8057
|
+
model = models.DescribeUserCdcClbWafRegionsRequest()
|
8058
|
+
model.from_json_string(json.dumps(args))
|
8059
|
+
start_time = time.time()
|
8060
|
+
while True:
|
8061
|
+
rsp = client.DescribeUserCdcClbWafRegions(model)
|
8062
|
+
result = rsp.to_json_string()
|
8063
|
+
try:
|
8064
|
+
json_obj = json.loads(result)
|
8065
|
+
except TypeError as e:
|
8066
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
8067
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
8068
|
+
break
|
8069
|
+
cur_time = time.time()
|
8070
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
8071
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
8072
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
8073
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
8074
|
+
else:
|
8075
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
8076
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
8077
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
8078
|
+
|
8079
|
+
|
7820
8080
|
def doDescribeWafAutoDenyStatus(args, parsed_globals):
|
7821
8081
|
g_param = parse_global_arg(parsed_globals)
|
7822
8082
|
|
@@ -7973,6 +8233,58 @@ def doModifyCustomWhiteRuleStatus(args, parsed_globals):
|
|
7973
8233
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
7974
8234
|
|
7975
8235
|
|
8236
|
+
def doPostAttackDownloadTask(args, parsed_globals):
|
8237
|
+
g_param = parse_global_arg(parsed_globals)
|
8238
|
+
|
8239
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
8240
|
+
cred = credential.CVMRoleCredential()
|
8241
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
8242
|
+
cred = credential.STSAssumeRoleCredential(
|
8243
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
8244
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
8245
|
+
)
|
8246
|
+
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):
|
8247
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
8248
|
+
else:
|
8249
|
+
cred = credential.Credential(
|
8250
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
8251
|
+
)
|
8252
|
+
http_profile = HttpProfile(
|
8253
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
8254
|
+
reqMethod="POST",
|
8255
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
8256
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
8257
|
+
)
|
8258
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
8259
|
+
if g_param[OptionsDefine.Language]:
|
8260
|
+
profile.language = g_param[OptionsDefine.Language]
|
8261
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
8262
|
+
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
8263
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
8264
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
8265
|
+
model = models.PostAttackDownloadTaskRequest()
|
8266
|
+
model.from_json_string(json.dumps(args))
|
8267
|
+
start_time = time.time()
|
8268
|
+
while True:
|
8269
|
+
rsp = client.PostAttackDownloadTask(model)
|
8270
|
+
result = rsp.to_json_string()
|
8271
|
+
try:
|
8272
|
+
json_obj = json.loads(result)
|
8273
|
+
except TypeError as e:
|
8274
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
8275
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
8276
|
+
break
|
8277
|
+
cur_time = time.time()
|
8278
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
8279
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
8280
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
8281
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
8282
|
+
else:
|
8283
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
8284
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
8285
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
8286
|
+
|
8287
|
+
|
7976
8288
|
def doDescribePorts(args, parsed_globals):
|
7977
8289
|
g_param = parse_global_arg(parsed_globals)
|
7978
8290
|
|
@@ -8233,7 +8545,7 @@ def doUpsertCCRule(args, parsed_globals):
|
|
8233
8545
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
8234
8546
|
|
8235
8547
|
|
8236
|
-
def
|
8548
|
+
def doSearchLog(args, parsed_globals):
|
8237
8549
|
g_param = parse_global_arg(parsed_globals)
|
8238
8550
|
|
8239
8551
|
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
@@ -8262,11 +8574,11 @@ def doModifyObject(args, parsed_globals):
|
|
8262
8574
|
client = mod.WafClient(cred, g_param[OptionsDefine.Region], profile)
|
8263
8575
|
client._sdkVersion += ("_CLI_" + __version__)
|
8264
8576
|
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
8265
|
-
model = models.
|
8577
|
+
model = models.SearchLogRequest()
|
8266
8578
|
model.from_json_string(json.dumps(args))
|
8267
8579
|
start_time = time.time()
|
8268
8580
|
while True:
|
8269
|
-
rsp = client.
|
8581
|
+
rsp = client.SearchLog(model)
|
8270
8582
|
result = rsp.to_json_string()
|
8271
8583
|
try:
|
8272
8584
|
json_obj = json.loads(result)
|
@@ -9183,6 +9495,7 @@ ACTION_MAP = {
|
|
9183
9495
|
"DescribeAttackType": doDescribeAttackType,
|
9184
9496
|
"DescribePeakPoints": doDescribePeakPoints,
|
9185
9497
|
"DescribeDomainDetailsClb": doDescribeDomainDetailsClb,
|
9498
|
+
"DescribeExports": doDescribeExports,
|
9186
9499
|
"AddAntiInfoLeakRules": doAddAntiInfoLeakRules,
|
9187
9500
|
"DescribeAccessIndex": doDescribeAccessIndex,
|
9188
9501
|
"GetAttackTotalCount": doGetAttackTotalCount,
|
@@ -9200,13 +9513,14 @@ ACTION_MAP = {
|
|
9200
9513
|
"GetAttackDownloadRecords": doGetAttackDownloadRecords,
|
9201
9514
|
"DescribeApiDetail": doDescribeApiDetail,
|
9202
9515
|
"DescribeScanIp": doDescribeScanIp,
|
9516
|
+
"ModifyObject": doModifyObject,
|
9203
9517
|
"DeleteOwaspRuleStatus": doDeleteOwaspRuleStatus,
|
9204
9518
|
"CreatePostCKafkaFlow": doCreatePostCKafkaFlow,
|
9205
9519
|
"DeleteCustomRule": doDeleteCustomRule,
|
9206
9520
|
"ModifyAntiFakeUrl": doModifyAntiFakeUrl,
|
9207
9521
|
"ModifySpartaProtection": doModifySpartaProtection,
|
9208
9522
|
"ModifyInstanceElasticMode": doModifyInstanceElasticMode,
|
9209
|
-
"
|
9523
|
+
"DescribeTopics": doDescribeTopics,
|
9210
9524
|
"ModifyWafAutoDenyRules": doModifyWafAutoDenyRules,
|
9211
9525
|
"DescribeUserDomainInfo": doDescribeUserDomainInfo,
|
9212
9526
|
"DeleteCCRule": doDeleteCCRule,
|
@@ -9215,7 +9529,7 @@ ACTION_MAP = {
|
|
9215
9529
|
"ModifyBotSceneUCBRule": doModifyBotSceneUCBRule,
|
9216
9530
|
"DescribeBotSceneUCBRule": doDescribeBotSceneUCBRule,
|
9217
9531
|
"DescribeIpHitItems": doDescribeIpHitItems,
|
9218
|
-
"
|
9532
|
+
"CreateExport": doCreateExport,
|
9219
9533
|
"DescribeHistogram": doDescribeHistogram,
|
9220
9534
|
"DescribeWebshellStatus": doDescribeWebshellStatus,
|
9221
9535
|
"DescribeDomainWhiteRules": doDescribeDomainWhiteRules,
|
@@ -9247,13 +9561,15 @@ ACTION_MAP = {
|
|
9247
9561
|
"SwitchElasticMode": doSwitchElasticMode,
|
9248
9562
|
"ModifyInstanceRenewFlag": doModifyInstanceRenewFlag,
|
9249
9563
|
"DescribeCCRule": doDescribeCCRule,
|
9250
|
-
"
|
9564
|
+
"DescribeLogHistogram": doDescribeLogHistogram,
|
9251
9565
|
"ModifyOwaspRuleTypeAction": doModifyOwaspRuleTypeAction,
|
9252
9566
|
"DescribePeakValue": doDescribePeakValue,
|
9253
9567
|
"ModifyWafThreatenIntelligence": doModifyWafThreatenIntelligence,
|
9568
|
+
"DescribeOwaspRuleTypes": doDescribeOwaspRuleTypes,
|
9254
9569
|
"DeleteAttackDownloadRecord": doDeleteAttackDownloadRecord,
|
9255
9570
|
"DescribeCustomRuleList": doDescribeCustomRuleList,
|
9256
9571
|
"DescribeAttackOverview": doDescribeAttackOverview,
|
9572
|
+
"DescribeUserLevel": doDescribeUserLevel,
|
9257
9573
|
"ModifyOwaspWhiteRule": doModifyOwaspWhiteRule,
|
9258
9574
|
"DescribeAttackWhiteRule": doDescribeAttackWhiteRule,
|
9259
9575
|
"DescribeHosts": doDescribeHosts,
|
@@ -9305,7 +9621,7 @@ ACTION_MAP = {
|
|
9305
9621
|
"CreateHost": doCreateHost,
|
9306
9622
|
"ModifyDomainsCLSStatus": doModifyDomainsCLSStatus,
|
9307
9623
|
"DestroyPostCKafkaFlow": doDestroyPostCKafkaFlow,
|
9308
|
-
"
|
9624
|
+
"DeleteExport": doDeleteExport,
|
9309
9625
|
"DescribeCustomWhiteRule": doDescribeCustomWhiteRule,
|
9310
9626
|
"DescribeHost": doDescribeHost,
|
9311
9627
|
"ModifyUserSignatureRuleV2": doModifyUserSignatureRuleV2,
|
@@ -9330,15 +9646,17 @@ ACTION_MAP = {
|
|
9330
9646
|
"ModifyModuleStatus": doModifyModuleStatus,
|
9331
9647
|
"ModifyApiAnalyzeStatus": doModifyApiAnalyzeStatus,
|
9332
9648
|
"ModifyAreaBanRule": doModifyAreaBanRule,
|
9649
|
+
"DescribeUserCdcClbWafRegions": doDescribeUserCdcClbWafRegions,
|
9333
9650
|
"DescribeWafAutoDenyStatus": doDescribeWafAutoDenyStatus,
|
9334
9651
|
"DescribeSession": doDescribeSession,
|
9335
9652
|
"ModifyCustomWhiteRuleStatus": doModifyCustomWhiteRuleStatus,
|
9653
|
+
"PostAttackDownloadTask": doPostAttackDownloadTask,
|
9336
9654
|
"DescribePorts": doDescribePorts,
|
9337
9655
|
"ModifyHostMode": doModifyHostMode,
|
9338
9656
|
"ModifyDomainPostAction": doModifyDomainPostAction,
|
9339
9657
|
"DescribeModuleStatus": doDescribeModuleStatus,
|
9340
9658
|
"UpsertCCRule": doUpsertCCRule,
|
9341
|
-
"
|
9659
|
+
"SearchLog": doSearchLog,
|
9342
9660
|
"DeleteAntiFakeUrl": doDeleteAntiFakeUrl,
|
9343
9661
|
"DescribeCCRuleList": doDescribeCCRuleList,
|
9344
9662
|
"ModifyWebshellStatus": doModifyWebshellStatus,
|