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

**********
get_policy
**********



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

  

  Gets information about the specified policy with the policy document of the default version.

   

  Requires permission to access the `GetPolicy <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/GetPolicy>`_  


  **Request Syntax**
  ::

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

    The name of the policy.

    

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

    
    ::

      {
          'policyName': 'string',
          'policyArn': 'string',
          'policyDocument': 'string',
          'defaultVersionId': 'string',
          'creationDate': datetime(2015, 1, 1),
          'lastModifiedDate': datetime(2015, 1, 1),
          'generationId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      The output from the GetPolicy operation.

      
      

      - **policyName** *(string) --* 

        The policy name.

        
      

      - **policyArn** *(string) --* 

        The policy ARN.

        
      

      - **policyDocument** *(string) --* 

        The JSON document that describes the policy.

        
      

      - **defaultVersionId** *(string) --* 

        The default policy version ID.

        
      

      - **creationDate** *(datetime) --* 

        The date the policy was created.

        
      

      - **lastModifiedDate** *(datetime) --* 

        The date the policy was last modified.

        
      

      - **generationId** *(string) --* 

        The generation ID of the policy.

        
  
  **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`

  