动态加速接口
更新时间:2023-05-16
配置动态加速服务
public void setDsaEnabled(){
SetDsaEnabledRequest request=new SetDsaEnabledRequest().withAction("enable");
CdnResponse response = cdnClient.setDsaEnabled(request);
System.out.println(response);
}
查询动态加速域名列表
public void getDsaDomains(){
GetDsaDomainsRequest request=new GetDsaDomainsRequest();
GetDsaDomainsResponse dsaDomains = cdnClient.getDsaDomains(request);
System.out.println(dsaDomains);
}
配置域名动态加速规则
public void setDsaConfig(){
DSARule rule1=new DSARule().withType("suffix").withValue(".mp4;.jpg;.php");
DSARule rule2=new DSARule().withType("path").withValue("/path");
DSARule rule3=new DSARule().withType("exactPath").withValue("/path/to/file.mp4");
DSARule rule4=new DSARule().withType("method").withValue("GET;POST");
List<DSARule> rules=Arrays.asList(rule1,rule2,rule3,rule4);
Dsa dsa=new Dsa().withEnabled(true).withRules(rules).withComment("test");
String domain="vd3.bdstatic.com";
SetDsaConfigResponse response = cdnClient.setDsaConfig(domain, dsa);
System.out.println(response);
}