Queries the information of a policy version.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GetPolicyVersion |
The operation that you want to perform. Set the value to GetPolicyVersion. |
PolicyName | String | Yes | OSS-Administrator |
The name of the policy. |
PolicyType | String | Yes | Custom |
The type of the policy. Valid values: |
VersionId | String | Yes | v3 |
The ID of the policy version. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
PolicyVersion |
The information of the policy version. |
||
CreateDate | String | 2015-01-23T12:33:18Z |
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 | 9B34724D-54B0-4A51-B34D-4512372FE1BE |
The ID of the request. |
Examples
Sample requests
https://ram.aliyuncs.com/?Action=GetPolicyVersion
&PolicyName=OSS-Administrator
&PolicyType=Custom
&VersionId=v3
&<Common request parameters>
Sample success responses
XML
format
<GetPolicyVersionResponse>
<RequestId>9B34724D-54B0-4A51-B34D-4512372FE1BE</RequestId>
<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>
</GetPolicyVersionResponse>
JSON
format
{
"RequestId":"9B34724D-54B0-4A51-B34D-4512372FE1BE",
"PolicyVersion":{
"IsDefaultVersion":false,
"VersionId":"v3",
"PolicyDocument":"{ \"Statement\": [{ \"Action\": [\"oss:*\"], \"Effect\": \"Allow\", \"Resource\": [\"acs:oss:*:*:*\"]}], \"Version\": \"1\"}",
"CreateDate":"2015-01-23T12:33:18Z"
}
}
Error codes
For a list of error codes, visit the API Error Center.