设置回源地址
更新时间:2021-01-25
接口
本接口用于更新指定加速域名回源地址。此域名必须是本用户的,否则会返回403失败。
Method | Path | 说明 |
---|---|---|
PUT | /v2/dsa/domain/{domain}/config?action=origin | 修改加速域名的源站配置 |
请求体(Request Body)
参数 | 可选 | 类型 | 说明 |
---|---|---|---|
type | 必选 | String类型 | 源站类型,值为IP,DOMAIN或者BUCKET |
origin | 必选 | list类型,表示OriginPeer。 | 源站配置 |
defaultHost | 可选 | String | 默认回源host,当源站级别host不存在时,使用域名级别的默认host |
OriginPeer类型如下:
参数 | 可选 | 类型 | 说明 |
---|---|---|---|
addr | 必选 | String | 源站地址,不支持ipv6地址。同一个加速域名都所有源站类型必须相同 |
host | 可选 | String | 回源时使用的host值,该host为源站级别的host,每个源站可以配置一个host |
backup | 可选 | Bool | 是否为备份源站,true表示主源站,false表示备份源站,默认为false |
httpPort | 可选 | unsigned int | http回源端口 |
httpsPort | 可选 | unsigned int | https回源端口 |
响应码 (Http Status Code)
HTTP Status Code | 说明 |
---|---|
200 | 成功 |
响应体 (Response Body)
参数 | 类型 | 说明 |
---|---|---|
status | String | 刚更新成功返回的status是RUNNING |
请求示例
Text
1PUT /v2/dsa/domain/myself.baidu.com/config?origin HTTP/1.1
2Host: cdn.baidubce.com
3Content-Length: 178
4Content-Type: text/json;utf-8
5
6{
7 "type":"DOMAIN",
8 "origin":[
9 {
10 "addr":"www.test.com",
11 "httpPort":"80",
12 "host":"www.originhost.com"
13 }
14 ]
15}
响应示例
Text
1HTTP/1.1 200 OK
2Server: nginx
3Date: Thu, 20 Jun 2019 10:19:38 GMT
4Content-Type: application/json; charset=utf-8
5Transfer-Encoding: chunked
6Connection: keep-alive
7X-Powered-By: PHP/7.1.5
8x-bce-request-id: e38a0c7d-388e-ac0b-6238-b674b4ea7bfc
9
10{"status":"RUNNING"}