Created
April 18, 2018 09:57
-
-
Save muxueqz/3be3f56771c00c507039cb51b8eae639 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding:utf-8 -*- | |
from kscore.session import get_session | |
if __name__ == "__main__": | |
s = get_session() | |
client = s.create_client("cdn", use_ssl=False) | |
''' | |
GetCdnDomains 查询域名列表 | |
Parameters: | |
PageSize long 分页大小,默认20,最大500,取值1~500间整数 | |
PageNumber long 取第几页。默认为1,取值1~10000 | |
DomainName string 按域名过滤,默认为空,代表当前用户下所有域名 | |
DomainStatus string 按域名状态过滤,默认为空,代表当前用户下所有域名状态全部 | |
CdnType string 产品类型,取值为download:下载类加速,live:直播加速,多个产品类型之间用逗号(半角)间隔,默认为空,代表当前用户下全部产品类型 | |
FuzzyMatch string 域名过滤是否使用模糊匹配,取值为on:开启,off:关闭,默认为on | |
Returns: | |
<type 'dict'> | |
''' | |
res = client.get_cdn_domains(PageSize=20,PageNumber=0,DomainName='jssy.kingsoft.com',DomainStatus='online',CdnType='download') | |
print res | |
''' | |
get_domain_logs 日志下载接口 | |
Parameters: | |
PageSize long 分页大小,默认20,最大500,取值1~500间整数 | |
PageNumber long 取第几页。默认为1,取值1~10000 | |
DomainId string 按域名过滤,默认为空,代表当前用户下所有域名 | |
StartTime string 查询开始时间,格式yyyy-MM-dd,开始时间和结束时间均不指定时,默认是当天 | |
EndTime string 查询结束时间,格式yyyy-MM-dd,开始时间和结束时间均不指定时,默认是当天 | |
''' | |
DomainId = res['Domains'][0]['DomainId'] | |
print DomainId | |
# res = client.get_domain_logs(PageSize=20,PageNumber=1,DomainId=DomainId,StartTime='2018-04-17',EndTime='2018-04-23') | |
res = client.get_domain_logs(PageSize=20,PageNumber=1,DomainId=DomainId) | |
print res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment