:doc:`AppStream <../../appstream>` / Client / describe_sessions

*****************
describe_sessions
*****************



.. py:method:: AppStream.Client.describe_sessions(**kwargs)

  

  Retrieves a list that describes the streaming sessions for a specified stack and fleet. If a UserId is provided for the stack and fleet, only streaming sessions for that user are described. If an authentication type is not provided, the default is to authenticate users using a streaming URL.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DescribeSessions>`_  


  **Request Syntax**
  ::

    response = client.describe_sessions(
        StackName='string',
        FleetName='string',
        UserId='string',
        NextToken='string',
        Limit=123,
        AuthenticationType='API'|'SAML'|'USERPOOL'|'AWS_AD',
        InstanceId='string'
    )
    
  :type StackName: string
  :param StackName: **[REQUIRED]** 

    The name of the stack. This value is case-sensitive.

    

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

    The name of the fleet. This value is case-sensitive.

    

  
  :type UserId: string
  :param UserId: 

    The user identifier (ID). If you specify a user ID, you must also specify the authentication type.

    

  
  :type NextToken: string
  :param NextToken: 

    The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.

    

  
  :type Limit: integer
  :param Limit: 

    The size of each page of results. The default value is 20 and the maximum value is 50.

    

  
  :type AuthenticationType: string
  :param AuthenticationType: 

    The authentication method. Specify ``API`` for a user authenticated using a streaming URL or ``SAML`` for a SAML federated user. The default is to authenticate users using a streaming URL.

    

  
  :type InstanceId: string
  :param InstanceId: 

    The identifier for the instance hosting the session.

    

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

    
    ::

      {
          'Sessions': [
              {
                  'Id': 'string',
                  'UserId': 'string',
                  'StackName': 'string',
                  'FleetName': 'string',
                  'State': 'ACTIVE'|'PENDING'|'EXPIRED',
                  'ConnectionState': 'CONNECTED'|'NOT_CONNECTED',
                  'StartTime': datetime(2015, 1, 1),
                  'MaxExpirationTime': datetime(2015, 1, 1),
                  'AuthenticationType': 'API'|'SAML'|'USERPOOL'|'AWS_AD',
                  'NetworkAccessConfiguration': {
                      'EniPrivateIpAddress': 'string',
                      'EniIpv6Addresses': [
                          'string',
                      ],
                      'EniId': 'string'
                  },
                  'InstanceId': 'string'
              },
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Sessions** *(list) --* 

        Information about the streaming sessions.

        
        

        - *(dict) --* 

          Describes a streaming session.

          
          

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

            The identifier of the streaming session.

            
          

          - **UserId** *(string) --* 

            The identifier of the user for whom the session was created.

            
          

          - **StackName** *(string) --* 

            The name of the stack for the streaming session.

            
          

          - **FleetName** *(string) --* 

            The name of the fleet for the streaming session.

            
          

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

            The current state of the streaming session.

            
          

          - **ConnectionState** *(string) --* 

            Specifies whether a user is connected to the streaming session.

            
          

          - **StartTime** *(datetime) --* 

            The time when a streaming instance is dedicated for the user.

            
          

          - **MaxExpirationTime** *(datetime) --* 

            The time when the streaming session is set to expire. This time is based on the ``MaxUserDurationinSeconds`` value, which determines the maximum length of time that a streaming session can run. A streaming session might end earlier than the time specified in ``SessionMaxExpirationTime``, when the ``DisconnectTimeOutInSeconds`` elapses or the user chooses to end his or her session. If the ``DisconnectTimeOutInSeconds`` elapses, or the user chooses to end his or her session, the streaming instance is terminated and the streaming session ends.

            
          

          - **AuthenticationType** *(string) --* 

            The authentication method. The user is authenticated using a streaming URL ( ``API``) or SAML 2.0 federation ( ``SAML``).

            
          

          - **NetworkAccessConfiguration** *(dict) --* 

            The network details for the streaming session.

            
            

            - **EniPrivateIpAddress** *(string) --* 

              The private IP address of the elastic network interface that is attached to instances in your VPC.

              
            

            - **EniIpv6Addresses** *(list) --* 

              The IPv6 addresses assigned to the elastic network interface. This field supports IPv6 connectivity for WorkSpaces Applications instances.

              
              

              - *(string) --* 
          
            

            - **EniId** *(string) --* 

              The resource identifier of the elastic network interface that is attached to instances in your VPC. All network interfaces have the eni-xxxxxxxx resource identifier.

              
        
          

          - **InstanceId** *(string) --* 

            The identifier for the instance hosting the session.

            
      
    
      

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

        The pagination token to use to retrieve the next page of results for this operation. If there are no more pages, this value is null.

        
  
  **Exceptions**
  
  *   :py:class:`AppStream.Client.exceptions.InvalidParameterCombinationException`

  