查询消费者授权列表
更新时间:2026-09-22
该接口用于分页查询指定消费者的授权规则,支持按实例、Service、API、授权级别、认证方式和启用状态筛选。
请求结构
Plain Text
1POST /?action=DescribeConsumerAuthorizationRulesByPage HTTP/1.1
2Host: apigw-control.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "keyword": keyword,
7 "keywordType": keywordType,
8 "pageNo": pageNo,
9 "pageSize": pageSize,
10 "order": order,
11 "orderBy": orderBy,
12 "orders" : [order],
13 "filters" : [filter],
14 "consumerId": consumerId,
15 "searchContent": searchContent,
16 "serviceId": serviceId,
17 "effectiveLevel": effectiveLevel,
18 "instanceSearchContent": instanceSearchContent,
19 "serviceSearchContent": serviceSearchContent,
20 "apiSearchContent": apiSearchContent,
21 "authorizationType": authorizationType,
22 "status": status
23}
请求头域
除公共头域外,无其它特殊头域。
请求参数
| 参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
|---|---|---|---|---|
| keyword | String | 否 | RequestBody参数 | 关键字 |
| keywordType | String | 否 | RequestBody参数 | 关键字类型 |
| pageNo | int | 否 | RequestBody参数 | 页码 |
| pageSize | int | 否 | RequestBody参数 | 每页数据项数目 |
| order | String | 否 | RequestBody参数 | 排序方向 |
| orderBy | String | 否 | RequestBody参数 | 排序字段 |
| orders | List<OrderModel> | 否 | RequestBody参数 | 多重排序 |
| filters | List<FilterModel> | 否 | RequestBody参数 | 过滤字段 |
| consumerId | String | 是 | RequestBody参数 | 消费者 ID |
| searchContent | String | 否 | RequestBody参数 | 搜索内容 |
| serviceId | String | 否 | RequestBody参数 | 服务 ID,精确过滤,只返回该服务下的授权规则 |
| effectiveLevel | String | 否 | RequestBody参数 | 授权级别:Service(服务级别)/ Api(路由级别) |
| instanceSearchContent | String | 否 | RequestBody参数 | 按实例名称搜索 |
| serviceSearchContent | String | 否 | RequestBody参数 | 按服务名称搜索 |
| apiSearchContent | String | 否 | RequestBody参数 | 按路由名称搜索 |
| authorizationType | String | 否 | RequestBody参数 | 认证方式:API_KEY / AK_SK |
| status | String | 否 | RequestBody参数 | 启用状态:Enable / Disable |
返回头域
除公共头域,无其它特殊头域。
返回参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| orderBy | String | 排序字段 |
| order | String | 排序方向 |
| pageNo | int | 页码 |
| pageSize | int | 每页数据项数目 |
| totalCount | long | 数据总条数 |
| result | List<ListAiGwAuthorizationRuleUO> | 当前页的授权规则列表 |
错误码
| 错误码 | 错误描述 | HTTP状态码 | 中文解释 |
|---|---|---|---|
| MethodArgumentNotValidException | MethodArgumentNotValidException: consumerId must not be blank | 400 | 必填参数缺失或格式不合法,consumerId 不能为空 |
| HttpMessageNotReadable | Http Message Not Readable: JSON parse error | 400 | 请求体不是合法 JSON,无法解析,请检查 JSON 语法和字段类型 |
| ResourcePermissionDeny | Resource permission deny. | 401 | 无权限访问指定资源,请确认使用正确的账号凭证且资源属于当前账号 |
| ConsumerNotExist | Consumer not exist. | 404 | consumerId 对应的消费者不存在、不属于当前账号或已删除 |
| ServiceNotExist | Service not exist. | 404 | serviceId 对应的服务不存在、不属于当前账号或已删除 |
| ApiNotExist | Api not exist. | 404 | apiId 对应的路由不存在、不属于当前账号或已删除 |
| HttpMediaTypeException | HttpMediaTypeException: Content-Type 'text/plain' is not supported | 415 | 请求的 Content-Type 不受支持,请使用 application/json |
请求示例
Plain Text
1POST /?action=DescribeConsumerAuthorizationRulesByPage HTTP/1.1
2Host: apigw-control.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4
5{
6 "consumerId": "consumer-a1b2c3d4",
7 "pageNo": 1,
8 "pageSize": 20
9}
返回示例
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 "pageNo": 1,
9 "pageSize": 20,
10 "totalCount": 1,
11 "result": [
12 {
13 "authorizationRuleId": "authorization_rule-i9j0k1l2",
14 "instanceId": "gw-a1b2c3d4",
15 "instanceName": "生产网关",
16 "serviceId": "sg-a1b2c3d4",
17 "serviceName": "对话服务",
18 "apiId": "api-a1b2c3d4",
19 "apiName": "对话API",
20 "authorizationType": "API_KEY",
21 "status": "Enable",
22 "description": "生产消费者授权",
23 "createTime": "2026-09-01T08:00:00Z",
24 "updateTime": "2026-09-05T10:30:00Z"
25 }
26 ]
27}
评价此篇文章
