:doc:`Glue <../../glue>` / Client / list_statements

***************
list_statements
***************



.. py:method:: Glue.Client.list_statements(**kwargs)

  

  Lists statements for the session.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListStatements>`_  


  **Request Syntax**
  ::

    response = client.list_statements(
        SessionId='string',
        RequestOrigin='string',
        NextToken='string'
    )
    
  :type SessionId: string
  :param SessionId: **[REQUIRED]** 

    The Session ID of the statements.

    

  
  :type RequestOrigin: string
  :param RequestOrigin: 

    The origin of the request to list statements.

    

  
  :type NextToken: string
  :param NextToken: 

    A continuation token, if this is a continuation call.

    

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

    
    ::

      {
          'Statements': [
              {
                  'Id': 123,
                  'Code': 'string',
                  'State': 'WAITING'|'RUNNING'|'AVAILABLE'|'CANCELLING'|'CANCELLED'|'ERROR',
                  'Output': {
                      'Data': {
                          'TextPlain': 'string'
                      },
                      'ExecutionCount': 123,
                      'Status': 'WAITING'|'RUNNING'|'AVAILABLE'|'CANCELLING'|'CANCELLED'|'ERROR',
                      'ErrorName': 'string',
                      'ErrorValue': 'string',
                      'Traceback': [
                          'string',
                      ]
                  },
                  'Progress': 123.0,
                  'StartedOn': 123,
                  'CompletedOn': 123
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Statements** *(list) --* 

        Returns the list of statements.

        
        

        - *(dict) --* 

          The statement or request for a particular action to occur in a session.

          
          

          - **Id** *(integer) --* 

            The ID of the statement.

            
          

          - **Code** *(string) --* 

            The execution code of the statement.

            
          

          - **State** *(string) --* 

            The state while request is actioned.

            
          

          - **Output** *(dict) --* 

            The output in JSON.

            
            

            - **Data** *(dict) --* 

              The code execution output.

              
              

              - **TextPlain** *(string) --* 

                The code execution output in text format.

                
          
            

            - **ExecutionCount** *(integer) --* 

              The execution count of the output.

              
            

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

              The status of the code execution output.

              
            

            - **ErrorName** *(string) --* 

              The name of the error in the output.

              
            

            - **ErrorValue** *(string) --* 

              The error value of the output.

              
            

            - **Traceback** *(list) --* 

              The traceback of the output.

              
              

              - *(string) --* 
          
        
          

          - **Progress** *(float) --* 

            The code execution progress.

            
          

          - **StartedOn** *(integer) --* 

            The unix time and date that the job definition was started.

            
          

          - **CompletedOn** *(integer) --* 

            The unix time and date that the job definition was completed.

            
      
    
      

      - **NextToken** *(string) --* 

        A continuation token, if not all statements have yet been returned.

        
  
  **Exceptions**
  
  *   :py:class:`Glue.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`Glue.Client.exceptions.EntityNotFoundException`

  
  *   :py:class:`Glue.Client.exceptions.InternalServiceException`

  
  *   :py:class:`Glue.Client.exceptions.OperationTimeoutException`

  
  *   :py:class:`Glue.Client.exceptions.InvalidInputException`

  
  *   :py:class:`Glue.Client.exceptions.IllegalSessionStateException`

  