Queries the versions of a policy.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListPolicyVersions |
The operation that you want to perform. Set the value to ListPolicyVersions. |
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 |
---|---|---|---|
PolicyVersions | Array |
The list of the policy versions. |
|
PolicyVersion |
The information of a policy version. |
||
CreateDate | String | 2015-02-26T01:25:52Z |
The time when the version was created. |
IsDefaultVersion | Boolean | false |
Indicates whether the version is the default version. |
PolicyDocument | String | { "Statement": [{ "Action": ["oss:*"], "Effect": "Allow", "Resource": ["acs:oss:*:*:*"]}], "Version": "1"} |
The script of the policy. |
VersionId | String | v3 |
The ID of the version. |
RequestId | String | 7B8A4E7D-6CFF-471D-84DF-195A7A241ECB |
The ID of the request. |
Examples
Sample requests
https://ram.aliyuncs.com/?Action=ListPolicyVersions
&PolicyName=OSS-Administrator
&PolicyType=Custom
&<Common request parameters>
Sample success responses
XML
format
<ListPolicyVersionsResponse>
<RequestId>7B8A4E7D-6CFF-471D-84DF-195A7A241ECB</RequestId>
<PolicyVersions>
<PolicyVersion>
<VersionId>v3</VersionId>
<IsDefaultVersion>false</IsDefaultVersion>
<CreateDate>2015-01-23T12:33:18Z</CreateDate>
<PolicyDocument>{ "Statement": [{ "Action": ["oss:*"], "Effect": "Allow", "Resource": ["acs:oss:*:*:*"]}], "Version": "1"}</PolicyDocument>
</PolicyVersion>
<PolicyVersion>
<VersionId>v5</VersionId>
<IsDefaultVersion>true</IsDefaultVersion>
<CreateDate>2015-02-26T01:25:52Z</CreateDate>
<PolicyDocument>{ "Statement": [{ "Action": ["oss:*"], "Effect": "Allow", "Resource": ["acs:oss:*:*:*"]}], "Version": "1"}</PolicyDocument>
</PolicyVersion>
</PolicyVersions>
</ListPolicyVersionsResponse>
JSON
format
{
"RequestId":"7B8A4E7D-6CFF-471D-84DF-195A7A241ECB",
"PolicyVersions":{
"PolicyVersion":[
{
"IsDefaultVersion":false,
"VersionId":"v3",
"PolicyDocument":"{ \"Statement\": [{ \"Action\": [\"oss:*\"], \"Effect\": \"Allow\", \"Resource\": [\"acs:oss:*:*:*\"]}], \"Version\": \"1\"}",
"CreateDate":"2015-01-23T12:33:18Z"
},
{
"IsDefaultVersion":true,
"VersionId":"v5",
"PolicyDocument":"{ \"Statement\": [{ \"Action\": [\"oss:*\"], \"Effect\": \"Allow\", \"Resource\": [\"acs:oss:*:*:*\"]}], \"Version\": \"1\"}",
"CreateDate":"2015-02-26T01:25:52Z"
}
]
}
}
Error codes
For a list of error codes, visit the API Error Center.