:doc:`LakeFormation <../../lakeformation>` / Client / get_work_units

**************
get_work_units
**************



.. py:method:: LakeFormation.Client.get_work_units(**kwargs)

  

  Retrieves the work units generated by the ``StartQueryPlanning`` operation.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/GetWorkUnits>`_  


  **Request Syntax**
  ::

    response = client.get_work_units(
        NextToken='string',
        PageSize=123,
        QueryId='string'
    )
    
  :type NextToken: string
  :param NextToken: 

    A continuation token, if this is a continuation call.

    

  
  :type PageSize: integer
  :param PageSize: 

    The size of each page to get in the Amazon Web Services service call. This does not affect the number of items returned in the command's output. Setting a smaller page size results in more calls to the Amazon Web Services service, retrieving fewer items in each call. This can help prevent the Amazon Web Services service calls from timing out.

    

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

    The ID of the plan query operation.

    

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

    
    ::

      {
          'NextToken': 'string',
          'QueryId': 'string',
          'WorkUnitRanges': [
              {
                  'WorkUnitIdMax': 123,
                  'WorkUnitIdMin': 123,
                  'WorkUnitToken': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 

      A structure for the output.

      
      

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

        A continuation token for paginating the returned list of tokens, returned if the current segment of the list is not the last.

        
      

      - **QueryId** *(string) --* 

        The ID of the plan query operation.

        
      

      - **WorkUnitRanges** *(list) --* 

        A ``WorkUnitRangeList`` object that specifies the valid range of work unit IDs for querying the execution service.

        
        

        - *(dict) --* 

          Defines the valid range of work unit IDs for querying the execution service.

          
          

          - **WorkUnitIdMax** *(integer) --* 

            Defines the maximum work unit ID in the range. The maximum value is inclusive.

            
          

          - **WorkUnitIdMin** *(integer) --* 

            Defines the minimum work unit ID in the range.

            
          

          - **WorkUnitToken** *(string) --* 

            A work token used to query the execution service.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`LakeFormation.Client.exceptions.WorkUnitsNotReadyYetException`

  
  *   :py:class:`LakeFormation.Client.exceptions.InternalServiceException`

  
  *   :py:class:`LakeFormation.Client.exceptions.InvalidInputException`

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

  
  *   :py:class:`LakeFormation.Client.exceptions.ExpiredException`

  