HTTPS相关接口 设置HTTPS加速 public void setDomainHttpsConfig ( CdnClient client ) { String domain = my.test.com ; HttpsConfig httpsConfig = new HttpsConfig ( ) . withEnabled ( true ) . withCertId ( ssl-82fdaufdsaldsuaow
动态加速接口 配置动态加速服务 public void setDsaEnabled(){ SetDsaEnabledRequest request=new SetDsaEnabledRequest().withAction("enable"); CdnResponse response = cdnClient.setDsaEnabled(request); System.out.println
动态加速接口 配置动态加速服务 EnableDsa/DisableDsa 开启/关闭DSA是针对用户级别的开启关闭。 cli := client . GetDefaultClient ( ) // 开启DSA服务 err := cli . EnableDsa ( ) fmt . Printf ( err:%+v\n , err ) // 关闭DSA服务 err = cli .
缓存管理接口 刷新缓存/查询刷新状态 Purge/GetPurgedStatus 缓存清除方式有URL刷新、目录刷新除。URL刷新除是以文件或一个资源为单位进行缓存刷新。目录刷新除是以目录为单位,将目录下的所有文件进行缓存清除。 cli := client . GetDefaultClient ( ) // 刷除 purgedId , err := cli . Purge ( [ ] api .
缓存配置接口 设置缓存过期规则 public void setDomainCacheTTL ( CdnClient client ) { String domain = my.test.com ; SetDomainCacheTTLRequest request = new SetDomainCacheTTLRequest ( ) . withDomain ( domain ) . addCacheTTL
访问配置接口 设置访问Referer控制 public void setDomainRefererACL ( CdnClient client ) { String domain = my.test.com ; RefererACL acl = new RefererACL ( ) . addBlackList ( http://a.com ) . addBlackList ( http:
回源配置接口 更新加速域名回源地址 origin = new ArrayList (); origin.add(new OriginPeer().withPeer("3.4.5.6").withHost("a.com").withWeight(50).withIsp("un")); origin.add(new OriginPeer().withPeer
高级设置接口 设置HttpHeader public void setDomainHttpHeader ( CdnClient client ) { String domain = my.test.com ; HttpHeader header1 = new HttpHeader ( ) . withType ( origin ) . withHeader ( x-auth-cn ) .
统计接口(新版) 新建查询参数 CdnStatsParam为统计相关接口的查询参数类,用户可参考如下代码新建一个CdnStatsParam: from baidubce.services.cdn.cdn_stats_param import CdnStatsParam CdnStatsParam(start_time='2019-05-26T00:00:00Z', end_time=
统计接口(旧版) 查询域名pv def test_get_domain_pv_stat(self): """ use new stat api params is optional no domain->all domains by uid no endTime->time by now no startTime->24hour before endTime