配置域名动态加速规则
更新时间:2021-11-17
Method | Path | 说明 |
---|---|---|
PUT | /v2/domain/{domain}/config?dsa | 配置域名动态加速规则 |
请求体(Request Body)
参数 | 可选 | 类型 | 说明 |
---|---|---|---|
dsa | 必选 | DSA | 配置结构 |
DSA结构如下:
参数 | 可选 | 类型 | 说明 |
---|---|---|---|
enabled | 必选 | Bool | true为配置规则,false为删除规则 |
rules | 必选 | List<DSARule> | 动态加速规则列表 |
comment | 可选 | String | 备注 |
DSARule结构如下:
参数 | 可选 | 类型 | 说明 |
---|---|---|---|
type | 必选 | String | "suffix"表示文件类型,"path"表示动态路径,“exactPath“表示动态URL, "method"表示请求方法(支持"GET", "POST", "PUT", "DELETE", "OPTIONS") |
value | 必选 | String | type所指定类型的配置规则,多条规则使用";"分割 |
请求示例
Plain Text
1PUT /v2/domain/my.domain.com/config?dsa HTTP/1.1
2Host: cdn.baidubce.com
3Content-Length: 173
4
5{
6"dsa": {
7 "enabled": true,
8 "rules": [
9 {
10 "type": "suffix",
11 "value": ".aspx;.asp;.jsp;.php;.perl"
12 },
13 {
14 "type": "path",
15 "value": "\/path"
16 },
17 {
18 "type": "exactPath",
19 "value": "\/path\/to\/file.mp4"
20 },
21 {
22 "type": "method",
23 "value": "GET;POST"
24 }
25 ],
26 "comment": "test"
27}
响应示例
Plain Text
1HTTP/1.1 200 OK
2Content-Length: 0
3Content-Type: application/json;utf-8
4x-bce-request-id: 81d0b05f-5ad4-1f22-8068-d5c9de60a1d7
5Server: BWS