查询权限检查结果
功能介绍
查询权限检查结果。permission_check_status 为 "SUCCESS" 或者 "FAILED" 时,才能调用该接口。
URI
GET /v1/{project_id}/migration-projects/{migration_project_id}/permission-result
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
租户在某一Region下的Project ID。 获取方法请参见获取项目ID。 |
migration_project_id |
是 |
String |
迁移项目ID。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
offset |
否 |
Integer |
分页查询的偏移量。 最小值:0 最大值:99 缺省值:0 |
limit |
否 |
Integer |
每页显示的条目数量。 最小值:1 最大值:100 缺省值:10 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
从IAM服务获取的用户Token。 |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
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 |
权限检查的失败条目个数。 |
请求示例
获取权限检查结果。
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 |
请求成功。 |
错误码
请参见错误码。