Skip to content

Commit 2d88875

Browse files
committed
complete cdn example
1 parent a230373 commit 2d88875

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

examples/cdn.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from kscore.session import get_session
44

55
if __name__ == "__main__":
6+
67

78
s = get_session()
89
client = s.create_client("cdn", use_ssl=False)
@@ -21,8 +22,8 @@
2122
Returns:
2223
<type 'dict'>
2324
'''
24-
#domains = client.get_cdn_domains(PageSize=20,PageNumber=0,DomainName='www.xunfei.cn',DomainStatus='online',CdnType='download')
25-
25+
#res = client.get_cdn_domains(PageSize=20,PageNumber=0,DomainName='www.xunfei.cn',DomainStatus='online',CdnType='download')
26+
2627

2728
'''
2829
add_cdn_domain_request 新增域名
@@ -157,6 +158,9 @@
157158
IgnoreNoCache String 是否忽略源站的no-cache头,on表示忽略,off(默认)表示不忽略。 (本期暂不支持此选项)
158159
159160
'''
161+
162+
'''
163+
# json格式规则
160164
cacheRules = {
161165
"DomainId":"2D09NSH",
162166
"CacheRules":
@@ -170,6 +174,7 @@
170174
}
171175
]
172176
}
177+
'''
173178
#client.set_cache_rule_config(**cacheRules)
174179
#confs = client.get_domain_configs(DomainId='2D09NSH', ConfigList='cache_expired,ignore_query_string,src_host,referer,test_url,src_advanced')
175180

@@ -202,6 +207,9 @@
202207
Origin String 回源地址,可以是IP或域名;IP支持最多20个,以逗号区分,域名只能输入一个。IP与域名不能同时输入。
203208
204209
'''
210+
211+
'''
212+
# json格式规则
205213
originParam = {
206214
"DomainId":"2D09NSH",
207215
"Enable":"on",
@@ -220,6 +228,7 @@
220228
}
221229
]
222230
}
231+
'''
223232
#client.set_origin_advanced_config(**originParam)
224233

225234

@@ -619,10 +628,10 @@
619628

620629

621630

622-
print '****************************cdn test*****************:'
631+
#print '****************************cdn test*****************:'
623632
#print client.get_domain_configs(DomainId='2D09NSH', ConfigList='src_advanced')
624633
#print type(res)
625-
print res
634+
#print res
626635
#print client.get_domain_configs(DomainId='2D09NSH', ConfigList='cache_expired,cc,page_compress,ignore_query_string,src_host,test_url,http_header,range,src_advanced')
627636

628637

0 commit comments

Comments
 (0)