-
Notifications
You must be signed in to change notification settings - Fork 250
/
waf_client.py
3276 lines (2705 loc) · 126 KB
/
waf_client.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import json
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.common.abstract_client import AbstractClient
from tencentcloud.waf.v20180125 import models
class WafClient(AbstractClient):
_apiVersion = '2018-01-25'
_endpoint = 'waf.tencentcloudapi.com'
_service = 'waf'
def AddAntiFakeUrl(self, request):
"""添加防篡改url
:param request: Request instance for AddAntiFakeUrl.
:type request: :class:`tencentcloud.waf.v20180125.models.AddAntiFakeUrlRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.AddAntiFakeUrlResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("AddAntiFakeUrl", params, headers=headers)
response = json.loads(body)
model = models.AddAntiFakeUrlResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def AddAntiInfoLeakRules(self, request):
"""添加信息防泄漏规则
:param request: Request instance for AddAntiInfoLeakRules.
:type request: :class:`tencentcloud.waf.v20180125.models.AddAntiInfoLeakRulesRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.AddAntiInfoLeakRulesResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("AddAntiInfoLeakRules", params, headers=headers)
response = json.loads(body)
model = models.AddAntiInfoLeakRulesResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def AddAreaBanAreas(self, request):
"""添加地域封禁中的地域信息
:param request: Request instance for AddAreaBanAreas.
:type request: :class:`tencentcloud.waf.v20180125.models.AddAreaBanAreasRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.AddAreaBanAreasResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("AddAreaBanAreas", params, headers=headers)
response = json.loads(body)
model = models.AddAreaBanAreasResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def AddAttackWhiteRule(self, request):
"""供用户控制台调用,增加Tiga规则引擎白名单。
:param request: Request instance for AddAttackWhiteRule.
:type request: :class:`tencentcloud.waf.v20180125.models.AddAttackWhiteRuleRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.AddAttackWhiteRuleResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("AddAttackWhiteRule", params, headers=headers)
response = json.loads(body)
model = models.AddAttackWhiteRuleResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def AddCustomRule(self, request):
"""增加访问控制(自定义策略)
:param request: Request instance for AddCustomRule.
:type request: :class:`tencentcloud.waf.v20180125.models.AddCustomRuleRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.AddCustomRuleResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("AddCustomRule", params, headers=headers)
response = json.loads(body)
model = models.AddCustomRuleResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def AddCustomWhiteRule(self, request):
"""增加精准白名单规则
:param request: Request instance for AddCustomWhiteRule.
:type request: :class:`tencentcloud.waf.v20180125.models.AddCustomWhiteRuleRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.AddCustomWhiteRuleResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("AddCustomWhiteRule", params, headers=headers)
response = json.loads(body)
model = models.AddCustomWhiteRuleResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def AddDomainWhiteRule(self, request):
"""增加域名规则白名单
:param request: Request instance for AddDomainWhiteRule.
:type request: :class:`tencentcloud.waf.v20180125.models.AddDomainWhiteRuleRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.AddDomainWhiteRuleResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("AddDomainWhiteRule", params, headers=headers)
response = json.loads(body)
model = models.AddDomainWhiteRuleResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def AddSpartaProtection(self, request):
"""添加SaaS型WAF防护域名
:param request: Request instance for AddSpartaProtection.
:type request: :class:`tencentcloud.waf.v20180125.models.AddSpartaProtectionRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.AddSpartaProtectionResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("AddSpartaProtection", params, headers=headers)
response = json.loads(body)
model = models.AddSpartaProtectionResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def CreateAccessExport(self, request):
"""本接口用于创建访问日志导出
:param request: Request instance for CreateAccessExport.
:type request: :class:`tencentcloud.waf.v20180125.models.CreateAccessExportRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.CreateAccessExportResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("CreateAccessExport", params, headers=headers)
response = json.loads(body)
model = models.CreateAccessExportResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def CreateDeals(self, request):
"""计费资源购买、续费下单接口
:param request: Request instance for CreateDeals.
:type request: :class:`tencentcloud.waf.v20180125.models.CreateDealsRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.CreateDealsResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("CreateDeals", params, headers=headers)
response = json.loads(body)
model = models.CreateDealsResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def CreateHost(self, request):
"""clb-waf中添加防护域名
:param request: Request instance for CreateHost.
:type request: :class:`tencentcloud.waf.v20180125.models.CreateHostRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.CreateHostResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("CreateHost", params, headers=headers)
response = json.loads(body)
model = models.CreateHostResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def CreateIpAccessControl(self, request):
"""Waf IP黑白名单新增接口
:param request: Request instance for CreateIpAccessControl.
:type request: :class:`tencentcloud.waf.v20180125.models.CreateIpAccessControlRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.CreateIpAccessControlResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("CreateIpAccessControl", params, headers=headers)
response = json.loads(body)
model = models.CreateIpAccessControlResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteAccessExport(self, request):
"""本接口用于删除访问日志导出
:param request: Request instance for DeleteAccessExport.
:type request: :class:`tencentcloud.waf.v20180125.models.DeleteAccessExportRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DeleteAccessExportResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteAccessExport", params, headers=headers)
response = json.loads(body)
model = models.DeleteAccessExportResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteAntiFakeUrl(self, request):
"""删除防篡改url
:param request: Request instance for DeleteAntiFakeUrl.
:type request: :class:`tencentcloud.waf.v20180125.models.DeleteAntiFakeUrlRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DeleteAntiFakeUrlResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteAntiFakeUrl", params, headers=headers)
response = json.loads(body)
model = models.DeleteAntiFakeUrlResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteAntiInfoLeakRule(self, request):
"""信息防泄漏删除规则
:param request: Request instance for DeleteAntiInfoLeakRule.
:type request: :class:`tencentcloud.waf.v20180125.models.DeleteAntiInfoLeakRuleRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DeleteAntiInfoLeakRuleResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteAntiInfoLeakRule", params, headers=headers)
response = json.loads(body)
model = models.DeleteAntiInfoLeakRuleResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteAttackDownloadRecord(self, request):
"""删除攻击日志下载任务记录
:param request: Request instance for DeleteAttackDownloadRecord.
:type request: :class:`tencentcloud.waf.v20180125.models.DeleteAttackDownloadRecordRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DeleteAttackDownloadRecordResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteAttackDownloadRecord", params, headers=headers)
response = json.loads(body)
model = models.DeleteAttackDownloadRecordResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteAttackWhiteRule(self, request):
"""供用户控制台调用,删除Tiga规则引擎白名单。
:param request: Request instance for DeleteAttackWhiteRule.
:type request: :class:`tencentcloud.waf.v20180125.models.DeleteAttackWhiteRuleRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DeleteAttackWhiteRuleResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteAttackWhiteRule", params, headers=headers)
response = json.loads(body)
model = models.DeleteAttackWhiteRuleResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteCCRule(self, request):
"""Waf CC V2 Delete接口
:param request: Request instance for DeleteCCRule.
:type request: :class:`tencentcloud.waf.v20180125.models.DeleteCCRuleRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DeleteCCRuleResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteCCRule", params, headers=headers)
response = json.loads(body)
model = models.DeleteCCRuleResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteCustomRule(self, request):
"""删除自定义规则
:param request: Request instance for DeleteCustomRule.
:type request: :class:`tencentcloud.waf.v20180125.models.DeleteCustomRuleRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DeleteCustomRuleResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteCustomRule", params, headers=headers)
response = json.loads(body)
model = models.DeleteCustomRuleResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteCustomWhiteRule(self, request):
"""删除精准白名单规则
:param request: Request instance for DeleteCustomWhiteRule.
:type request: :class:`tencentcloud.waf.v20180125.models.DeleteCustomWhiteRuleRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DeleteCustomWhiteRuleResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteCustomWhiteRule", params, headers=headers)
response = json.loads(body)
model = models.DeleteCustomWhiteRuleResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteDomainWhiteRules(self, request):
"""删除域名规则白名单
:param request: Request instance for DeleteDomainWhiteRules.
:type request: :class:`tencentcloud.waf.v20180125.models.DeleteDomainWhiteRulesRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DeleteDomainWhiteRulesResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteDomainWhiteRules", params, headers=headers)
response = json.loads(body)
model = models.DeleteDomainWhiteRulesResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteDownloadRecord(self, request):
"""废弃接口,无有效调用
删除访问日志下载记录
:param request: Request instance for DeleteDownloadRecord.
:type request: :class:`tencentcloud.waf.v20180125.models.DeleteDownloadRecordRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DeleteDownloadRecordResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteDownloadRecord", params, headers=headers)
response = json.loads(body)
model = models.DeleteDownloadRecordResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteHost(self, request):
"""删除负载均衡型域名,支持批量操作。
:param request: Request instance for DeleteHost.
:type request: :class:`tencentcloud.waf.v20180125.models.DeleteHostRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DeleteHostResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteHost", params, headers=headers)
response = json.loads(body)
model = models.DeleteHostResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteIpAccessControl(self, request):
"""Waf IP黑白名单Delete接口(建议使用DeleteIpAccessControlV2来替换当前接口)
:param request: Request instance for DeleteIpAccessControl.
:type request: :class:`tencentcloud.waf.v20180125.models.DeleteIpAccessControlRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DeleteIpAccessControlResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteIpAccessControl", params, headers=headers)
response = json.loads(body)
model = models.DeleteIpAccessControlResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteIpAccessControlV2(self, request):
"""Waf IP黑白名单最新版本删除接口
:param request: Request instance for DeleteIpAccessControlV2.
:type request: :class:`tencentcloud.waf.v20180125.models.DeleteIpAccessControlV2Request`
:rtype: :class:`tencentcloud.waf.v20180125.models.DeleteIpAccessControlV2Response`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteIpAccessControlV2", params, headers=headers)
response = json.loads(body)
model = models.DeleteIpAccessControlV2Response()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteSession(self, request):
"""删除CC攻击的session设置
:param request: Request instance for DeleteSession.
:type request: :class:`tencentcloud.waf.v20180125.models.DeleteSessionRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DeleteSessionResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteSession", params, headers=headers)
response = json.loads(body)
model = models.DeleteSessionResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteSpartaProtection(self, request):
"""SaaS型WAF删除防护域名
:param request: Request instance for DeleteSpartaProtection.
:type request: :class:`tencentcloud.waf.v20180125.models.DeleteSpartaProtectionRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DeleteSpartaProtectionResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteSpartaProtection", params, headers=headers)
response = json.loads(body)
model = models.DeleteSpartaProtectionResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeAccessExports(self, request):
"""本接口用于获取访问日志导出列表
:param request: Request instance for DescribeAccessExports.
:type request: :class:`tencentcloud.waf.v20180125.models.DescribeAccessExportsRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DescribeAccessExportsResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAccessExports", params, headers=headers)
response = json.loads(body)
model = models.DescribeAccessExportsResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeAccessFastAnalysis(self, request):
"""本接口用于访问日志的快速分析
:param request: Request instance for DescribeAccessFastAnalysis.
:type request: :class:`tencentcloud.waf.v20180125.models.DescribeAccessFastAnalysisRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DescribeAccessFastAnalysisResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAccessFastAnalysis", params, headers=headers)
response = json.loads(body)
model = models.DescribeAccessFastAnalysisResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeAccessHistogram(self, request):
"""本接口用于访问日志柱状趋势图
:param request: Request instance for DescribeAccessHistogram.
:type request: :class:`tencentcloud.waf.v20180125.models.DescribeAccessHistogramRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DescribeAccessHistogramResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAccessHistogram", params, headers=headers)
response = json.loads(body)
model = models.DescribeAccessHistogramResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeAccessIndex(self, request):
"""本接口用于获取访问日志索引配置信息
:param request: Request instance for DescribeAccessIndex.
:type request: :class:`tencentcloud.waf.v20180125.models.DescribeAccessIndexRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DescribeAccessIndexResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAccessIndex", params, headers=headers)
response = json.loads(body)
model = models.DescribeAccessIndexResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeAntiFakeRules(self, request):
"""获取防篡改url
:param request: Request instance for DescribeAntiFakeRules.
:type request: :class:`tencentcloud.waf.v20180125.models.DescribeAntiFakeRulesRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DescribeAntiFakeRulesResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAntiFakeRules", params, headers=headers)
response = json.loads(body)
model = models.DescribeAntiFakeRulesResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeAntiFakeUrl(self, request):
"""废弃接口
获取防篡改url
:param request: Request instance for DescribeAntiFakeUrl.
:type request: :class:`tencentcloud.waf.v20180125.models.DescribeAntiFakeUrlRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DescribeAntiFakeUrlResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAntiFakeUrl", params, headers=headers)
response = json.loads(body)
model = models.DescribeAntiFakeUrlResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeAntiInfoLeakRules(self, request):
"""老接口已经不再使用。
获取信息防泄漏规则列表
:param request: Request instance for DescribeAntiInfoLeakRules.
:type request: :class:`tencentcloud.waf.v20180125.models.DescribeAntiInfoLeakRulesRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DescribeAntiInfoLeakRulesResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAntiInfoLeakRules", params, headers=headers)
response = json.loads(body)
model = models.DescribeAntiInfoLeakRulesResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeAntiInfoLeakageRules(self, request):
"""取得信息防泄漏规则列表
:param request: Request instance for DescribeAntiInfoLeakageRules.
:type request: :class:`tencentcloud.waf.v20180125.models.DescribeAntiInfoLeakageRulesRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DescribeAntiInfoLeakageRulesResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAntiInfoLeakageRules", params, headers=headers)
response = json.loads(body)
model = models.DescribeAntiInfoLeakageRulesResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeAreaBanAreas(self, request):
"""获取地域封禁配置包括地域封禁开关,设置封禁的地区信息
:param request: Request instance for DescribeAreaBanAreas.
:type request: :class:`tencentcloud.waf.v20180125.models.DescribeAreaBanAreasRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DescribeAreaBanAreasResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAreaBanAreas", params, headers=headers)
response = json.loads(body)
model = models.DescribeAreaBanAreasResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeAreaBanSupportAreas(self, request):
"""获取WAF地域封禁支持的地域列表
:param request: Request instance for DescribeAreaBanSupportAreas.
:type request: :class:`tencentcloud.waf.v20180125.models.DescribeAreaBanSupportAreasRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DescribeAreaBanSupportAreasResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAreaBanSupportAreas", params, headers=headers)
response = json.loads(body)
model = models.DescribeAreaBanSupportAreasResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeAttackOverview(self, request):
"""攻击总览
:param request: Request instance for DescribeAttackOverview.
:type request: :class:`tencentcloud.waf.v20180125.models.DescribeAttackOverviewRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DescribeAttackOverviewResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAttackOverview", params, headers=headers)
response = json.loads(body)
model = models.DescribeAttackOverviewResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeAttackType(self, request):
"""查询指定域名TOP N攻击类型
:param request: Request instance for DescribeAttackType.
:type request: :class:`tencentcloud.waf.v20180125.models.DescribeAttackTypeRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DescribeAttackTypeResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAttackType", params, headers=headers)
response = json.loads(body)
model = models.DescribeAttackTypeResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeAttackWhiteRule(self, request):
"""获取用户规则白名单列表
:param request: Request instance for DescribeAttackWhiteRule.
:type request: :class:`tencentcloud.waf.v20180125.models.DescribeAttackWhiteRuleRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DescribeAttackWhiteRuleResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAttackWhiteRule", params, headers=headers)
response = json.loads(body)
model = models.DescribeAttackWhiteRuleResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeAutoDenyIP(self, request):
"""描述WAF自动封禁IP详情,对齐自动封堵状态
:param request: Request instance for DescribeAutoDenyIP.
:type request: :class:`tencentcloud.waf.v20180125.models.DescribeAutoDenyIPRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DescribeAutoDenyIPResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAutoDenyIP", params, headers=headers)
response = json.loads(body)
model = models.DescribeAutoDenyIPResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeBatchIpAccessControl(self, request):
"""Waf 批量防护IP黑白名单查询
:param request: Request instance for DescribeBatchIpAccessControl.
:type request: :class:`tencentcloud.waf.v20180125.models.DescribeBatchIpAccessControlRequest`
:rtype: :class:`tencentcloud.waf.v20180125.models.DescribeBatchIpAccessControlResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeBatchIpAccessControl", params, headers=headers)
response = json.loads(body)
model = models.DescribeBatchIpAccessControlResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))