接口描述
本接口(ListPolicies)可用于查询策略列表。
请求域名:
cam.api.qcloud.com
输入参数
以下请求参数列表仅列出了接口请求参数,未列出 公共请求参数。
参数名称 | 类型 | 必选 | 描述 |
---|---|---|---|
page | int | 否 | 页码,默认值为 1,从 1开始,不能大于 200 |
rp | int | 否 | 每页数量,默认值为 20,必须大于 0 且小于或等于 200 |
scope | string | 否 | 可取值 'All'、'QCS' 和 'Local','All' 获取所有策略,'QCS' 只获取预设策略,'Local' 只获取自定义策略,默认取 'All' |
keyword | string | 否 | 按策略名匹配 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
totalNum | int | 策略总数 |
list | array | 策略数组,数组每个成员包括 policyId、policyName、addTime、type、description、 createMode 字段。其中: policyId:策略 ID policyName:策略名 addTime:策略创建时间 type:1 表示自定义策略,2 表示预设策略 description:策略描述 createMode:1 表示按业务权限创建的策略,其他值表示可以查看策略语法和通过策略语法更新策略 |
示例
输入
https://cam.api.qcloud.com/v2/index.php
?page=1
&rp=20
&SignatureMethod=HmacSHA256
&Action=ListPolicies
&Region=gz
&SecretId=************************************************************
&Nonce=6796
&Timestamp=1508485689
&RequestClient=SDK_PHP_1.1
&Signature=nq490ytZEB6hb6dFc%2BA1A56qDe743T%2FOEuuCctmXY08%3D
输出
{
"code": 0,
"message": "",
"codeDesc": "Success",
"data": {
"list": [
{
"policyId": 1,
"policyName": "AdministratorAccess",
"addTime": "2016-06-02 19:40:09",
"type": 2,
"description": "该策略允许您管理账户内所有用户及其权限、财务相关的信息、云服务资产。",
"createMode": 2
},
{
"policyId": 400411,
"policyName": "ReadOnlyAccess",
"addTime": "2017-09-01 15:57:54",
"type": 2,
"description": "该策略允许您只读访问账户内所有云服务资产。",
"createMode": 2
},
{
"policyId": 2,
"policyName": "QCloudResourceFullAccess",
"addTime": "2016-06-02 19:40:23",
"type": 2,
"description": "该策略允许您管理账户内所有云服务资产。",
"createMode": 2
},
{
"policyId": 3,
"policyName": "QCloudFinanceFullAccess",
"addTime": "2016-06-02 19:40:37",
"type": 2,
"description": "该策略允许您管理账户内财务相关的内容,例如:付款、开票。",
"createMode": 2
},
{
"policyId": 524252,
"policyName": "QcloudAVCFullAccess",
"addTime": "2017-10-20 10:59:24",
"type": 2,
"description": "即时通信(IM)全读写访问权限",
"createMode": 2
},
{
"policyId": 439285,
"policyName": "QcloudBeianFullAccess",
"addTime": "2017-09-14 14:33:47",
"type": 2,
"description": "域名备案(Beian)全读写访问权限",
"createMode": 2
},
{
"policyId": 399353,
"policyName": "QcloudBMFullAccess",
"addTime": "2017-09-01 11:55:26",
"type": 2,
"description": "黑石(BM)全读写访问权限",
"createMode": 2
},
{
"policyId": 399424,
"policyName": "QcloudBMReadOnlyAccess",
"addTime": "2017-09-01 12:05:01",
"type": 2,
"description": "黑石(BM)只读访问权限",
"createMode": 2
},
{
"policyId": 219186,
"policyName": "QcloudCASFullAccess",
"addTime": "2017-06-06 12:42:37",
"type": 2,
"description": "归档存储(CAS)全读写访问权限",
"createMode": 2
},
{
"policyId": 244866,
"policyName": "QcloudCASReadOnlyAccess",
"addTime": "2017-06-21 15:32:48",
"type": 2,
"description": "归档存储(CAS)只读访问权限",
"createMode": 2
},
{
"policyId": 419076,
"policyName": "QcloudCCBFullAccess",
"addTime": "2017-09-07 14:13:10",
"type": 2,
"description": "容器服务-持续集成(CCB)全读写访问权限",
"createMode": 2
},
{
"policyId": 419081,
"policyName": "QcloudCCBReadOnlyAccess",
"addTime": "2017-09-07 14:13:36",
"type": 2,
"description": "容器服务-持续集成(CCB)只读访问权限",
"createMode": 2
},
{
"policyId": 419082,
"policyName": "QcloudCCRFullAccess",
"addTime": "2017-09-07 14:14:12",
"type": 2,
"description": "容器服务-镜像仓库(CCR)全读写访问权限",
"createMode": 2
},
{
"policyId": 419084,
"policyName": "QcloudCCRReadOnlyAccess",
"addTime": "2017-09-07 14:14:30",
"type": 2,
"description": "容器服务-镜像仓库(CCR)只读访问权限",
"createMode": 2
},
{
"policyId": 304652,
"policyName": "QcloudCCSFullAccess",
"addTime": "2017-07-31 19:45:45",
"type": 2,
"description": "容器服务-集群(CCS)全读写访问权限,包括CCS及相关CVM、CLB、VPC、监控权限",
"createMode": 2
},
{
"policyId": 296232,
"policyName": "QcloudCCSInnerFullAccess",
"addTime": "2017-07-26 19:48:14",
"type": 2,
"description": "容器服务-集群(CCS)全部权限",
"createMode": 2
},
{
"policyId": 296233,
"policyName": "QcloudCCSReadOnlyAccess",
"addTime": "2017-07-26 19:51:19",
"type": 2,
"description": "容器服务-集群(CCS)只读权限",
"createMode": 2
},
{
"policyId": 450021,
"policyName": "QcloudCLBFinanceAccess",
"addTime": "2017-09-18 15:35:17",
"type": 2,
"description": "负载均衡(CLB)财务权限",
"createMode": 2
},
{
"policyId": 219850,
"policyName": "QcloudCLBFullAccess",
"addTime": "2017-06-07 11:51:54",
"type": 2,
"description": "负载均衡(CLB)全读写访问权限",
"createMode": 2
},
{
"policyId": 219851,
"policyName": "QcloudCLBReadOnlyAccess",
"addTime": "2017-06-07 11:53:45",
"type": 2,
"description": "负载均衡(CLB)只读访问权限",
"createMode": 2
}
],
"totalNum": 71
}
}
错误码
参见 错误码。