Queries the versions of a policy.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ram:ListPolicyVersions |
get |
Policy
Policy
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| PolicyType |
string |
No |
The type of the policy. Valid values: |
Custom |
| PolicyName |
string |
No |
The name of the policy. |
OSS-Administrator |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
7B8A4E7D-6CFF-471D-84DF-195A7A241ECB |
| PolicyVersions |
object |
||
| PolicyVersion |
array<object> |
The information about the policy versions. |
|
|
object |
The information about the policy version. |
||
| IsDefaultVersion |
boolean |
Indicates whether the policy version is the default version. |
false |
| PolicyDocument |
string |
The document of the policy. |
{ "Statement": [{ "Action": ["oss:*"], "Effect": "Allow", "Resource": ["acs:oss:*:*:*"]}], "Version": "1"} |
| VersionId |
string |
The ID of the policy version. |
v3 |
| CreateDate |
string |
The time when the version was created. |
2015-02-26T01:25:52Z |
Examples
Success response
JSON format
{
"RequestId": "7B8A4E7D-6CFF-471D-84DF-195A7A241ECB",
"PolicyVersions": {
"PolicyVersion": [
{
"IsDefaultVersion": false,
"PolicyDocument": "{ \"Statement\": [{ \"Action\": [\"oss:*\"], \"Effect\": \"Allow\", \"Resource\": [\"acs:oss:*:*:*\"]}], \"Version\": \"1\"}",
"VersionId": "v3",
"CreateDate": "2015-02-26T01:25:52Z"
}
]
}
}
Error response
JSON format
{
"RequestId": "7B8A4E7D-6CFF-471D-84DF-195A7A241ECB",
"PolicyVersions": {
"PolicyVersion": [
{
"VersionId": "v3",
"IsDefaultVersion": false,
"CreateDate": "2015-01-23T12:33:18Z"
},
{
"VersionId": "v5",
"IsDefaultVersion": true,
"CreateDate": "2015-02-26T01:25:52Z"
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.