Queries the network access restriction policy of an access key for an Alibaba Cloud account or a Resource Access Management (RAM) user.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ram:GetAccessKeyPolicy |
get |
*User
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| UserPrincipalName |
string |
No |
The logon name of the RAM user. If this parameter is left empty, the network access restriction policy of the specified access key for the current user is returned by default. |
test@example.onaliyun.com |
| UserAccessKeyId |
string |
Yes |
The access key ID. |
LTAI******************* |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| AccessKeyPolicy |
string |
The network access restriction policy. The value is a JSON string. For more information, see the AccessKeyPolicy structure description in the SetAccessKeyPolicy documentation. |
{"Status":"Inactive","Statements":[{"Value":"AllowAllVPC","Type":"VPCWhiteList","IPList":["::/0","0.0.0.0/0"]}]} |
| RequestId |
string |
The request ID. |
4B450CA1-36E8-4AA2-8461-86B42BF4CC4E |
| AccessKeyId |
string |
The access key ID. |
LTAI******************* |
Examples
Success response
JSON format
{
"AccessKeyPolicy": "{\"Status\":\"Inactive\",\"Statements\":[{\"Value\":\"AllowAllVPC\",\"Type\":\"VPCWhiteList\",\"IPList\":[\"::/0\",\"0.0.0.0/0\"]}]}",
"RequestId": "4B450CA1-36E8-4AA2-8461-86B42BF4CC4E",
"AccessKeyId": "LTAI*******************"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.