
# 查询权限检查结果
#### 功能介绍
查询权限检查结果。permission_check_status 为 "SUCCESS" 或者 "FAILED" 时，才能调用该接口。
#### 调试
您可以在[API Explorer](https://apiexplorer.developer.huaweicloud.com/apiexplorer/doc?product=UGO&api=ListPermissionCheckResult)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### URI
GET /v1/{project_id}/migration-projects/{migration_project_id}/permission-result
表1路径参数 
| 参数                   | 是否必选 | 参数类型   | 描述                                                                                                                              |
|:---|:---|:---|:---|
| project_id           | 是    | String | 租户在某一Region下的Project ID。 获取方法请参见[获取项目ID](https://support.huaweicloud.com/api-ugo/ugo_05_0025.html)。 |
| migration_project_id | 是    | String | 迁移项目ID。                                                                                                                         |
   
表2Query参数 
| 参数     | 是否必选 | 参数类型    | 描述                                                                                                                              |
|:---|:---|:---|:---|
| offset | 否    | Integer | 分页查询的偏移量。 最小值：**0** 最大值：**99** 缺省值：**0**    |
| limit  | 否    | Integer | 每页显示的条目数量。 最小值：**1** 最大值：**100** 缺省值：**10** |
   
#### 请求参数
表3请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 从IAM服务获取的用户Token。 |
   
#### 响应参数
**状态码： 200**
表4响应Body参数 
| 参数                      | 参数类型                                                          | 描述           |
|:---|:---|:---|
| total_count             | Integer                                                       | 权限检查的总条目个数。  |
| passed_permission_items | Array of [表5] objects | 权限检查的通过条目。   |
| alarm_permission_items  | Array of [表5] objects | 权限检查的告警条目。   |
| failed_permission_items | Array of [表5] objects | 权限检查的失败条目。   |
| passed_count            | Integer                                                       | 权限检查的通过条目个数。 |
| alarm_count             | Integer                                                       | 权限检查的告警条目个数。 |
| failed_count            | Integer                                                       | 权限检查的失败条目个数。 |
   
 表5PermissionItem 
| 参数               | 参数类型             | 描述        |
|:---|:---|:---|
| permission_type  | String           | 权限类型。     |
| schema_name      | String           | schema名称。 |
| description      | String           | 权限描述。     |
| status           | String           | 是否通过。     |
| failed_reason    | String           | 失败原因。     |
| failed_detail    | String           | 失败详情。     |
| suggest_solution | Array of strings | 解决建议。     |
   
#### 请求示例
获取权限检查结果。
```
POST https://{endpoint}/v1/0ac6eb2c8000d2ee2fd9c006dededbe6/migration-projects/permission-result?offset=0&limit=2
```
#### 响应示例
**状态码： 200**
请求成功。
```
{ 
  "total_count" : 119, 
  "passed_permission_items" : [ { 
    "permission_type" : "MATERIALIZED_VIEW Create Permission", 
    "schema_name" : "SYNTAX_MIG_SCHEMA", 
    "description" : "Permission to Create/Drop MATERIALIZED_VIEW", 
    "status" : "alarm", 
    "failed_reason" : "Permission not found.", 
    "failed_detail" : "User does not have the permission to Create/Drop/Alter TABLE", 
    "suggest_solution" : [ "Provide user with Create/Drop/Alter Privilege, for example:- GRANT CREATE, DROP, ALTER ON *.* TO \"{user}\"@\"{host}\";" ] 
  }, { 
    "permission_type" : "SUPERUSER Privilege", 
    "schema_name" : "", 
    "description" : "Check whether user has the super user privilege", 
    "status" : "alarm", 
    "failed_reason" : "Permission not found.", 
    "failed_detail" : "User does not have Super User privilege", 
    "suggest_solution" : [ "Provide user with Super User Privilege, for example:- GRANT SUPER ON *.* TO \"{user}\"@\"{host}\";" ] 
  } ], 
  "alarm_permission_items" : [ { 
    "permission_type" : "MATERIALIZED_VIEW Create Permission", 
    "schema_name" : "SYNTAX_MIG_SCHEMA", 
    "description" : "Permission to Create/Drop MATERIALIZED_VIEW", 
    "status" : "alarm", 
    "failed_reason" : "Permission not found.", 
    "failed_detail" : "User does not have the permission to Create/Drop/Alter TABLE", 
    "suggest_solution" : [ "Provide user with Create/Drop/Alter Privilege, for example:- GRANT CREATE, DROP, ALTER ON *.* TO \"{user}\"@\"{host}\";" ] 
  }, { 
    "permission_type" : "SUPERUSER Privilege", 
    "schema_name" : "", 
    "description" : "Check whether user has the super user privilege", 
    "status" : "alarm", 
    "failed_reason" : "Permission not found.", 
    "failed_detail" : "User does not have Super User privilege", 
    "suggest_solution" : [ "Provide user with Super User Privilege, for example:- GRANT SUPER ON *.* TO \"{user}\"@\"{host}\";" ] 
  } ], 
  "passed_count" : 116, 
  "alarm_count" : 3 
}
```
#### 状态码
| 状态码 | 描述    |
|:---|:---|
| 200 | 请求成功。 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-ugo/ugo_05_0024.html)。
