域名配置并行更新
更新时间:2023-05-16
设置域名配置并行更新
支持的配置有:
cacheTTL
cacheFullUrl
ipACL
refererACL
https
requestAuth
followProtocol
rangeSwitch
cors
dsa
seoSwitch
mediaDragConf
origin
httpHeader
clientIp
errorPage
fileTrim
mobileAccess
accessLimit
compress
trafficLimit
Python
1def test_set_domain_multi_configs(c):
2 """
3 test_set_domain_multi_configs
4 """
5 multi_configs = {
6 "origin": [
7 {'peer': '1.2.3.4:80', 'host': 'www.originhost.com'},
8 {'peer': '1.2.3.5', 'host': 'www.originhost.com'},
9 ],
10 "cacheFullUrl": {
11 "cacheFullUrl": False,
12 "cacheUrlArgs": [
13 "a",
14 "b"
15 ]
16 },
17 "ipACL": {
18 "blackList": [
19 "1.1.1.2",
20 "1.1.1.3"
21 ]
22 },
23 "errorPage": [
24 {
25 "code":404,
26 "redirectCode":302,
27 "url":"/customer_404.html"
28 }
29 ],
30 "compress": {
31 "allow" : True,
32 "type" : "br"
33 },
34 "errorPage": [
35 {
36 "code":404,
37 "redirectCode":302,
38 "url":"/customer_404.html"
39 }
40 ]
41 }
42 response = c.set_domain_multi_configs('test-sdk.sys-qa.com', multi_configs)
43 print(response)