
# 委托查询 - ShowAgencyV2
#### 功能介绍
委托查询，查询委托是否创建及委托中的action与配置的是否完全一致。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/LakeFormation/doc?api=ShowAgencyV2)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-lakeformation/abcd.html)。
#### URI
GET /v2/agency
表1Query参数 
| 参数          | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                  |
|:---|:---|:---|:---|
| agency_type | 是    | String | **参数解释:** 委托类型：JOB_TRUST-任务委托、ADMIN_TRUST-系统委托、TABLE_SERVICE_TRUST-表服务委托 **约束限制:** 可选值为：JOB_TRUST, ADMIN_TRUST, TABLE_SERVICE_TRUST, name: X-Auth-Token **取值范围:** 不涉及 **默认取值:** 不涉及 |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                |
|:---|:---|:---|:---|
| X-Auth-Token | 否    | String | **参数解释:** 租户token **约束限制:** 长度为1\~65536个字符 **取值范围:** 长度为1\~65536个字符 **默认取值:** 不涉及 |
   
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数             | 参数类型             | 描述                                                                                                                                                                                                   |
|:---|:---|:---|
| agency_type    | String           | **参数解释:** 委托类型：JOB_TRUST-任务委托、ADMIN_TRUST-系统委托、TABLE_SERVICE_TRUST-表服务委托                                                                                             |
| agency_name    | String           | **参数解释:** 委托名称                                                                                                                                                       |
| authorized     | Boolean          | **参数解释:** 授权与否，委托未创建返回false，当委托权限影响实例运行时，返回false，权限足够，返回true                                                                                                         |
| missing_action | Array of strings | **参数解释:** 缺少的action，页面提示用户具体缺少的权限， 当返回为空说明委托没创建或者不缺少权限，配合authorized字段使用 当返回具体的action列表时，说明委托下缺少对应的权限 |
   
**状态码：400**
表4响应Body参数 
| 参数                | 参数类型   | 描述                                                 |
|:---|:---|:---|
| error_code        | String | **参数解释:** 错误码      |
| error_msg         | String | **参数解释:** 错误描述     |
| common_error_code | String | **参数解释:** CBC公共错误码 |
| solution_msg      | String | **参数解释:** 解决方案描述   |
   
**状态码：401**
表5响应Body参数 
| 参数                | 参数类型   | 描述                                                 |
|:---|:---|:---|
| error_code        | String | **参数解释:** 错误码      |
| error_msg         | String | **参数解释:** 错误描述     |
| common_error_code | String | **参数解释:** CBC公共错误码 |
| solution_msg      | String | **参数解释:** 解决方案描述   |
   
**状态码：403**
表6响应Body参数 
| 参数         | 参数类型                                          | 描述                                             |
|:---|:---|:---|
| error      | [Error] object | **参数解释:** 错误信息 |
| error_code | String                                        | **参数解释:** 错误码  |
| error_msg  | String                                        | **参数解释:** 错误描述 |
| title      | String                                        | **参数解释:** 标题   |
   
 表7Error 
| 参数         | 参数类型   | 描述                                             |
|:---|:---|:---|
| error_code | String | **参数解释:** 错误码  |
| error_msg  | String | **参数解释:** 错误描述 |
| title      | String | **参数解释:** 标题   |
| message    | String | **参数解释:** 错误信息 |
| code       | String | **参数解释:** 状态码  |
   
**状态码：404**
表8响应Body参数 
| 参数                | 参数类型   | 描述                                                 |
|:---|:---|:---|
| error_code        | String | **参数解释:** 错误码      |
| error_msg         | String | **参数解释:** 错误描述     |
| common_error_code | String | **参数解释:** CBC公共错误码 |
| solution_msg      | String | **参数解释:** 解决方案描述   |
   
**状态码：408**
表9响应Body参数 
| 参数                | 参数类型   | 描述                                                 |
|:---|:---|:---|
| error_code        | String | **参数解释:** 错误码      |
| error_msg         | String | **参数解释:** 错误描述     |
| common_error_code | String | **参数解释:** CBC公共错误码 |
| solution_msg      | String | **参数解释:** 解决方案描述   |
   
**状态码：500**
表10响应Body参数 
| 参数                | 参数类型   | 描述                                                 |
|:---|:---|:---|
| error_code        | String | **参数解释:** 错误码      |
| error_msg         | String | **参数解释:** 错误描述     |
| common_error_code | String | **参数解释:** CBC公共错误码 |
| solution_msg      | String | **参数解释:** 解决方案描述   |
   
#### 请求示例
```
/v2/agency?agency_type=JOB_TRUST
```
#### 响应示例
无
#### 状态码
| 状态码 | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|
| 200 | 委托返回结果                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| 400 | { "error_code": "common.01000001", "error_msg": "failed to read http request, please check your input, code: 400, reason: Type mismatch., cause: TypeMismatchException" }                                                                                                                                                                                                                                                                                                                                          |
| 401 | { "error_code": "APIG.1002", "error_msg": "Incorrect token or token resolution failed" }                                                                                                                                                                                                                                                                                                                                                                                                                           |
| 403 | { "error": { "code": "403", "message": "X-Auth-Token is invalid in the request", "error_code": null, "error_msg": null, "title": "Forbidden" }, "error_code": "403", "error_msg": "X-Auth-Token is invalid in the request", "title": "Forbidden" } |
| 404 | { "error_code": "common.01000001", "error_msg": "response status exception, code: 404" }                                                                                                                                                                                                                                                                                                                                                                                                                           |
| 408 | { "error_code": "common.00000408", "error_msg": "timeout exception occurred" }                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| 500 | { "error_code": "common.00000500", "error_msg": "internal error" }                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-lakeformation/ErrorCode.html)。
