查询站点接口
更新时间:2026-04-08
接口
本接口用于查询用户的所有站点的信息,也可根据条件查询特定站点的信息。
请求接口
| Method | Path | 说明 |
|---|---|---|
| POST | /v2/geo/site?action=query | 查询站点信息。 |
请求体
| 参数 | 类型 | 可选 | 说明 |
|---|---|---|---|
| site | String | 可选 | 站点名称。如果输入此项,仅会查询特定站点的信息;否则,查询该用户的所有站点信息。 |
| keyword | String | 可选 | 站点名称的关键字查询,模糊查询。当设置了查询特定 “site” 时,此值无效。 |
| status | String | 可选 | 默认为 ALL(all),查询全部站点的状态。 可选值为: • RUNNING(running):正常运行中; • STOPPED(stopped):已停止; • OVERDUE(overdue):已欠费; • OPERATING:操作中。 注:不区分大小写,"RUNNING" 等同于 "running"。 |
| pageNo | Int | 可选 | 查询第几页,默认为 1。输入负数或 0 时,返回错误提示。 |
| pageSize | Int | 可选 | 一页数据最大元素个数,默认为 10。输入负数或 0 时,返回错误提示。 |
您可以根据需要,选择合适的参数作为请求体进行查询站点操作。
响应码
| HTTP Status Code | 说明 |
|---|---|
| 200 | 查询成功 |
| 400 | 接口请求参数无效。 |
| 403 | 该域名不属于用户,用户不可操作。 |
响应体
| 参数 | 类型 | 说明 |
|---|---|---|
| total | Int | 响应的元素个数。 |
| sites | List<Site> | 站点元素列表。 |
| pageNo | Int | 返回的是第几页数据。 |
| pageSize | Int | 一页数据最大元素个数。 |
Site 类型如下:
| 参数 | 类型 | 参数是否一定存在 | 说明 |
|---|---|---|---|
| id | Int | 是 | 站点ID。 |
| createdAt | String | 是 | 创建站点的时间(北京时间格式)。 |
| site | String | 是 | 站点名称。 |
| uid | String | 是 | 用户 ID。 |
| status | String | 是 | 站点状态,一般有三类: • RUNNING:正常运行中; • STOPPED:已停止; • OVERDUE:已欠费。 |
| region | String | 是 | 加速区域,当前仅有“mainland_china”,表示中国内地。 |
| planId | Int | 是 | 当前站点所关联的套餐ID。 |
| plan | List<Plan> | 是 | 套餐的内容。 |
| dnsVerify | Int | 是 | 完成站点归属验证详情,有三种值对应三种情况: • 0:未完成归属验证; • 1:已完成归属验证,或者无需完成归属验证; • 2:进行归属验证失败。 |
Plan 类型如下:
| 参数 | 类型 | 参数是否一定存在 | 说明 |
|---|---|---|---|
| start | String | 是 | 套餐开始时间,秒级。可以为北京时间、UTC格式或者时间戳。 以下三类都合法: • 2025-01-01 10:00:00 • 2025-01-01T02:00:00Z • 1735696800 |
| end | String | 是 | 套餐结束时间,秒级。格式同 start 参数。 |
| spec | String | 是 | 套餐规格,分为四种类型。 • 基础版:Basic • 标准版:Standard • 高级版:Advanced • 企业版:Enterprise |
| autoRenewal | Bool | 否 | 在套餐到期后,且账户有余额时是否自动续费。默认为 false。 |
| createdAt | String | 是 | 创建站点的时间(北京时间格式)。 |
| planId | Int | 是 | 当前站点所关联的套餐 ID。 |
请求示例1:无请求体参数
Plain Text
1POST /v2/geo/site?action=query HTTP/1.1
2Host: geo.baidubce.com
3Content-Length: 46
4Authorization: xxx
5Content-Type: application/json;charset=utf-8
6Accept-Encoding: gzip
7
8{
9}
响应示例
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{
8 "total": 1,
9 "sites": [
10 {
11 "id":1,
12 "createdAt": "2025-01-07 14:42:50",
13 "uid": "xxxxxx",
14 "status": "RUNNING",
15 "region": "mainland_china",
16 "site": "your.site.com",
17 "planId": 1,
18 "plan": {
19 "start": "2025-01-01 10:00:00",
20 "end": "2025-01-31 10:00:00",
21 "autoRenewal": true,
22 "createdAt": "2025-01-07 14:42:49",
23 "spec": "Basic",
24 "planId": 1
25 },
26 "dnsVerify": 1
27 }
28 ],
29 "pageNo": 1,
30 "pageSize": 10
31}
请求示例2:站点名称参数
Plain Text
1POST /v2/geo/site?action=query HTTP/1.1
2Host: geo.baidubce.com
3Content-Length: 46
4Authorization: xxx
5Content-Type: application/json;charset=utf-8
6Accept-Encoding: gzip
7
8{
9 "site": "your.site.com"
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{
8 "total": 1,
9 "sites": [
10 {
11 "id":1,
12 "createdAt": "2025-01-07 14:42:50",
13 "uid": "xxxxxx",
14 "status": "RUNNING",
15 "region": "mainland_china",
16 "site": "your.site.com",
17 "planId": 1,
18 "plan": {
19 "start": "2025-01-01 10:00:00",
20 "end": "2025-01-31 10:00:00",
21 "autoRenewal": true,
22 "createdAt": "2025-01-07 14:42:49",
23 "spec": "Basic",
24 "planId": 1
25 },
26 "dnsVerify": 1
27 }
28 ],
29 "pageNo": 1,
30 "pageSize": 10
31}
评价此篇文章
