全部产品
访问控制

ListEntitiesForPolicy

更新时间:2017-06-07 13:26:11   分享:   

列出使用授权策略的实体(ListEntitiesForPolicy)

接口描述

 列出引用授权策略的实体

请求参数

Action

  • 类型:String
  • 必须:是
  • 描述:系统规定参数,取值:ListEntitiesForPolicy

PolicyType

  • 类型:String
  • 必须:是
  • 描述:指定Policy的类型, 取值System或Custom

PolicyName

  • 类型:String
  • 必须:是
  • 描述:授权策略名称

返回参数

Groups

  • 类型:Group Type Array
  • 描述:组信息集合

Users

  • 类型:User Type Array
  • 描述:用户信息集合

Roles

  • 类型:Role Type Array
  • 描述:角色信息结合

需要的权限

Action

ram:ListEntitiesForPolicy

Resource

acs:ram:*:${AccountId}:group/${PolicyName}

错误信息

InvalidParameter.PolicyType
  • HTTP Status:400
  • Error Message:The parameter - “PolicyType” is incorrect.
InvalidParameter.PolicyName.InvalidChars
  • HTTP Status:400
  • Error Message:The parameter - “PolicyNam” contains invalid chars.
InvalidParameter.PolicyName.Length
  • HTTP Status:400
  • Error Message:The parameter - “PolicyName” beyond the length limit.
EntityNotExist.Policy
  • HTTP Status:404
  • Error Message:The policy does not exist.

操作示例

请求示例

  1. https://ram.aliyuncs.com/?Action=ListEntitiesForPolicy
  2. &PolicyName=OSS-Administrator
  3. &PolicyType=Custom
  4. &<公共请求参数>

返回示例

XML格式

  1. <ListEntitiesForPolicyResponse>
  2. <RequestId>7B8A4E7D-6CFF-471D-84DF-195A7A241ECB</RequestId>
  3. <Groups>
  4. <Group>
  5. <GroupName>QA-Team</GroupName>
  6. <Comments>测试团队</Comments>
  7. <AttachDate>2015-01-23T12:33:18Z</AttachDate>
  8. </Group>
  9. <Group>
  10. <GroupName>Dev-Team</GroupName>
  11. <Comments>开发团队</Comments>
  12. <AttachDate>2015-02-18T17:22:08Z</AttachDate>
  13. </Group>
  14. </Groups>
  15. <Users>
  16. <User>
  17. <UserId>1227489245380721</UserId>
  18. <UserName>zhangqiang</UserName>
  19. <DisplayName>张强</DisplayName>
  20. <AttachDate>2015-01-23T12:33:18Z</AttachDate>
  21. </User>
  22. <User>
  23. <UserId>1406498224724456</UserId>
  24. <UserName>lili</UserName>
  25. <DisplayName>李丽</DisplayName>
  26. <AttachDate>2015-02-18T17:22:08Z</AttachDate>
  27. </User>
  28. </Users>
  29. <Roles>
  30. <Role>
  31. <RoleId>901234567890123</RoleId>
  32. <RoleName>ECSAdmin</RoleName>
  33. <Arn>acs:ram::1234567890123456:role/ECSAdmin</Arn>
  34. <Description>ECS管理角色</Description>
  35. <AttachDate>2015-01-23T12:33:18Z</AttachDate>
  36. </Role>
  37. <Role>
  38. <RoleId>901234567890456</RoleId>
  39. <RoleName>OSSReadonlyAccess</RoleName>
  40. <Description>OSS只读访问角色</Description>
  41. <Arn>acs:ram::1234567890123456:role/OSSReadonlyAccess</Arn>
  42. <AttachDate>2015-01-23T12:33:18Z</AttachDate>
  43. </Role>
  44. </Roles>
  45. </ListEntitiesForPolicyResponse>

JSON格式

  1. {
  2. "RequestId" : "7B8A4E7D-6CFF-471D-84DF-195A7A241ECB",
  3. "Groups" : {
  4. "Group" : [
  5. {
  6. "GroupName": "QA-Team",
  7. "Comments": "测试团队",
  8. "AttachDate" : "2015-01-23T12:33:18Z"
  9. },
  10. {
  11. "GroupName": "Dev-Team",
  12. "Comments": "开发团队",
  13. "AttachDate" : "2015-02-18T17:22:08Z"
  14. }
  15. ]
  16. },
  17. "Users" : {
  18. "User" : [
  19. {
  20. "UserId" : "1227489245380721",
  21. "UserName" : "zhangqiang",
  22. "DisplayName": "张强",
  23. "AttachDate" : "2015-01-23T12:33:18Z"
  24. },
  25. {
  26. "UserId" : "1406498224724456",
  27. "UserName" : "lili",
  28. "DisplayName": "李丽",
  29. "AttachDate" : "2015-02-18T17:22:08Z"
  30. }
  31. ]
  32. },
  33. "Roles" : {
  34. "Role" : [
  35. {
  36. "RoleId" : "1227489245380721",
  37. "RoleName" : "ECSAdmin",
  38. "Arn": "acs:ram::1234567890123456:role/ECSAdmin",
  39. "Description": "ECS管理角色",
  40. "AttachDate" : "2015-01-23T12:33:18Z"
  41. },
  42. {
  43. "RoleId" : "1406498224724456",
  44. "RoleName" : "OSSReadonlyAccess",
  45. "Arn": "acs:ram::1234567890123456:role/OSSReadonlyAccess",
  46. "Description": "OSS只读访问角色",
  47. "AttachDate" : "2015-02-18T17:22:08Z"
  48. }
  49. ]
  50. }
  51. }
本文导读目录
本文导读目录
以上内容是否对您有帮助?