:doc:`WorkSpacesWeb <../../workspaces-web>` / Client / list_sessions

*************
list_sessions
*************



.. py:method:: WorkSpacesWeb.Client.list_sessions(**kwargs)

  

  Lists information for multiple secure browser sessions from a specific portal.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/workspaces-web-2020-07-08/ListSessions>`_  


  **Request Syntax**
  ::

    response = client.list_sessions(
        portalId='string',
        username='string',
        sessionId='string',
        sortBy='StartTimeAscending'|'StartTimeDescending',
        status='Active'|'Terminated',
        maxResults=123,
        nextToken='string'
    )
    
  :type portalId: string
  :param portalId: **[REQUIRED]** 

    The ID of the web portal for the sessions.

    

  
  :type username: string
  :param username: 

    The username of the session.

    

  
  :type sessionId: string
  :param sessionId: 

    The ID of the session.

    

  
  :type sortBy: string
  :param sortBy: 

    The method in which the returned sessions should be sorted.

    

  
  :type status: string
  :param status: 

    The status of the session.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of results to be included in the next page.

    

  
  :type nextToken: string
  :param nextToken: 

    The pagination token used to retrieve the next page of results for this operation.

    

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

    
    ::

      {
          'sessions': [
              {
                  'portalArn': 'string',
                  'sessionId': 'string',
                  'username': 'string',
                  'status': 'Active'|'Terminated',
                  'startTime': datetime(2015, 1, 1),
                  'endTime': datetime(2015, 1, 1)
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **sessions** *(list) --* 

        The sessions in a list.

        
        

        - *(dict) --* 

          Summary information about a secure browser session.

          
          

          - **portalArn** *(string) --* 

            The ARN of the web portal.

            
          

          - **sessionId** *(string) --* 

            The ID of the session.

            
          

          - **username** *(string) --* 

            The username of the session.

            
          

          - **status** *(string) --* 

            The status of the session.

            
          

          - **startTime** *(datetime) --* 

            The start time of the session.

            
          

          - **endTime** *(datetime) --* 

            The end time of the session.

            
      
    
      

      - **nextToken** *(string) --* 

        The pagination token used to retrieve the next page of results for this operation.

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

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

  
  *   :py:class:`WorkSpacesWeb.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`WorkSpacesWeb.Client.exceptions.ThrottlingException`

  
  *   :py:class:`WorkSpacesWeb.Client.exceptions.ValidationException`

  