接口描述

列出引用授权策略的实体

请求参数

Action
  • 类型:String
  • 必须:是
  • 描述:系统规定参数,取值:ListEntitiesForPolicy
PolicyType
  • 类型:String
  • 必须:是
  • 描述:指定Policy的类型, 取值System或Custom
PolicyName
  • 类型:String
  • 必须:是
  • 描述:授权策略名称

返回参数

Groups
  • 类型:Group Array
  • 描述:组信息集合
Users
  • 类型:User Array
  • 描述:用户信息集合
Roles
  • 类型:Role 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.

操作示例

请求示例

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

返回示例

  • XML格式
    <ListEntitiesForPolicyResponse>
        <RequestId>7B8A4E7D-6CFF-471D-84DF-195A7A241ECB</RequestId>
        <Groups>
            <Group>
                <GroupName>QA-Team</GroupName>
                <Comments>测试团队</Comments>
                <AttachDate>2015-01-23T12:33:18Z</AttachDate>
            </Group>
            <Group>
                <GroupName>Dev-Team</GroupName>
                <Comments>开发团队</Comments>
                <AttachDate>2015-02-18T17:22:08Z</AttachDate>
            </Group>
        </Groups>
        <Users>
            <User>
                <UserId>1227489245380721</UserId>
                <UserName>zhangqiang</UserName>
                <DisplayName>张强</DisplayName>
                <AttachDate>2015-01-23T12:33:18Z</AttachDate>
            </User>
            <User>
                <UserId>1406498224724456</UserId>
                <UserName>lili</UserName>
                <DisplayName>李丽</DisplayName>
                <AttachDate>2015-02-18T17:22:08Z</AttachDate>
            </User>
        </Users>
        <Roles>
            <Role>
                <RoleId>901234567890123</RoleId>
                <RoleName>ECSAdmin</RoleName>
                <Arn>acs:ram::1234567890123456:role/ECSAdmin</Arn>
                <Description>ECS管理角色</Description>
                <AttachDate>2015-01-23T12:33:18Z</AttachDate>
            </Role>
            <Role>
                <RoleId>901234567890456</RoleId>
                <RoleName>OSSReadonlyAccess</RoleName>
                <Description>OSS只读访问角色</Description>
                <Arn>acs:ram::1234567890123456:role/OSSReadonlyAccess</Arn>
                <AttachDate>2015-01-23T12:33:18Z</AttachDate>
            </Role>
        </Roles>
    </ListEntitiesForPolicyResponse>
  • JSON格式
    {
      "RequestId" : "7B8A4E7D-6CFF-471D-84DF-195A7A241ECB",
      "Groups" : {
        "Group" : [
          {
            "GroupName": "QA-Team",
            "Comments": "测试团队",
            "AttachDate" : "2015-01-23T12:33:18Z"
          },
          {
            "GroupName": "Dev-Team",
            "Comments": "开发团队",
            "AttachDate" : "2015-02-18T17:22:08Z"
          }
        ]
      },
      "Users" : {
        "User" : [
          {
            "UserId" : "1227489245380721",
            "UserName" : "zhangqiang",
            "DisplayName": "张强",
            "AttachDate" : "2015-01-23T12:33:18Z"
          },
          {
            "UserId" : "1406498224724456",
            "UserName" : "lili",
            "DisplayName": "李丽",
            "AttachDate" : "2015-02-18T17:22:08Z"
          }
        ]
      },
      "Roles" : {
        "Role" : [
          {
            "RoleId" : "1227489245380721",
            "RoleName" : "ECSAdmin",
            "Arn": "acs:ram::1234567890123456:role/ECSAdmin",
            "Description": "ECS管理角色",
            "AttachDate" : "2015-01-23T12:33:18Z"
          },
          {
            "RoleId" : "1406498224724456",
            "RoleName" : "OSSReadonlyAccess",
            "Arn": "acs:ram::1234567890123456:role/OSSReadonlyAccess",
            "Description": "OSS只读访问角色",
            "AttachDate" : "2015-02-18T17:22:08Z"
          }
        ]
      }
    }