Baidu AI Cloud
中国站

百度智能云

CDN

Dynamic Acceleration Interface

Configure Dynamic Acceleration Service

public void setDsaEnabled(){ 
        SetDsaEnabledRequest request=new SetDsaEnabledRequest().withAction("enable"); 
        CdnResponse response = cdnClient.setDsaEnabled(request); 
        System.out.println(response); 
    } 

Query Dynamic Acceleration Domain Name List

 public void getDsaDomains(){ 
        GetDsaDomainsRequest request=new GetDsaDomainsRequest(); 
        GetDsaDomainsResponse dsaDomains = cdnClient.getDsaDomains(request); 
        System.out.println(dsaDomains); 
    } 

Configure the Dynamic Acceleration Rules of Domain Name

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); 
    } 
Previous
Cache Management
Next
Tool Interface