:doc:`IoT <../../iot>` / Client / list_policy_versions

********************
list_policy_versions
********************



.. py:method:: IoT.Client.list_policy_versions(**kwargs)

  

  Lists the versions of the specified policy and identifies the default version.

   

  Requires permission to access the `ListPolicyVersions <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions>`__ action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/iot-2015-05-28/ListPolicyVersions>`_  


  **Request Syntax**
  ::

    response = client.list_policy_versions(
        policyName='string'
    )
    
  :type policyName: string
  :param policyName: **[REQUIRED]** 

    The policy name.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'policyVersions': [
              {
                  'versionId': 'string',
                  'isDefaultVersion': True|False,
                  'createDate': datetime(2015, 1, 1)
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 

      The output from the ListPolicyVersions operation.

      
      

      - **policyVersions** *(list) --* 

        The policy versions.

        
        

        - *(dict) --* 

          Describes a policy version.

          
          

          - **versionId** *(string) --* 

            The policy version ID.

            
          

          - **isDefaultVersion** *(boolean) --* 

            Specifies whether the policy version is the default.

            
          

          - **createDate** *(datetime) --* 

            The date and time the policy was created.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`IoT.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`IoT.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`IoT.Client.exceptions.ThrottlingException`

  
  *   :py:class:`IoT.Client.exceptions.UnauthorizedException`

  
  *   :py:class:`IoT.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`IoT.Client.exceptions.InternalFailureException`

  