IAM.Paginator.
ListPolicyVersions
¶paginator = client.get_paginator('list_policy_versions')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from IAM.Client.list_policy_versions()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
PolicyArn='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The Amazon Resource Name (ARN) of the IAM policy for which you want the versions.
For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference .
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'Versions': [
{
'Document': 'string',
'VersionId': 'string',
'IsDefaultVersion': True|False,
'CreateDate': datetime(2015, 1, 1)
},
],
'IsTruncated': True|False,
'NextToken': 'string'
}
Response Structure
(dict) --
Contains the response to a successful ListPolicyVersions request.
Versions (list) --
A list of policy versions.
For more information about managed policy versions, see Versioning for managed policies in the IAM User Guide .
(dict) --
Contains information about a version of a managed policy.
This data type is used as a response element in the CreatePolicyVersion, GetPolicyVersion, ListPolicyVersions, and GetAccountAuthorizationDetails operations.
For more information about managed policies, refer to Managed policies and inline policies in the IAM User Guide .
Document (string) --
The policy document.
The policy document is returned in the response to the GetPolicyVersion and GetAccountAuthorizationDetails operations. It is not returned in the response to the CreatePolicyVersion or ListPolicyVersions operations.
The policy document returned in this structure is URL-encoded compliant with RFC 3986. You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode
method of the java.net.URLDecoder
utility class in the Java SDK. Other languages and SDKs provide similar functionality.
VersionId (string) --
The identifier for the policy version.
Policy version identifiers always begin with v
(always lowercase). When a policy is created, the first policy version is v1
.
IsDefaultVersion (boolean) --
Specifies whether the policy version is set as the policy's default version.
CreateDate (datetime) --
The date and time, in ISO 8601 date-time format, when the policy version was created.
IsTruncated (boolean) --
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the Marker
request parameter to retrieve more items. Note that IAM might return fewer than the MaxItems
number of results even when there are more results available. We recommend that you check IsTruncated
after every call to ensure that you receive all your results.
NextToken (string) --
A token to resume pagination.