:doc:`Athena <../../athena>` / Client / list_query_executions

*********************
list_query_executions
*********************



.. py:method:: Athena.Client.list_query_executions(**kwargs)

  

  Provides a list of available query execution IDs for the queries in the specified workgroup. Athena keeps a query history for 45 days. If a workgroup is not specified, returns a list of query execution IDs for the primary workgroup. Requires you to have access to the workgroup in which the queries ran.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/athena-2017-05-18/ListQueryExecutions>`_  


  **Request Syntax**
  ::

    response = client.list_query_executions(
        NextToken='string',
        MaxResults=123,
        WorkGroup='string'
    )
    
  :type NextToken: string
  :param NextToken: 

    A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the ``NextToken`` from the response object of the previous page call.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of query executions to return in this request.

    

  
  :type WorkGroup: string
  :param WorkGroup: 

    The name of the workgroup from which queries are being returned. If a workgroup is not specified, a list of available query execution IDs for the queries in the primary workgroup is returned.

    

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

    
    ::

      {
          'QueryExecutionIds': [
              'string',
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **QueryExecutionIds** *(list) --* 

        The unique IDs of each query execution as an array of strings.

        
        

        - *(string) --* 
    
      

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

        A token to be used by the next request if this request is truncated.

        
  
  **Exceptions**
  
  *   :py:class:`Athena.Client.exceptions.InternalServerException`

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

  