Get User Policy
POST /iam?Action=GetUserPolicy
Retrieves the specified inline policy document of the specified IAM User.
Query Parameters
UserName | Name of the user to retrieve the inline policy. |
PolicyName | Name of the policy whose Policy Document needs to be retrieved. |
Required Roles
This call has no restrictions.
Request Payload
No Request Payload
Response Body
Field |
Description |
Type |
Notes |
GetUserPolicyResponse |
|
|
|
GetUserPolicyResult |
|
|
|
UserName |
Friendly name of the user. |
String |
|
PolicyName |
Simple name identifying the policy. |
String |
|
PolicyDocument |
The policy Document. |
String |
|
ResponseMetadata |
|
|
|
RequestId |
|
String |
|
Examples
Request
POST https://192.168.0.0:4443/iam?UserName=User1&PolicyName=UserPolicy&Action=GetUserPolicy
Accept: application/xml
X-SDS-AUTH-TOKEN: <AUTH_TOKEN>
x-emc-namespace: <namespace>
Response
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:GetUserPolicyResponse xmlns:ns2="none">
<ResponseMetadata>
<RequestId>0af9f5b8:17178fe9282:96aa:3af</RequestId>
</ResponseMetadata>
<GetUserPolicyResult>
<PolicyDocument>{"Version":"2012-10-17","Statement":[{"Action":["iam:GetUser","iam:GetPolicy","iam:GetGroupPolicy","iam:GetRole","iam:GetAccessKeyLastUsed"],"Resource":"*","Effect":"Allow","Sid":"VisualEditor0"}]}</PolicyDocument>
<PolicyName>UserPolicy</PolicyName>
<UserName>User1</UserName>
</GetUserPolicyResult>
</ns2:GetUserPolicyResponse>
Request
POST https://192.168.0.0:4443/iam?UserName=User1&PolicyName=UserPolicy&Action=GetUserPolicy
Accept: application/json
X-SDS-AUTH-TOKEN: <AUTH_TOKEN>
x-emc-namespace: <namespace>
Response
HTTP/1.1 200 OK
{
"ResponseMetadata": {
"RequestId": "0af9f5b8:17178fe9282:ad1d:66"
},
"GetUserPolicyResult": {
"PolicyName": "UserPolicy",
"PolicyDocument": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Action\":[\"iam:GetUser\",\"iam:GetPolicy\",\"iam:GetGroupPolicy\",\"iam:GetRole\",\"iam:GetAccessKeyLastUsed\"],\"Resource\":\"*\",\"Effect\":\"Allow\",\"Sid\":\"VisualEditor0\"}]}",
"UserName": "User1"
}
}
Request
curl -H $token -H "Content-Type: application/xml" -H "x-emc-namespace: <namespace>" -X POST https://$nodeIp:4443/iam?UserName=User1&PolicyName=UserPolicy&Action=GetUserPolicy
Response
HTTP/1.1 200 OK
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:GetUserPolicyResponse xmlns:ns2="none">
<ResponseMetadata>
<RequestId>0af9f5b8:17178fe9282:96aa:3af</RequestId>
</ResponseMetadata>
<GetUserPolicyResult>
<PolicyDocument>{"Version":"2012-10-17","Statement":[{"Action":["iam:GetUser","iam:GetPolicy","iam:GetGroupPolicy","iam:GetRole","iam:GetAccessKeyLastUsed"],"Resource":"*","Effect":"Allow","Sid":"VisualEditor0"}]}</PolicyDocument>
<PolicyName>UserPolicy</PolicyName>
<UserName>User1</UserName>
</GetUserPolicyResult>
</ns2:GetUserPolicyResponse>