GetPolicyVersion

Last Updated: Nov 10, 2017

Interface description

Obtains an authorization policy version.

Request parameters

Action

  • Type: String
  • Required: Yes
  • Description: Required. The parameter value is “GetPolicyVersion”.

PolicyType

  • Type: String
  • Required: Yes
  • Description: Authorization policy type. Value: “System” or “Custom”.

PolicyName

  • Type: String
  • Required: Yes
  • Description: Authorization policy name.

VersionId

  • Type: String
  • Required: Yes
  • Description: Target version ID.

Return parameters

PolicyVersion

  • Name: PolicyVersion Type
  • Type: String
  • Description: Authorization policy version information.

Required permissions

Action

ram:GetPolicyVersion

Resource

acs:ram:*:${AccountId} or system:group/${PolicyName}

Error messages

InvalidParameter.PolicyType
  • HTTP Status: 400
  • Error Message: The parameter - “PolicyType” is incorrect.
InvalidParameter.PolicyName.InvalidChars
  • HTTP Status: 400
  • Error Message: The parameter - “PolicyNam” contains invalid chars.
InvalidParameter.PolicyName.Length
  • HTTP Status: 400
  • Error Message: The parameter - “PolicyName” beyond the length limit.
InvalidParameter.VersionId.Format
  • HTTP Status: 400
  • Error Message: The format of the parameter - “VersionId” is incorrect.
EntityNotExist.Policy
  • HTTP Status: 404
  • Error Message: The policy does not exist.
EntityNotExist.Policy.Version
  • HTTP Status: 404
  • Error Message: The policy version does not exist.

Operation examples

Request example

  1. https://ram.aliyuncs.com/?Action=GetPolicyVersion
  2. &PolicyName=OSS-Administrator
  3. &PolicyType=Custom
  4. &VersionId=v3
  5. &<Public request parameters>

Return example

XML format

  1. <GetPolicyVersionResponse>
  2. <RequestId>9B34724D-54B0-4A51-B34D-4512372FE1BE</RequestId>
  3. <PolicyVersion>
  4. <VersionId>v3</VersionId>
  5. <IsDefaultVersion>false</IsDefaultVersion>
  6. <CreateDate>2015-01-23T12:33:18Z</CreateDate>
  7. <PolicyDocument>
  8. { "Statement": [{ "Action": ["oss:*"], "Effect": "Allow", "Resource": ["acs:oss:*:*:*"]}], "Version": "1"}
  9. </PolicyDocument>
  10. </PolicyVersion>
  11. </GetPolicyVersionResponse>

JSON format

  1. {
  2. "RequestId": "9B34724D-54B0-4A51-B34D-4512372FE1BE",
  3. "PolicyVersion": {
  4. "VersionId": "v3",
  5. "IsDefaultVersion": false,
  6. "CreateDate": "2015-01-23T12:33:18Z",
  7. "PolicyDocument": "{ \"Statement\": [{ \"Action\": [\"oss:*\"], \"Effect\": \"Allow\", \"Resource\": [\"acs:oss:*:*:*\"]}], \"Version\": \"1\"}"
  8. }
  9. }
Thank you! We've received your feedback.