文档中心 > ListPolicies
ListPolicies

最近更新时间:2021-11-05

接口名

ListPolicies

描述

获取策略列表

请求参数

名称数据类型示例描述是否必填
ActionStringListPolicies系统规定参数,取值:ListPoliciesY

createEnd

String1634250688000策略创建截止时间(13位时间戳)N
createStartString1634250688000策略创建开始时间(13位时间戳)N

page

Integer1页码(page、size都不为空时,执行分页查询)N
policyNameStringNASFullAccess策略名称/策略描述模糊查询N
sizeInteger10每页个数(page、size都不为空时,执行分页查询)N
typeStringsystem/personal策略类型N

返回参数

名称数据类型示例说明
PageInteger1页码(仅分页查询时返回有效值,否则返回空值)
size
Integer10每页数量(仅分页查询时返回有效值,否则返回空值)
totalCountInteger10总数量
totalPages
Integernull总页数(不展示总页数)
RequestIdString20057073-a99a-488c-9b0f-e**请求id
list
Array[PolicyVO]
策略信息集合

PolicyVO详情:

名称数据类型示例说明
id
String48b1cb3a-8c31-46a7-aa31-***策略id
nameStringNASFullAccess策略名称
descriptionString文件存储管理策略(NAS)策略描述
typeStringsystem策略类型
policyDoc
String{"Version":"1","Statement":[{"Effffect":"Allow","Action": ["nas:"],"Resource":""}]}策略json
createTimeString1634250688000策略创建时间

请求示例

  http://api.unicloud.com/user/user? Action=ListPolicies&size=2&AccessKeyId=WqcP6swnn******&page=1&Signature=CPfyAdLtdZU**** ***

正常返回示例

 

    "list": [ 

        { 

            "createTime": 1634250688000,

            "description": "视联云编辑权限", 

            "policyDoc": "{\"Version\":\"1\",\"Statement\": [{\"Effect\":\"Allow\",\"Action\":[\"univms:*\",\"vms:*\"],\"Resource\":\"*\"}]}", 

            "name": "UnivmsFullAccess", 

            "id": "6431dee6-880c-45cf-*******", 

            "type": "system" 

        },

        { 

            "createTime": 1634250607000, 

            "description": "视联云只读权限", 

            "policyDoc": "{\"Version\":\"1\",\"Statement\": [{\"Effect\":\"Deny\",\"Action\": [\"univms:Create*\",\"univms:Update*\",\"univms:Delete*\",\"univms:Set*\",\"univms:Remo ve*\",\"vms:Create*\",\"vms:Update*\",\"vms:Delete*\",\"vms:Set*\",\"vms:Remove*\",\"vm s:RecordPlanApplyToDevices\",\"univms:RecordPlanApplyToDevices\",\"vms:SnapshotApplyToD evices\",\"univms:SnapshotApplyToDevices\",\"vms:StartSnapshot*\",\"univms:StartSnapsho t*\",\"vms:StartCloudRecord*\",\"univms:StartCloudRecord*\"],\"Resource\":\"*\"}, {\"Effect\":\"Allow\",\"Action\":[\"univms:*\",\"vms:*\"],\"Resource\":\"*\"}]}", 

            "name": "UnivmsReadOnlyAccess", 

            "id": "56ea9144-8f57-4c26-b744-********", 

            "type": "system" 

        } 

    ],

    "size": 2, 

    "totalCount": 36, 

    "totalPages": null, 

    "page": 1, 

    "RequestId": "20057073-a99a-488c-9b0f-ecb422155642" 

}

错误码

错误码错误信息状态码错误描述
OverMaxPageSizeMax available page size is 200, please check your param.400页面最多展示200条数据
OverMinPageSizeMin available page size is 1, please check your param.400页面展示数量的取值最小为1
InvalidParameterPageError400页面取值错误