:doc:`CloudFront <../../cloudfront>` / Client / get_function

************
get_function
************



.. py:method:: CloudFront.Client.get_function(**kwargs)

  

  Gets the code of a CloudFront function. To get configuration information and metadata about a function, use ``DescribeFunction``.

   

  To get a function's code, you must provide the function's name and stage. To get these values, you can use ``ListFunctions``.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2020-05-31/GetFunction>`_  


  **Request Syntax**
  ::

    response = client.get_function(
        Name='string',
        Stage='DEVELOPMENT'|'LIVE'
    )
    
  :type Name: string
  :param Name: **[REQUIRED]** 

    The name of the function whose code you are getting.

    

  
  :type Stage: string
  :param Stage: 

    The function's stage, either ``DEVELOPMENT`` or ``LIVE``.

    

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

    
    ::

      {
          'FunctionCode': StreamingBody(),
          'ETag': 'string',
          'ContentType': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **FunctionCode** (:class:`.StreamingBody`) -- 

        The function code of a CloudFront function.

        
      

      - **ETag** *(string) --* 

        The version identifier for the current version of the CloudFront function.

        
      

      - **ContentType** *(string) --* 

        The content type (media type) of the response.

        
  
  **Exceptions**
  
  *   :py:class:`CloudFront.Client.exceptions.UnsupportedOperation`

  
  *   :py:class:`CloudFront.Client.exceptions.NoSuchFunctionExists`

  