Queries the entities to which a policy is attached.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListEntitiesForPolicy |
The operation that you want to perform. Set the value to ListEntitiesForPolicy. |
PolicyName | String | Yes | OSS-Administrator |
The name of the policy. |
PolicyType | String | Yes | Custom |
The type of the policy. Valid values: |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Users | Array |
The list of the RAM users to which the policy is attached. |
|
User |
The information of a RAM user. |
||
AttachDate | String | 2015-01-23T12:33:18Z |
The time when the policy was attached to the RAM user. |
DisplayName | String | Zhang* |
The display name of the RAM user. |
UserId | String | 122748924538**** |
The unique ID of the RAM user. |
UserName | String | zhangq**** |
The name of the RAM user. |
Groups | Array |
The list of the RAM user groups to which the policy is attached. |
|
Group |
The information of a RAM user group. |
||
AttachDate | String | 2015-02-18T17:22:08Z |
The time when the policy was attached to the RAM user group. |
Comments | String | Test team |
The description of the RAM user group. |
GroupName | String | QA-Team |
The name of the RAM user group. |
Roles | Array |
The list of the RAM roles to which the policy is attached. |
|
Role |
The information of a RAM role. |
||
Arn | String | acs:ram::123456789012****:role/ECSAdmin |
The Alibaba Cloud Resource Name (ARN) of the RAM role. |
AttachDate | String | 2015-01-23T12:33:18Z |
The time when the policy was attached to the RAM role. |
Description | String | ECS administrator |
The description of the RAM role. |
RoleId | String | 122748924538**** |
The ID of the RAM role. |
RoleName | String | ECSAdmin |
The name of the RAM role. |
RequestId | String | 7B8A4E7D-6CFF-471D-84DF-195A7A241ECB |
The ID of the request. |
Examples
Sample requests
https://ram.aliyuncs.com/?Action=ListEntitiesForPolicy
&PolicyName=OSS-Administrator
&PolicyType=Custom
&<Common request parameters>
Sample success responses
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>zhangq****</UserName>
<DisplayName>Zhang*</DisplayName>
<AttachDate>2015-01-23T12:33:18Z</AttachDate>
</User>
<User>
<UserId>140649822472****</UserId>
<UserName>li****</UserName>
<DisplayName>Li*</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 access</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":"zhangq****",
"UserId":"122748924538****",
"DisplayName":"Zhang*",
"AttachDate":"2015-01-23T12:33:18Z"
},
{
"UserName":"li****",
"UserId":"140649822472****",
"DisplayName":"Li*",
"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 access",
"Arn":"acs:ram::123456789012****:role/OSSReadonlyAccess",
"AttachDate":"2015-02-18T17:22:08Z",
"RoleId":"140649822472****"
}
]
}
}
Error codes
For a list of error codes, visit the API Error Center.