查询用量封顶接口
更新时间:2026-10-15
接口
本接口用于查询用量封顶。
请求接口
| Method | Path | 说明 |
|---|---|---|
| POST | /v2/geo/limit-consumption?action=query | 查询用量封顶 |
请求体
| 参数 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
| site | string | 是 | 站点名称 |
| object | String | 否 | 生效对象,仅支持输入加速域名作为过滤条件 |
| pageNo | Int | 否 | 分页编号,默认为1 |
| pageSize | Int | 否 | 每页返回数目,默认为10 |
响应码
| HTTP Status Code | 说明 |
|---|---|
| 200 | 查询成功 |
| 400 | 查询用量封顶请求参数无效 |
响应体
| 参数 | 类型 | 说明 |
|---|---|---|
| rules | Array<Rules> | 用量封顶规则列表 |
| totalCount | Int | 查询到的规则总数,用于分页 |
| pageNo | Int | 分页编号,默认为1 |
| pageSize | Int | 每页返回数目,默认为10 |
| allObjectList | Array<String> | 所有的生效对象列表,”site“ 表示本次查询的站点,其余表示本站点的域名。 |
Rules 类型说明
| 参数 | 类型 | 说明 |
|---|---|---|
| object | String | 生效对象。如果值为“site”,表示为“站点”,其他的为站点下的域名。 |
| enabled | Bool | 开启/关闭用量封顶配置。“enabled” 值为 “true” 时,表示开启;值为“false”时,表示关闭。 |
| activated | Bool | 是否已经触发阈值,执行 “action”。“activated” 值为 “true” 时,表示已触发;值为“false”时,表示未触发。 |
| type | String | 检测类型,其合法值为: • flow:流量 • bandwidth:带宽 • pv:请求数 |
| threshold | String | 检测阈值,"type" 不同时,单位不同。"type" 值为 "flow" 时,合法单位为 "MB"、"GB"、"TB"。"type" 值为 "bandwidth" 时,合法单位为 "Mbps"、"Gbps" 或 "Tbps"。"type" 值为 "pv" 时,填写数值即可,如“1234”。 |
| statisticalCycle | Int | 检测周期,单位为秒,"enabled" 值为 "true" 时必选。合法值为 "300" 、"3600" 或 "86400"。"type" 值为 "bandwidth" 时,固定取值为 "300"。当 "type" 值为 "pv" 或 "flow" 时,合法值为 "300"、"3600" 或 "86400"。 |
| action | String | 达到阈值时触发的动作,固定值为 “stop”, 表示停止加速域名。 |
请求示例
Plain Text
1POST /v2/geo/limit-consumption?action=query HTTP/1.1
2Host: geo.baidubce.com
3Authorization: xxx
4Content-Type: application/json;charset=utf-8
5Accept-Encoding: gzip
6{
7 "site": "test-eo.com",
8 "pageNo": 1,
9 "pageSize": 20
10}
响应示例
Plain Text
1HTTP/1.1 200 OK
2Server: nginx/1.16.1
3Content-Type: application/json; charset=utf-8
4Transfer-Encoding: chunked
5Connection: keep-alive
6{
7 "rules": [
8 {
9 "object": "site",
10 "enabled": false,
11 "activated": false,
12 "type": "flow",
13 "threshold": "100GB",
14 "statisticalCycle": 3600,
15 "action": "stop"
16 },
17 {
18 "object": "1.test-eo.com",
19 "enabled": true,
20 "activated": false,
21 "type": "flow",
22 "threshold": "100GB",
23 "statisticalCycle": 300,
24 "action": "stop"
25 }
26 ],
27 "totalCount": 2,
28 "pageNo": 1,
29 "pageSize": 20,
30 "allObjectList": [
31 "site",
32 "1.test-eo.com"
33 ]
34}
评价此篇文章
