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

************************
test_connection_function
************************



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

  

  Tests a connection function.

  

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


  **Request Syntax**
  ::

    response = client.test_connection_function(
        Id='string',
        IfMatch='string',
        Stage='DEVELOPMENT'|'LIVE',
        ConnectionObject=b'bytes'
    )
    
  :type Id: string
  :param Id: **[REQUIRED]** 

    The connection function ID.

    

  
  :type IfMatch: string
  :param IfMatch: **[REQUIRED]** 

    The current version ( ``ETag`` value) of the connection function.

    

  
  :type Stage: string
  :param Stage: 

    The connection function stage.

    

  
  :type ConnectionObject: bytes
  :param ConnectionObject: **[REQUIRED]** 

    The connection object.

    

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

    
    ::

      {
          'ConnectionFunctionTestResult': {
              'ConnectionFunctionSummary': {
                  'Name': 'string',
                  'Id': 'string',
                  'ConnectionFunctionConfig': {
                      'Comment': 'string',
                      'Runtime': 'cloudfront-js-1.0'|'cloudfront-js-2.0',
                      'KeyValueStoreAssociations': {
                          'Quantity': 123,
                          'Items': [
                              {
                                  'KeyValueStoreARN': 'string'
                              },
                          ]
                      }
                  },
                  'ConnectionFunctionArn': 'string',
                  'Status': 'string',
                  'Stage': 'DEVELOPMENT'|'LIVE',
                  'CreatedTime': datetime(2015, 1, 1),
                  'LastModifiedTime': datetime(2015, 1, 1)
              },
              'ComputeUtilization': 'string',
              'ConnectionFunctionExecutionLogs': [
                  'string',
              ],
              'ConnectionFunctionErrorMessage': 'string',
              'ConnectionFunctionOutput': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ConnectionFunctionTestResult** *(dict) --* 

        The connection function test result.

        
        

        - **ConnectionFunctionSummary** *(dict) --* 

          The connection function summary.

          
          

          - **Name** *(string) --* 

            The connection function name.

            
          

          - **Id** *(string) --* 

            The connection function ID.

            
          

          - **ConnectionFunctionConfig** *(dict) --* 

            Contains configuration information about a CloudFront function.

            
            

            - **Comment** *(string) --* 

              A comment to describe the function.

              
            

            - **Runtime** *(string) --* 

              The function's runtime environment version.

              
            

            - **KeyValueStoreAssociations** *(dict) --* 

              The configuration for the key value store associations.

              
              

              - **Quantity** *(integer) --* 

                The quantity of key value store associations.

                
              

              - **Items** *(list) --* 

                The items of the key value store association.

                
                

                - *(dict) --* 

                  The key value store association.

                  
                  

                  - **KeyValueStoreARN** *(string) --* 

                    The Amazon Resource Name (ARN) of the key value store association.

                    
              
            
          
        
          

          - **ConnectionFunctionArn** *(string) --* 

            The connection function Amazon Resource Name (ARN).

            
          

          - **Status** *(string) --* 

            The connection function status.

            
          

          - **Stage** *(string) --* 

            The connection function stage.

            
          

          - **CreatedTime** *(datetime) --* 

            The connection function created time.

            
          

          - **LastModifiedTime** *(datetime) --* 

            The connection function last modified time.

            
      
        

        - **ComputeUtilization** *(string) --* 

          The connection function compute utilization.

          
        

        - **ConnectionFunctionExecutionLogs** *(list) --* 

          The connection function execution logs.

          
          

          - *(string) --* 
      
        

        - **ConnectionFunctionErrorMessage** *(string) --* 

          The connection function error message.

          
        

        - **ConnectionFunctionOutput** *(string) --* 

          The connection function output.

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

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

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

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

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

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

  