查询后端详情
更新时间:2026-09-07
该接口用于查询指定后端的详细信息,包括所属实例、后端类型、服务地址、模型供应商、DNS、API Key、TLS、连接池和 Token 计费配置
请求结构
Plain Text
1POST /?action=DescribeBackend HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "backendId": backendId
7}
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| backendId | String | 是 | RequestBody参数 | 后端 ID |
返回头域
除公共头域,无其它特殊头域。
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| backendId | String | 后端 ID |
| name | String | 后端名称 |
| instanceId | String | 网关实例 ID |
| instanceName | String | 网关实例名称 |
| backendType | String | 后端类型:aiModel(AI 大模型)/ip(固定 IP)/domain(域名)/agent(Agent 服务) |
| backendTypeName | String | 后端类型名称 |
| aiModel | String | AI 大模型接口协议:openai/anthropic/raw,仅后端类型为 aiModel 时返回 |
| aiModelName | String | AI 大模型接口协议名称,仅后端类型为 aiModel 时返回 |
| provider | String | 模型供应商,仅后端类型为 aiModel 时返回 |
| backendServiceEndpoint | String | 服务地址,格式为 host:port,AI 大模型可再带路径 |
| backendDnsServers | List<AiGwBackendDnsServerDTO> | 后端专用 DNS 服务器列表,未配置时为空 |
| backendApiKeys | List<String> | 访问后端使用的 API Key 列表,未配置时为空 |
| billingConfig | AiGwBackendBillingConfigDTO | Token 计费配置,用于计算调用该后端产生的 Token 费用,未配置计费时为空 |
| tlsConfig | AiGwBackendTlsConfigDTO | 访问后端时的 TLS 配置,未启用 TLS 时 mode 为 DISABLE |
| connectionPool | AiGwBackendConnectionPoolConfigDTO | 访问后端时的连接池配置,未开启时 enabled 为 false 并返回系统默认超时值 |
错误码
| 错误码 | 错误描述 | HTTP状态码 | 中文解释 |
|---|---|---|---|
| MethodArgumentNotValidException | MethodArgumentNotValidException: backendId must not be blank | 400 | 必填参数缺失或格式不合法,backendId 不能为空 |
| HttpMessageNotReadable | Http Message Not Readable: JSON parse error | 400 | 请求体不是合法 JSON,无法解析,请检查 JSON 语法和字段类型 |
| BackendNotExist | Backend not exist. | 404 | backendId 对应的后端不存在、不属于当前账号或已删除 |
| InstanceNotExist | Instance not exist. | 404 | 该后端所属的网关实例不存在或已释放 |
| HttpMediaTypeException | HttpMediaTypeException: Content-Type 'text/plain' is not supported | 415 | 请求的 Content-Type 不受支持,请使用 application/json |
请求示例
Plain Text
1POST /?action=DescribeBackend HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4
5{
6 "backendId": "bd-a1b2c3d4"
7}
返回示例
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Wed, 03 Dec 2014 06:42:19 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6
7{
8 "backendId": "bd-a1b2c3d4",
9 "name": "OpenAI 生产后端",
10 "instanceId": "gw-a1b2c3d4",
11 "instanceName": "生产网关",
12 "backendType": "aiModel",
13 "backendTypeName": "AI大模型",
14 "aiModel": "openai",
15 "aiModelName": "OpenAI",
16 "provider": "custom",
17 "backendServiceEndpoint": "api.example.com:443/v1",
18 "backendDnsServers": [
19 {
20 "ip": "10.0.0.2",
21 "port": 53
22 },
23 {
24 "ip": "10.0.0.3",
25 "port": 53
26 }
27 ],
28 "backendApiKeys": [
29 "example-api-key-primary",
30 "example-api-key-standby"
31 ],
32 "billingConfig": {
33 "inputTokenPrice": 0.002,
34 "outputTokenPrice": 0.008,
35 "cacheTokenPrice": 0.001,
36 "priceUnit": "PER_1K"
37 },
38 "tlsConfig": {
39 "mode": "SIMPLE",
40 "sni": "api.example.com"
41 },
42 "connectionPool": {
43 "enabled": true,
44 "idleTimeout": 300,
45 "connectTimeout": 5,
46 "tcpKeepalive": {
47 "enabled": true,
48 "time": 60,
49 "interval": 10,
50 "probes": 3
51 }
52 }
53}
评价此篇文章
