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

**********************
list_notebook_sessions
**********************



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

  

  Lists, in descending order, the sessions that have been created in a notebook that are in an active state like ``CREATING``, ``CREATED``, ``IDLE`` or ``BUSY``. Newer sessions are listed first; older sessions are listed later.

  

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


  **Request Syntax**
  ::

    response = client.list_notebook_sessions(
        NotebookId='string',
        MaxResults=123,
        NextToken='string'
    )
    
  :type NotebookId: string
  :param NotebookId: **[REQUIRED]** 

    The ID of the notebook to list sessions for.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of notebook sessions to return.

    

  
  :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.

    

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

    
    ::

      {
          'NotebookSessionsList': [
              {
                  'SessionId': 'string',
                  'CreationTime': datetime(2015, 1, 1)
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **NotebookSessionsList** *(list) --* 

        A list of the sessions belonging to the notebook.

        
        

        - *(dict) --* 

          Contains the notebook session ID and notebook session creation time.

          
          

          - **SessionId** *(string) --* 

            The notebook session ID.

            
          

          - **CreationTime** *(datetime) --* 

            The time when the notebook session was created.

            
      
    
      

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

        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.

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

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

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

  