edit-icon download-icon

ListPolicyVersions

Last Updated: Nov 10, 2017

Interface description

Lists authorization policy versions.

Request parameters

Action

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

PolicyType

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

PolicyName

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

Return parameters

PolicyVersions

Required permissions

Action

ram:ListPolicyVersions

Resource

acs:ram:*:${AccountId} or system:policy/${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.
EntityNotExist.Policy
  • HTTP Status: 404
  • Error Message: The policy does not exist.

Operation examples

Request example

  1. https://ram.aliyuncs.com/?Action=ListPolicyVersions
  2. &<Public request parameters>

Return example

XML format

  1. <ListPolicyVersionsResponse>
  2. <RequestId>7B8A4E7D-6CFF-471D-84DF-195A7A241ECB</RequestId>
  3. <PolicyVersions>
  4. <PolicyVersion>
  5. <VersionId>v3</VersionId>
  6. <IsDefaultVersion>false</IsDefaultVersion>
  7. <CreateDate>2015-01-23T12:33:18Z</CreateDate>
  8. </PolicyVersion>
  9. <PolicyVersion>
  10. <VersionId>v5</VersionId>
  11. <IsDefaultVersion>true</IsDefaultVersion>
  12. <CreateDate>2015-02-26T01:25:52Z</CreateDate>
  13. </PolicyVersion>
  14. </PolicyVersions>
  15. </ListPolicyVersionsResponse>

JSON format

  1. {
  2. "RequestId": "7B8A4E7D-6CFF-471D-84DF-195A7A241ECB",
  3. "PolicyVersions": {
  4. "PolicyVersion": [
  5. {
  6. "VersionId": "v3",
  7. "IsDefaultVersion": false,
  8. "CreateDate": "2015-01-23T12:33:18Z"
  9. },
  10. {
  11. "VersionId": "v5",
  12. "IsDefaultVersion": true,
  13. "CreateDate": "2015-02-26T01:25:52Z"
  14. }
  15. ]
  16. }
  17. }
Thank you! We've received your feedback.