-
Notifications
You must be signed in to change notification settings - Fork 250
/
cdn_client.py
1959 lines (1623 loc) · 80.6 KB
/
cdn_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.cdn.v20180606 import models
class CdnClient(AbstractClient):
_apiVersion = '2018-06-06'
_endpoint = 'cdn.tencentcloudapi.com'
_service = 'cdn'
def AddCLSTopicDomains(self, request):
"""AddCLSTopicDomains 用于新增域名到某日志主题下
:param request: Request instance for AddCLSTopicDomains.
:type request: :class:`tencentcloud.cdn.v20180606.models.AddCLSTopicDomainsRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.AddCLSTopicDomainsResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("AddCLSTopicDomains", params, headers=headers)
response = json.loads(body)
model = models.AddCLSTopicDomainsResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def AddCdnDomain(self, request):
"""AddCdnDomain 用于新增内容分发网络加速域名。1分钟内最多可新增100个域名。
:param request: Request instance for AddCdnDomain.
:type request: :class:`tencentcloud.cdn.v20180606.models.AddCdnDomainRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.AddCdnDomainResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("AddCdnDomain", params, headers=headers)
response = json.loads(body)
model = models.AddCdnDomainResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def CreateClsLogTopic(self, request):
"""CreateClsLogTopic 用于创建日志主题。注意:一个日志集下至多可创建10个日志主题。
:param request: Request instance for CreateClsLogTopic.
:type request: :class:`tencentcloud.cdn.v20180606.models.CreateClsLogTopicRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.CreateClsLogTopicResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("CreateClsLogTopic", params, headers=headers)
response = json.loads(body)
model = models.CreateClsLogTopicResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def CreateDiagnoseUrl(self, request):
"""### <font color=red>**该接口已废弃** </font><br>
CreateDiagnoseUrl 用于添加域名诊断任务URL。
:param request: Request instance for CreateDiagnoseUrl.
:type request: :class:`tencentcloud.cdn.v20180606.models.CreateDiagnoseUrlRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.CreateDiagnoseUrlResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("CreateDiagnoseUrl", params, headers=headers)
response = json.loads(body)
model = models.CreateDiagnoseUrlResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def CreateEdgePackTask(self, request):
"""动态打包任务提交接口
:param request: Request instance for CreateEdgePackTask.
:type request: :class:`tencentcloud.cdn.v20180606.models.CreateEdgePackTaskRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.CreateEdgePackTaskResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("CreateEdgePackTask", params, headers=headers)
response = json.loads(body)
model = models.CreateEdgePackTaskResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def CreateScdnDomain(self, request):
"""CreateScdnDomain 用于创建 SCDN 加速域名
:param request: Request instance for CreateScdnDomain.
:type request: :class:`tencentcloud.cdn.v20180606.models.CreateScdnDomainRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.CreateScdnDomainResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("CreateScdnDomain", params, headers=headers)
response = json.loads(body)
model = models.CreateScdnDomainResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def CreateScdnFailedLogTask(self, request):
"""CreateScdnFailedLogTask 用于重试创建失败的事件日志任务
:param request: Request instance for CreateScdnFailedLogTask.
:type request: :class:`tencentcloud.cdn.v20180606.models.CreateScdnFailedLogTaskRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.CreateScdnFailedLogTaskResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("CreateScdnFailedLogTask", params, headers=headers)
response = json.loads(body)
model = models.CreateScdnFailedLogTaskResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def CreateScdnLogTask(self, request):
"""CreateScdnLogTask 用于创建事件日志任务
:param request: Request instance for CreateScdnLogTask.
:type request: :class:`tencentcloud.cdn.v20180606.models.CreateScdnLogTaskRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.CreateScdnLogTaskResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("CreateScdnLogTask", params, headers=headers)
response = json.loads(body)
model = models.CreateScdnLogTaskResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def CreateVerifyRecord(self, request):
"""CreateVerifyRecord 用于生成一条子域名解析,提示客户添加到域名解析上,用于泛域名及域名取回校验归属权。
生成的解析记录可通过 [VerifyDomainRecord](https://cloud.tencent.com/document/product/228/48117) 完成归属权校验。
注意:生成的解析记录有效期为24小时,超过24小时后,需重新生成。
具体流程可参考:[使用API接口进行域名归属校验](https://cloud.tencent.com/document/product/228/61702#.E6.96.B9.E6.B3.95.E4.B8.89.EF.BC.9Aapi-.E6.8E.A5.E5.8F.A3.E6.93.8D.E4.BD.9C)
:param request: Request instance for CreateVerifyRecord.
:type request: :class:`tencentcloud.cdn.v20180606.models.CreateVerifyRecordRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.CreateVerifyRecordResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("CreateVerifyRecord", params, headers=headers)
response = json.loads(body)
model = models.CreateVerifyRecordResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteCdnDomain(self, request):
"""DeleteCdnDomain 用于删除指定加速域名
:param request: Request instance for DeleteCdnDomain.
:type request: :class:`tencentcloud.cdn.v20180606.models.DeleteCdnDomainRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DeleteCdnDomainResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteCdnDomain", params, headers=headers)
response = json.loads(body)
model = models.DeleteCdnDomainResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteClsLogTopic(self, request):
"""DeleteClsLogTopic 用于删除日志主题。注意:删除后,所有该日志主题下绑定域名的日志将不再继续投递至该主题,已经投递的日志将会被全部清空。生效时间约为 5~15 分钟。
:param request: Request instance for DeleteClsLogTopic.
:type request: :class:`tencentcloud.cdn.v20180606.models.DeleteClsLogTopicRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DeleteClsLogTopicResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteClsLogTopic", params, headers=headers)
response = json.loads(body)
model = models.DeleteClsLogTopicResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DeleteScdnDomain(self, request):
"""删除SCDN域名
:param request: Request instance for DeleteScdnDomain.
:type request: :class:`tencentcloud.cdn.v20180606.models.DeleteScdnDomainRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DeleteScdnDomainResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DeleteScdnDomain", params, headers=headers)
response = json.loads(body)
model = models.DeleteScdnDomainResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeBillingData(self, request):
"""DescribeBillingData 用于查询实际计费数据明细。
:param request: Request instance for DescribeBillingData.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeBillingDataRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeBillingDataResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeBillingData", params, headers=headers)
response = json.loads(body)
model = models.DescribeBillingDataResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeCcData(self, request):
"""CC统计数据查询
:param request: Request instance for DescribeCcData.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeCcDataRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeCcDataResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeCcData", params, headers=headers)
response = json.loads(body)
model = models.DescribeCcDataResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeCdnData(self, request):
"""DescribeCdnData 用于查询 CDN 实时访问监控数据,支持以下指标查询:
+ 流量(单位为 byte)
+ 带宽(单位为 bps)
+ 请求数(单位为 次)
+ 命中请求数(单位为 次)
+ 请求命中率(单位为 %)
+ 命中流量(单位为 byte)
+ 流量命中率(单位为 %)
+ 状态码 2xx 汇总及各 2 开头状态码明细(单位为 个)
+ 状态码 3xx 汇总及各 3 开头状态码明细(单位为 个)
+ 状态码 4xx 汇总及各 4 开头状态码明细(单位为 个)
+ 状态码 5xx 汇总及各 5 开头状态码明细(单位为 个)
:param request: Request instance for DescribeCdnData.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeCdnDataRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeCdnDataResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeCdnData", params, headers=headers)
response = json.loads(body)
model = models.DescribeCdnDataResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeCdnDomainLogs(self, request):
"""DescribeCdnDomainLogs 用于查询访问日志下载地址,仅支持 30 天以内的境内、境外访问日志下载链接查询。
:param request: Request instance for DescribeCdnDomainLogs.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeCdnDomainLogsRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeCdnDomainLogsResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeCdnDomainLogs", params, headers=headers)
response = json.loads(body)
model = models.DescribeCdnDomainLogsResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeCdnIp(self, request):
"""DescribeCdnIp 用于查询 CDN IP 归属。
(注意:此接口请求频率限制以 CDN 侧限制为准:200次/10分钟)
:param request: Request instance for DescribeCdnIp.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeCdnIpRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeCdnIpResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeCdnIp", params, headers=headers)
response = json.loads(body)
model = models.DescribeCdnIpResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeCdnOriginIp(self, request):
"""### <font color=red>**该接口已废弃** </font><br>
本接口(DescribeCdnOriginIp)用于查询 CDN 回源节点的IP信息。(注:替换接口为DescribeIpStatus)
:param request: Request instance for DescribeCdnOriginIp.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeCdnOriginIpRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeCdnOriginIpResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeCdnOriginIp", params, headers=headers)
response = json.loads(body)
model = models.DescribeCdnOriginIpResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeCertDomains(self, request):
"""DescribeCertDomains 用于校验SSL证书并提取证书中包含的域名。
:param request: Request instance for DescribeCertDomains.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeCertDomainsRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeCertDomainsResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeCertDomains", params, headers=headers)
response = json.loads(body)
model = models.DescribeCertDomainsResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeDDoSData(self, request):
"""DDoS统计数据查询
:param request: Request instance for DescribeDDoSData.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeDDoSDataRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeDDoSDataResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeDDoSData", params, headers=headers)
response = json.loads(body)
model = models.DescribeDDoSDataResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeDiagnoseReport(self, request):
"""### <font color=red>**该接口已废弃** </font><br>
DescribeDiagnoseReport 用于获取指定报告id的内容。
:param request: Request instance for DescribeDiagnoseReport.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeDiagnoseReportRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeDiagnoseReportResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeDiagnoseReport", params, headers=headers)
response = json.loads(body)
model = models.DescribeDiagnoseReportResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeDistrictIspData(self, request):
"""查询指定域名的区域、运营商明细数据
注意事项:接口尚未全面开放,未在内测名单中的账号不支持调用
:param request: Request instance for DescribeDistrictIspData.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeDistrictIspDataRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeDistrictIspDataResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeDistrictIspData", params, headers=headers)
response = json.loads(body)
model = models.DescribeDistrictIspDataResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeDomains(self, request):
"""DescribeDomains 用于查询内容分发网络加速域名(含境内、境外)基本配置信息,包括项目ID、服务状态,业务类型、创建时间、更新时间等信息。
:param request: Request instance for DescribeDomains.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeDomainsRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeDomainsResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeDomains", params, headers=headers)
response = json.loads(body)
model = models.DescribeDomainsResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeDomainsConfig(self, request):
"""DescribeDomainsConfig 用于查询内容分发网络加速域名(含境内、境外)的所有配置信息。
:param request: Request instance for DescribeDomainsConfig.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeDomainsConfigRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeDomainsConfigResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeDomainsConfig", params, headers=headers)
response = json.loads(body)
model = models.DescribeDomainsConfigResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeEdgePackTaskStatus(self, request):
"""DescribeEdgePackTaskStatus 用于查询动态打包任务状态列表
:param request: Request instance for DescribeEdgePackTaskStatus.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeEdgePackTaskStatusRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeEdgePackTaskStatusResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeEdgePackTaskStatus", params, headers=headers)
response = json.loads(body)
model = models.DescribeEdgePackTaskStatusResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeEventLogData(self, request):
"""DescribeEventLogData 用于查询事件日志统计曲线
:param request: Request instance for DescribeEventLogData.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeEventLogDataRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeEventLogDataResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeEventLogData", params, headers=headers)
response = json.loads(body)
model = models.DescribeEventLogDataResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeHttpsPackages(self, request):
"""DescribeHttpsPackages 用于查询 CDN HTTPS请求包详情。
:param request: Request instance for DescribeHttpsPackages.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeHttpsPackagesRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeHttpsPackagesResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeHttpsPackages", params, headers=headers)
response = json.loads(body)
model = models.DescribeHttpsPackagesResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeImageConfig(self, request):
"""DescribeImageConfig 用于获取域名图片优化的当前配置,支持Webp、TPG、 Guetzli 和 Avif。
:param request: Request instance for DescribeImageConfig.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeImageConfigRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeImageConfigResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeImageConfig", params, headers=headers)
response = json.loads(body)
model = models.DescribeImageConfigResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeIpStatus(self, request):
"""DescribeIpStatus 用于查询域名所在加速平台的边缘节点、回源节点明细。注意事项:暂不支持查询边缘节点信息并且数据会存在一定延迟。
>? 若您的业务已迁移至 CDN 控制台,请参考<a href="https://cloud.tencent.com/document/api/228/41954"> CDN 接口文档</a>,使用 CDN 相关API 进行操作。
:param request: Request instance for DescribeIpStatus.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeIpStatusRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeIpStatusResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeIpStatus", params, headers=headers)
response = json.loads(body)
model = models.DescribeIpStatusResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeIpVisit(self, request):
"""DescribeIpVisit 用于查询 5 分钟活跃用户数,及日活跃用户数明细
+ 5 分钟活跃用户数:根据日志中客户端 IP,5 分钟粒度去重统计
+ 日活跃用户数:根据日志中客户端 IP,按天粒度去重统计
:param request: Request instance for DescribeIpVisit.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeIpVisitRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeIpVisitResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeIpVisit", params, headers=headers)
response = json.loads(body)
model = models.DescribeIpVisitResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeMapInfo(self, request):
"""DescribeMapInfo 用于查询省份对应的 ID,运营商对应的 ID 信息。
:param request: Request instance for DescribeMapInfo.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeMapInfoRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeMapInfoResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeMapInfo", params, headers=headers)
response = json.loads(body)
model = models.DescribeMapInfoResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeOriginData(self, request):
"""DescribeOriginData 用于查询 CDN 实时回源监控数据,支持以下指标查询:
+ 回源流量(单位为 byte)
+ 回源带宽(单位为 bps)
+ 回源请求数(单位为 次)
+ 回源失败请求数(单位为 次)
+ 回源失败率(单位为 %,小数点后保留两位)
+ 回源状态码 2xx 汇总及各 2 开头回源状态码明细(单位为 个)
+ 回源状态码 3xx 汇总及各 3 开头回源状态码明细(单位为 个)
+ 回源状态码 4xx 汇总及各 4 开头回源状态码明细(单位为 个)
+ 回源状态码 5xx 汇总及各 5 开头回源状态码明细(单位为 个)
:param request: Request instance for DescribeOriginData.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeOriginDataRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeOriginDataResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeOriginData", params, headers=headers)
response = json.loads(body)
model = models.DescribeOriginDataResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribePayType(self, request):
"""DescribePayType 用于查询用户的计费类型,计费周期等信息。
:param request: Request instance for DescribePayType.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribePayTypeRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribePayTypeResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribePayType", params, headers=headers)
response = json.loads(body)
model = models.DescribePayTypeResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribePurgeQuota(self, request):
"""DescribePurgeQuota 用于查询账户刷新配额和每日可用量。
:param request: Request instance for DescribePurgeQuota.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribePurgeQuotaRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribePurgeQuotaResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribePurgeQuota", params, headers=headers)
response = json.loads(body)
model = models.DescribePurgeQuotaResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribePurgeTasks(self, request):
"""DescribePurgeTasks 用于查询提交的 URL 刷新、目录刷新记录及执行进度,通过 PurgePathCache 与 PurgeUrlsCache 接口提交的任务均可通过此接口进行查询。
:param request: Request instance for DescribePurgeTasks.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribePurgeTasksRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribePurgeTasksResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribePurgeTasks", params, headers=headers)
response = json.loads(body)
model = models.DescribePurgeTasksResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribePushQuota(self, request):
"""DescribePushQuota 用于查询预热配额和每日可用量。
:param request: Request instance for DescribePushQuota.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribePushQuotaRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribePushQuotaResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribePushQuota", params, headers=headers)
response = json.loads(body)
model = models.DescribePushQuotaResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribePushTasks(self, request):
"""DescribePushTasks 用于查询预热任务提交历史记录及执行进度。
:param request: Request instance for DescribePushTasks.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribePushTasksRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribePushTasksResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribePushTasks", params, headers=headers)
response = json.loads(body)
model = models.DescribePushTasksResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeReportData(self, request):
"""DescribeReportData 用于查询域名/项目维度的日/周/月报表数据。
:param request: Request instance for DescribeReportData.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeReportDataRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeReportDataResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeReportData", params, headers=headers)
response = json.loads(body)
model = models.DescribeReportDataResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeScdnBotData(self, request):
"""获取BOT统计数据列表
:param request: Request instance for DescribeScdnBotData.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeScdnBotDataRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeScdnBotDataResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeScdnBotData", params, headers=headers)
response = json.loads(body)
model = models.DescribeScdnBotDataResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeScdnBotRecords(self, request):
"""查询BOT会话记录列表
:param request: Request instance for DescribeScdnBotRecords.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeScdnBotRecordsRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeScdnBotRecordsResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeScdnBotRecords", params, headers=headers)
response = json.loads(body)
model = models.DescribeScdnBotRecordsResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeScdnConfig(self, request):
"""DescribeScdnConfig 用于查询指定 SCDN 加速域名的安全相关配置
:param request: Request instance for DescribeScdnConfig.
:type request: :class:`tencentcloud.cdn.v20180606.models.DescribeScdnConfigRequest`
:rtype: :class:`tencentcloud.cdn.v20180606.models.DescribeScdnConfigResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeScdnConfig", params, headers=headers)
response = json.loads(body)
model = models.DescribeScdnConfigResponse()
model._deserialize(response["Response"])
return model
except Exception as e: