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

*************
create_worker
*************



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

  

  Creates a worker. A worker tells your instance how much processing power (vCPU), and memory (GiB) you’ll need to assemble the digital assets held within a particular instance. You can specify certain instance types to use, or let the worker know which instances types to exclude.

   

  Deadline Cloud limits the number of workers to less than or equal to the fleet's maximum worker count. The service maintains eventual consistency for the worker count. If you make multiple rapid calls to ``CreateWorker`` before the field updates, you might exceed your fleet's maximum worker count. For example, if your ``maxWorkerCount`` is 10 and you currently have 9 workers, making two quick ``CreateWorker`` calls might successfully create 2 workers instead of 1, resulting in 11 total workers.

  

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


  **Request Syntax**
  ::

    response = client.create_worker(
        farmId='string',
        fleetId='string',
        hostProperties={
            'ipAddresses': {
                'ipV4Addresses': [
                    'string',
                ],
                'ipV6Addresses': [
                    'string',
                ]
            },
            'hostName': 'string'
        },
        clientToken='string',
        tags={
            'string': 'string'
        }
    )
    
  :type farmId: string
  :param farmId: **[REQUIRED]** 

    The farm ID of the farm to connect to the worker.

    

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

    The fleet ID to connect to the worker.

    

  
  :type hostProperties: dict
  :param hostProperties: 

    The IP address and host name of the worker.

    

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

      

    
  
  :type clientToken: string
  :param clientToken: 

    The unique token which the server uses to recognize retries of the same request.

    This field is autopopulated if not provided.

  
  :type tags: dict
  :param tags: 

    Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {
          'workerId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **workerId** *(string) --* 

        The worker ID.

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

  