查询源站池接口
更新时间:2026-10-14
接口
本接口用于查询站点所属的源站池。
请求接口
| Method | Path | 说明 |
|---|---|---|
| POST | /v2/geo/origin-pool?action=query | 查询源站池 |
请求体
| 字段名称 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
| site | String | 是 | 站点名称 |
| name | String | 否 | 源站池名称 |
| originPoolId | String | 否 | 源站池Id |
| pageNo | Int | 否 | 页码,即第几页。默认值为1 |
| pageSize | Int | 否 | 每页数据的条数。默认值为10 |
响应体
| 字段名称 | 类型 | 是否一定存在 | 说明 |
|---|---|---|---|
| originPools | Array<OriginPools> | 是 | 站点所属的全部源站池配置 |
| pageNo | Int | 是 | 页码,即第几页。默认值为1 |
| pageSize | Int | 是 | 每页数据的条数。默认值为10 |
| total | Int | 是 | 源站池总数 |
OriginPools 类型说明
| 字段名称 | 类型 | 是否一定存在 | 说明 |
|---|---|---|---|
| id | Int | 是 | 索引Id |
| uid | String | 是 | 用户Id |
| site | String | 是 | 站点名称 |
| name | String | 是 | 源站池名称 |
| originPoolId | String | 是 | 源站池Id |
| status | String | 是 | 源站池状态。“ON” 表示该源站池使用中,“OFF” 表示该源站池未使用 |
| count | Int | 是 | 源站数量 |
| originConfig | Array<OriginConfig> | 是 | 源站配置 |
| instance | Array<Instance> | 是 | 源站池的引用实例 |
| slb | Array | 是 | 拓展字段 |
OriginConfig 类型说明
(1) IP 或 域名源站类型
| 字段名称 | 类型 | 是否一定存在 | 说明 |
|---|---|---|---|
| addr | String | 是 | 源站地址。 |
| type | String | 是 | 源站类型。 |
| host | String | 否 | 回源时使用的 host 值 |
| weight | Int | 是 | 源站权重。默认值为 50 |
| backup | Bool | 是 | 表示主源站配置,其值恒为true |
(2)对象存储类型
| 字段名称 | 类型 | 是否一定存在 | 说明 |
|---|---|---|---|
| addr | String | 是 | BOS 的 bucket 名称或 S3 对象存储的源站地址 |
| type | String | 是 | 源站类型 |
| host | String | 否 | 回源时使用的 host 值 |
| weight | Int | 是 | 源站权重。默认值为 50 |
| backup | Bool | 是 | 表示主源站配置,其值恒为true |
| thirdBucketAuth | Object<ThirdBucketAuth> | 是 | 对象存储的鉴权配置 |
ThirdBucketAuth 类型说明
| 字段名称 | 类型 | 是否一定存在 | 说明 |
|---|---|---|---|
| authType | String | 是 | 鉴权类型 |
| enabled | Bool | 是 | 私有访问鉴权的开关 |
| ak | String | 否 | 只针对 S3 鉴权类型生效,对象存储的访问密钥 Access Key |
| sk | String | 否 | 只针对 S3 鉴权类型生效,对象存储的私有访问密钥 Secret Access Key |
| bucket | String | 否 | 只针对 S3 鉴权类型生效,对象存储的 bucket |
| region | String | 否 | 只针对 S3 鉴权类型生效,对象存储的区域 |
| service | String | 否 | 只针对 S3 鉴权类型生效,对象存储的服务 |
Instance 类型说明
| 字段名称 | 类型 | 是否一定存在 | 说明 |
|---|---|---|---|
| domain | String | 否 | 引用该源站池的域名 |
| name | String | 否 | 引用该源站池的规则引擎名称 |
| loadBalanceName | String | 否 | 引用该源站池的负载均衡名称 |
| type | String | 是 | 引用该源站池的类型 |
| site | String | 是 | 引用该源站池的域名或负载均衡或规则引擎的所属站点 |
请求示例
Plain Text
1POST /v2/geo/origin-pool?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 "originPoolId":"geo_LGKm6ryALtnO"
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 "pageNo": 1,
8 "pageSize": 10,
9 "total": 1,
10 "originPools": [
11 {
12 "id": 1,
13 "uid": "user_id",
14 "site": "test-eo.com",
15 "name": "test",
16 "originPoolId": "geo_LGKm6ryALtnO",
17 "status": "ON",
18 "count": 5,
19 "originConfig": [
20 {
21 "addr": "test-bucket1",
22 "type": "BUCKET",
23 "host": "test.host.com",
24 "weight": 50,
25 "thirdBucketAuth": {
26 "authType": "bos",
27 "enabled": true
28 }
29 },
30 {
31 "addr": "test-bucket2",
32 "type": "BUCKET",
33 "host": "test.host.com",
34 "weight": 50,
35 "thirdBucketAuth": {
36 "authType": "bos",
37 "enabled": false
38 }
39 },
40 {
41 "type": "DOMAIN",
42 "addr": "test.origin.com",
43 "host": "test.host.com",
44 "thirdBucketAuth": {
45 "authType": "aws_v4",
46 "enabled": true,
47 "ak": "your_ak",
48 "sk": "your_sk",
49 "bucket": "testbucket",
50 "region": "us-east-1",
51 "service": "s3"
52 },
53 "weight": 50
54 },
55 {
56 "addr": "test.origin.com",
57 "type": "DOMAIN",
58 "weight": 10,
59 "host": "test.host.com"
60 },
61 {
62 "addr": "1.2.3.4",
63 "type": "IP",
64 "weight": 60,
65 "host": "test.host.com"
66 }
67 ],
68 "instance": [
69 {
70 "domain": "test.eo.com",
71 "type": "DOMAIN",
72 "site": "test-eo.com"
73 },
74 {
75 "name": "测试规则",
76 "type": "PageRules",
77 "site": "test-eo.com"
78 },
79 {
80 "loadBalanceName": "testLoadBalance",
81 "type": "loadBalance",
82 "site": "test-eo.com"
83 }
84 ],
85 "slb": []
86 }
87 ]
88}
评价此篇文章
