Baidu AI Cloud
中国站

百度智能云

CDN

Configure the Dynamic Acceleration Rules of Domain Name

Method Path Description
PUT /v2/domain/{domain}/config?dsa Configure the dynamic acceleration rules of domain name

Request body

Parameter Optional Type Description
dsa Required DSA Configure structure

The DSA structure is as follows:

Parameter Optional Type Description
enabled Required Bool true means configuring rules, and false means deleting rules.
rules Required List<DSARule> Dynamic acceleration rule list
comment Optional String Comments

The structure is as follows:

Parameter Optional Type Description
type Required String "suffix " means file type, "path " means dynamic path, “exactPath " means dynamic URL, and “method " means request method.(Support "GET ", "POST ", "PUT ", "DELETE " and “OPTIONS ")
value Required String Configuration rules for the specified type in “type ", separate multiple rules by “; ".

Request example

PUT /v2/domain/my.domain.com/config?dsa HTTP/1.1 
Host: cdn.baidubce.com 
Content-Length: 173

{ 
"dsa": { 
    "enabled": true, 
    "rules": [ 
        { 
            "type": "suffix", 
            "value": ".mp4;.jpg;.php" 
        }, 
        { 
            "type": "path", 
            "value": "\/path" 
        }, 
        { 
            "type": "exactPath", 
            "value": "\/path\/to\/file.mp4" 
        }, 
        { 
            "type": "method", 
            "value": "GET;POST" 
        } 
    ], 
    "comment": "test" 
} 

Response example

HTTP/1.1 200 OK 
Content-Length: 0
Content-Type: application/json;utf-8
x-bce-request-id: 81d0b05f-5ad4-1f22-8068-d5c9de60a1d7
Server: BWS
Previous
Query Dynamic Acceleration Domain Name List
Next
Configure the Dynamic Acceleration Service