:doc:`DeadlineCloud <../../deadline>` / Client / list_sessions_for_worker

************************
list_sessions_for_worker
************************



.. py:method:: DeadlineCloud.Client.list_sessions_for_worker(**kwargs)

  

  Lists sessions for a worker.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/deadline-2023-10-12/ListSessionsForWorker>`_  


  **Request Syntax**
  ::

    response = client.list_sessions_for_worker(
        farmId='string',
        fleetId='string',
        workerId='string',
        nextToken='string',
        maxResults=123
    )
    
  :type farmId: string
  :param farmId: **[REQUIRED]** 

    The farm ID for the session.

    

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

    The fleet ID for the session.

    

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

    The worker ID for the session.

    

  
  :type nextToken: string
  :param nextToken: 

    The token for the next set of results, or ``null`` to start from the beginning.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of results to return. Use this parameter with ``NextToken`` to get results as a set of sequential pages.

    

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

    
    ::

      {
          'sessions': [
              {
                  'sessionId': 'string',
                  'queueId': 'string',
                  'jobId': 'string',
                  'startedAt': datetime(2015, 1, 1),
                  'lifecycleStatus': 'STARTED'|'UPDATE_IN_PROGRESS'|'UPDATE_SUCCEEDED'|'UPDATE_FAILED'|'ENDED',
                  'endedAt': datetime(2015, 1, 1),
                  'targetLifecycleStatus': 'ENDED'
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The sessions in the response.

        
        

        - *(dict) --* 

          Summarizes the session for a particular worker.

          
          

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

            The session ID for the session action.

            
          

          - **queueId** *(string) --* 

            The queue ID for the queue associated to the worker.

            
          

          - **jobId** *(string) --* 

            The job ID for the job associated with the worker's session.

            
          

          - **startedAt** *(datetime) --* 

            The date and time the resource started running.

            
          

          - **lifecycleStatus** *(string) --* 

            The life cycle status for the worker's session.

            
          

          - **endedAt** *(datetime) --* 

            The date and time the resource ended running.

            
          

          - **targetLifecycleStatus** *(string) --* 

            The life cycle status

            
      
    
      

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

        The token for the next set of results, or ``null`` to start from the beginning.

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

  
  *   :py:class:`DeadlineCloud.Client.exceptions.InternalServerErrorException`

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

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

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

  