分页获取同步权限策略 - ListPolicy
功能介绍
分页获取同步权限策略。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限,具体权限要求请参见权限和授权项。
URI
GET /v1/{project_id}/instances/{instance_id}/policies
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
project_id | 是 | String | 项目编号。获取方法,请参见获取项目ID。 |
instance_id | 是 | String | LakeFormation实例ID。创建实例时自动生成。例如:2180518f-42b8-4947-b20b-adfc53981a25。 |
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
limit | 否 | Integer | 查询返回条数。默认值为5000。最小值为1,最大值为10000。 |
marker | 否 | String | 查询的起始记录ID。最小长度为0,最大长度为1024。 |
reverse_page | 否 | Boolean | 是否倒序查询。 |
catalog_name | 否 | String | catalog名称。只能包含字母、数字和下划线,且长度为1~256个字符。 |
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
X-Auth-Token | 是 | Array of strings | 租户token。 |
响应参数
状态码:200
参数 | 参数类型 | 描述 |
|---|---|---|
current_count | Integer | 本次返回的对象个数。最小值为0,最大值为2000。 |
next_marker | String | 下一页查询地址。当不存在下一页,则值为null,当值为null时,响应Body无该参数。 |
previous_marker | String | 上一页查询地址。当不存在上一页,则值为null,当值为null时,响应Body无该参数。 |
参数 | 参数类型 | 描述 |
|---|---|---|
allow_exceptions | Array of PolicyItem objects | 排除的允许策略。 |
conditions | Array of PolicyItemCondition objects | 条件属性。 |
create_time | String | 创建时间。 |
created_by | String | 创建者。 |
data_mask_policy_items | Array of DataMaskPolicyItem objects | 类脱敏策略条目。 |
deny_exceptions | Array of PolicyItem objects | 拒绝排除策略。 |
deny_policy_items | Array of PolicyItem objects | 拒绝策略。 |
description | String | 描述。 |
guid | String | 唯一guid。 |
id | Long | 主键。 |
is_audit_enabled | Boolean | 是否支持审计。 |
is_default_policy | Boolean | 是否默认策略。 |
is_deny_all_else | Boolean | 是否拒绝所有。 |
is_enabled | Boolean | 是否启动。 |
name | String | 名。 |
options | Object | 选项。 |
policy_items | Array of PolicyItem objects | 策略信息数组。 |
policy_labels | Array of strings | 策略便签。 |
policy_priority | Integer | 策略优先级。 |
policy_type | Integer | 策略类型。 |
resource_signature | String | 资源签名。 |
resources | Map<String,PolicyResource> | 资源。 |
row_filter_policy_items | Array of RowFilterPolicyItem objects | 行过滤策略条目。 |
service | String | 服务。 |
service_type | String | 服务类型。 |
update_time | String | 更新时间。 |
updated_by | String | 更新者。 |
validity_schedules | Array of ValiditySchedule objects | 验证周期。 |
version | Long | 版本。 |
zone_name | String | 域。 |
参数 | 参数类型 | 描述 |
|---|---|---|
accesses | Array of PolicyItemAccess objects | 访问数组。 |
conditions | Array of PolicyItemCondition objects | 条件数组。 |
data_mask_info | PolicyItemDataMaskInfo object | 列脱敏策略信息。 |
delegate_admin | Boolean | 是否支持传递。 |
groups | Array of strings | 用户组。 |
roles | Array of strings | 角色。 |
users | Array of strings | 用户。 |
参数 | 参数类型 | 描述 |
|---|---|---|
condition_expr | String | 条件表达式。 |
data_mask_type | String | 列脱敏类型。 |
value_expr | String | 列脱敏表达式。 |
参数 | 参数类型 | 描述 |
|---|---|---|
accesses | Array of PolicyItemAccess objects | 访问控制数据。 |
conditions | Array of PolicyItemCondition objects | 条件。 |
delegate_admin | Boolean | 是否传递。 |
groups | Array of strings | 组。 |
roles | Array of strings | 角色。 |
users | Array of strings | 用户。 |
参数 | 参数类型 | 描述 |
|---|---|---|
accesses | Array of PolicyItemAccess objects | 权限。 |
conditions | Array of PolicyItemCondition objects | 条件。 |
delegate_admin | Boolean | 是否传递。 |
groups | Array of strings | 组。 |
roles | Array of strings | 角色。 |
row_filter_info | PolicyItemRowFilterInfo object | 行过滤。 |
users | Array of strings | 用户。 |
参数 | 参数类型 | 描述 |
|---|---|---|
end_time | String | end时间。 |
recurrences | Array of ValidityRecurrence objects | 策略递归。 |
start_time | String | 开始时间。 |
time_zone | String | 时间域。 |
参数 | 参数类型 | 描述 |
|---|---|---|
interval | ValidityInterval object | 时间间隔。 |
schedule | RecurrenceSchedule object | 周期。 |
参数 | 参数类型 | 描述 |
|---|---|---|
day_of_month | String | 日期按月。 |
day_of_week | String | 日期按星期。 |
hour | String | 时。 |
minute | String | 分。 |
month | String | 月。 |
year | String | 年。 |
状态码:400
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码。 |
error_msg | String | 错误描述。 |
solution_msg | String | 解决方案描述。 |
状态码:401
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码。 |
error_msg | String | 错误描述。 |
solution_msg | String | 解决方案描述。 |
状态码:403
参数 | 参数类型 | 描述 |
|---|---|---|
error | Error object | 错误信息。 |
error_code | String | 错误码。 |
error_msg | String | 错误描述。 |
title | String | 标题。 |
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码。 |
error_msg | String | 错误描述。 |
title | String | 标题。 |
message | String | 错误信息。 |
code | String | 状态码。 |
状态码:404
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码。 |
error_msg | String | 错误描述。 |
solution_msg | String | 解决方案描述。 |
状态码:408
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码。 |
error_msg | String | 错误描述。 |
solution_msg | String | 解决方案描述。 |
状态码:500
参数 | 参数类型 | 描述 |
|---|---|---|
error_code | String | 错误码。 |
error_msg | String | 错误描述。 |
solution_msg | String | 解决方案描述。 |
请求示例
GET https://{endpoint}/v1/{project_id}/instances/{instance_id}/policies 响应示例
状态码:200
OK
{
"page_info" : {
"current_count" : 1,
"next_marker" : "000000001225efff0000000000000001"
},
"policies" : [ {
"allow_exceptions" : [ ],
"data_mask_policy_items" : [ ],
"deny_exceptions" : [ ],
"deny_policy_items" : [ ],
"id" : 61,
"is_audit_enabled" : true,
"is_default_policy" : false,
"is_deny_all_else" : false,
"is_enabled" : true,
"name" : "test_database_name-database",
"options" : { },
"policy_items" : [ {
"accesses" : [ {
"is_allowed" : true,
"type" : "read"
}, {
"is_allowed" : true,
"type" : "index"
}, {
"is_allowed" : true,
"type" : "select"
}, {
"is_allowed" : true,
"type" : "drop"
}, {
"is_allowed" : true,
"type" : "alter"
}, {
"is_allowed" : true,
"type" : "all"
} ],
"conditions" : [ {
"type" : "ip-range",
"values" : [ "127.0.0.1" ]
} ],
"delegate_admin" : true,
"groups" : [ "testGroupName1" ],
"roles" : [ ],
"users" : [ ]
}, {
"accesses" : [ {
"is_allowed" : true,
"type" : "alter"
} ],
"conditions" : [ ],
"delegate_admin" : false,
"groups" : [ "testGroupName2" ],
"roles" : [ ],
"users" : [ ]
} ],
"policy_labels" : [ ],
"policy_priority" : 0,
"policy_type" : 0,
"resources" : {
"database" : {
"is_excludes" : false,
"is_recursive" : false,
"values" : [ "test_database_name" ]
}
},
"row_filter_policy_items" : [ ],
"service" : "Hive",
"service_type" : "hive",
"validity_schedules" : [ ]
} ]
} 状态码:400
Bad Request
{
"error_code" : "common.01000001",
"error_msg" : "failed to read http request, please check your input, code: 400, reason: Type mismatch., cause: TypeMismatchException"
} 状态码:401
Unauthorized
{
"error_code" : "APIG.1002",
"error_msg" : "Incorrect token or token resolution failed"
} 状态码:403
Forbidden
{
"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
Not Found
{
"error_code" : "common.01000001",
"error_msg" : "response status exception, code: 404"
} 状态码:408
Request Timeout
{
"error_code" : "common.00000408",
"error_msg" : "timeout exception occurred"
} 状态码:500
Internal Server Error
{
"error_code" : "common.00000500",
"error_msg" : "internal error"
} 状态码
状态码 | 描述 |
|---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
408 | Request Timeout |
500 | Internal Server Error |
错误码
请参见错误码。

