调度策略相关接口
更新时间:2023-12-04
查询域名的调度策略
描述
- 查询指定域名的调度策略
请求参数
URI | GET /v1/domains/{domain_name}/strategy |
Query String | 无 |
Request Body | 无 |
示例:
GET /v1/domains/www.mydomain.com/strategy HTTP/1.1
Host: itm.baidubce.com
Authorization: authorization string
x-bce-date: 2022-11-18T06:22:24Z
返回数据
{
"status": "start", // 域名调度状态: "", "start", "stop", "pause"
"strategy": {
"start": "根规则",
"rules": [
{
"type": "geoProximity",
"area": "none.CN",
"isp": "other",
"name": "根规则",
"enable": true,
"items": [
{"reference": "北京","weight": 0,"priority": 0,"usersets": ""}
]
},
{
"type": "wrr",
"area": "beijing.CN",
"isp": "other",
"name": "北京",
"enable": true,
"items": [
{"reference": "220.181.38.135","weight": 1,"priority": 0,"usersets": ""}
]
}
]
},
"endpointsConf": [ // 调度策略中的端点配置信息
{"type": "A","value": "220.181.38.135","area": "beijing.CN","isp": "ct","evalHealth": true,"enable": true}
]
}
生成默认调度策略并启用默认策略
描述
- 为域名生成默认调度策略 & 启用此策略
请求参数
URI | POST /v1/domains/{domain_name}/recommend-strategy |
Query String | 无 |
Request Body | 无 |
示例:
POST /v1/domains/www.mydomain.com/recommend-strategy HTTP/1.1
Host: itm.baidubce.com
Authorization: authorization string
x-bce-date: 2022-11-18T06:22:24Z
返回数据
null
修改或更新调度策略
描述
- 修改或更新域名的调度策略,支持批量操作
- 调度策略数据人工构造起来比较复杂,建议在前端界面处修改调度策略,或是在前端界面设计好调度策略后,从页面检查的update接口中获取构造好的调度策略数据,然后调用此接口
请求参数
URI | POST /v1/strategys/update-or-create |
Query String | 无 |
Request Body | 详见下述实例 |
示例:
POST /v1//strategys/update-or-create HTTP/1.1
Host: itm.baidubce.com
Authorization: authorization string
x-bce-date: 2022-11-18T06:22:24Z
{
"itmdomain-test.com.4": {
"strategy": {
"start": "根规则",
"rules": [
{
"type": "geoProximity",
"area": "none.CN",
"isp": "other",
"name": "根规则",
"enable": true,
"items": [
{
"reference": "安徽",
"weight": 0,
"priority": 0,
"usersets": ""
}
]
},
{
"type": "wrr",
"area": "anhui.CN",
"isp": "other",
"name": "安徽",
"enable": true,
"items": [
{
"reference": "1.1.1.1",
"weight": 1,
"priority": 0,
"usersets": ""
}
]
}
]
},
"endpointsConf": [
{
"type": "A",
"value": "1.1.1.1",
"area": "anhui.CN",
"isp": "ct",
"evalHealth": true,
"enable": true
}
]
}
}
返回数据
null