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

*************
update_worker
*************



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

  

  Updates a worker.

  

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


  **Request Syntax**
  ::

    response = client.update_worker(
        farmId='string',
        fleetId='string',
        workerId='string',
        status='STARTED'|'STOPPING'|'STOPPED',
        capabilities={
            'amounts': [
                {
                    'name': 'string',
                    'value': ...
                },
            ],
            'attributes': [
                {
                    'name': 'string',
                    'values': [
                        'string',
                    ]
                },
            ]
        },
        hostProperties={
            'ipAddresses': {
                'ipV4Addresses': [
                    'string',
                ],
                'ipV6Addresses': [
                    'string',
                ]
            },
            'hostName': 'string'
        }
    )
    
  :type farmId: string
  :param farmId: **[REQUIRED]** 

    The farm ID to update.

    

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

    The fleet ID to update.

    

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

    The worker ID to update.

    

  
  :type status: string
  :param status: 

    The worker status to update.

    

  
  :type capabilities: dict
  :param capabilities: 

    The worker capabilities to update.

    

  
    - **amounts** *(list) --* **[REQUIRED]** 

      The worker capabilities amounts on a list of worker capabilities.

      

    
      - *(dict) --* 

        The details of the worker amount capability.

        

      
        - **name** *(string) --* **[REQUIRED]** 

          The name of the worker amount capability.

          

        
        - **value** *(float) --* **[REQUIRED]** 

          The value of the worker amount capability.

          

        
      
  
    - **attributes** *(list) --* **[REQUIRED]** 

      The worker attribute capabilities in the list of attribute capabilities.

      

    
      - *(dict) --* 

        The details of the worker attribute capability.

        

      
        - **name** *(string) --* **[REQUIRED]** 

          The name of the worker attribute capability.

          

        
        - **values** *(list) --* **[REQUIRED]** 

          The values of the worker amount capability.

          

        
          - *(string) --* 

          
      
      
  
  
  :type hostProperties: dict
  :param hostProperties: 

    The host properties to update.

    

  
    - **ipAddresses** *(dict) --* 

      The IP address of the host.

      

    
      - **ipV4Addresses** *(list) --* 

        The IpV4 address of the network.

        

      
        - *(string) --* 

        
    
      - **ipV6Addresses** *(list) --* 

        The IpV6 address for the network and node component.

        

      
        - *(string) --* 

        
    
    
    - **hostName** *(string) --* 

      The host name.

      

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

    
    ::

      {
          'log': {
              'logDriver': 'string',
              'options': {
                  'string': 'string'
              },
              'parameters': {
                  'string': 'string'
              },
              'error': 'string'
          },
          'hostConfiguration': {
              'scriptBody': 'string',
              'scriptTimeoutSeconds': 123
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **log** *(dict) --* 

        The worker log to update.

        
        

        - **logDriver** *(string) --* 

          The log drivers for worker related logs.

          
        

        - **options** *(dict) --* 

          The options for a log driver.

          
          

          - *(string) --* 
            

            - *(string) --* 
      
    
        

        - **parameters** *(dict) --* 

          The parameters for the log configuration.

          
          

          - *(string) --* 
            

            - *(string) --* 
      
    
        

        - **error** *(string) --* 

          The log configuration error details.

          
    
      

      - **hostConfiguration** *(dict) --* 

        The script that runs as a worker is starting up that you can use to provide additional configuration for workers in your fleet.

        
        

        - **scriptBody** *(string) --* 

          The text of the script that runs as a worker is starting up that you can use to provide additional configuration for workers in your fleet. The script runs after a worker enters the ``STARTING`` state and before the worker processes tasks.

           

          For more information about using the script, see `Run scripts as an administrator to configure workers <https://docs.aws.amazon.com/deadline-cloud/latest/developerguide/smf-admin.html>`__ in the *Deadline Cloud Developer Guide*.

           

          .. warning::

             

            The script runs as an administrative user ( ``sudo root`` on Linux, as an Administrator on Windows).

            

          
        

        - **scriptTimeoutSeconds** *(integer) --* 

          The maximum time that the host configuration can run. If the timeout expires, the worker enters the ``NOT RESPONDING`` state and shuts down. You are charged for the time that the worker is running the host configuration script.

           

          .. note::

            

            You should configure your fleet for a maximum of one worker while testing your host configuration script to avoid starting additional workers.

            

           

          The default is 300 seconds (5 minutes).

          
    
  
  **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.ConflictException`

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

  