Lists the entities that use a policy.

Debug

Use OpenAPI Explorer to perform debug operations and generate SDK code examples.

Request parameters

Parameter Type Required? Example value Description
Action String Yes ListEntitiesForPolicy

The name of this action.

Value: ListEntitiesForPolicy

PolicyName String Yes OSS-Administrator The policy name.
PolicyType String Yes Custom

The policy type.

Valid values: System | Custom

Response parameters

Parameter Type Example value Description
Users N/A N/A The information about the RAM users that use a policy.
AttachDate String 2015-01-23T12:33:18Z The date and time when a policy was attached to a RAM user.
DisplayName String Alice The display name of a RAM user.
UserId String 122748924538**** The ID of a RAM user.
UserName String Alice The username of a RAM user.
Groups N/A N/A The information about the RAM user groups.
AttachDate String 2015-02-18T17:22:08Z The date and time when a policy was attached to a RAM user group.
Comments String Test development The comment.
GroupName String QA-Team The RAM user group name.
Roles N/A N/A The information about the RAM roles.
Arn String acs:ram::123456789012****:role/ECSAdmin The Alibaba Cloud Resource Name (ARN) of a RAM role.
AttachDate String 2015-01-23T12:33:18Z The date and time when a policy was attached to a RAM role.
Description String ECS administrator The RAM role description.
RoleId String 122748924538**** The RAM role ID.
RoleName String ECSAdmin The RAM role name.
RequestId String 7B8A4E7D-6CFF-471D-84DF-195A7A241ECB The request ID.

Example

Request example

https://ram.aliyuncs.com/?Action=ListEntitiesForPolicy
&PolicyName=OSS-Administrator
&PolicyType=Custom
&<Common parameters>

Response example

XML format

<ListEntitiesForPolicyResponse>
  <RequestId>7B8A4E7D-6CFF-471D-84DF-195A7A241ECB</RequestId>
  <Groups>
    <Group>
      <GroupName>QA-Team</GroupName>
      <Comments>Test team</Comments>
      <AttachDate>2015-01-23T12:33:18Z</AttachDate>
    </Group>
    <Group>
      <GroupName>Dev-Team</GroupName>
      <Comments>Development team</Comments>
      <AttachDate>2015-02-18T17:22:08Z</AttachDate>
    </Group>
  </Groups>
  <Users>
    <User>
      <UserId>122748924538****</UserId>
      <UserName>Alice</UserName>
      <DisplayName>Alice</DisplayName>
      <AttachDate>2015-01-23T12:33:18Z</AttachDate>
    </User>
    <User>
      <UserId>140649822472****</UserId>
      <UserName>Bob</UserName>
      <DisplayName>Bob</DisplayName>
      <AttachDate>2015-02-18T17:22:08Z</AttachDate>
    </User>
  </Users>
  <Roles>
    <Role>
      <RoleId>122748924538****</RoleId>
      <RoleName>ECSAdmin</RoleName>
      <Arn>acs:ram::123456789012****:role/ECSAdmin</Arn>
      <Description>ECS administrator</Description>
      <AttachDate>2015-01-23T12:33:18Z</AttachDate>
    </Role>
    <Role>
      <RoleId>140649822472****</RoleId>
      <RoleName>OSSReadonlyAccess</RoleName>
      <Description>OSS read-only permission</Description>
      <Arn>acs:ram::123456789012****:role/OSSReadonlyAccess</Arn>
      <AttachDate>2015-01-23T12:33:18Z</AttachDate>
    </Role>
  </Roles>
</ListEntitiesForPolicyResponse>

JSON format

{
    "Groups":{
        "Group":[
            {
                "Comments":"Test team",
                "GroupName":"QA-Team",
                "AttachDate":"2015-01-23T12:33:18Z"
            },
            {
                "Comments":"Development team",
                "GroupName":"Dev-Team",
                "AttachDate":"2015-02-18T17:22:08Z"
            }
        ]
    },
    "Users":{
        "User":[
            {
                "UserName":"Alice",
                "UserId":"122748924538****",
                "DisplayName":"Alice",
                "AttachDate":"2015-01-23T12:33:18Z"
            },
            {
                "UserName":"Bob",
                "UserId":"140649822472****",
                "DisplayName":"Bob",
                "AttachDate":"2015-02-18T17:22:08Z"
            }
        ]
    },
    "RequestId":"7B8A4E7D-6CFF-471D-84DF-195A7A241ECB",
    "Roles":{
        "Role":[
            {
                "RoleName":"ECSAdmin",
                "Description":"ECS administrator",
                "Arn":"acs:ram::123456789012****:role/ECSAdmin",
                "AttachDate":"2015-01-23T12:33:18Z",
                "RoleId":"122748924538****"
            },
            {
                "RoleName":"OSSReadonlyAccess",
                "Description":"OSS read-only permission",
                "Arn":"acs:ram::123456789012****:role/OSSReadonlyAccess",
                "AttachDate":"2015-02-18T17:22:08Z",
                "RoleId":"140649822472****"
            }
        ]
    }
}

Errors

For a list of error codes, visit the API Error Center.