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

**********
create_job
**********



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

  

  Creates a job. A job is a set of instructions that Deadline Cloud uses to schedule and run work on available workers. For more information, see `Deadline Cloud jobs <https://docs.aws.amazon.com/deadline-cloud/latest/userguide/deadline-cloud-jobs.html>`__.

  

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


  **Request Syntax**
  ::

    response = client.create_job(
        farmId='string',
        queueId='string',
        clientToken='string',
        template='string',
        templateType='JSON'|'YAML',
        priority=123,
        parameters={
            'string': {
                'int': 'string',
                'float': 'string',
                'string': 'string',
                'path': 'string'
            }
        },
        attachments={
            'manifests': [
                {
                    'fileSystemLocationName': 'string',
                    'rootPath': 'string',
                    'rootPathFormat': 'windows'|'posix',
                    'outputRelativeDirectories': [
                        'string',
                    ],
                    'inputManifestPath': 'string',
                    'inputManifestHash': 'string'
                },
            ],
            'fileSystem': 'COPIED'|'VIRTUAL'
        },
        storageProfileId='string',
        targetTaskRunStatus='READY'|'SUSPENDED',
        maxFailedTasksCount=123,
        maxRetriesPerTask=123,
        maxWorkerCount=123,
        sourceJobId='string',
        nameOverride='string',
        descriptionOverride='string',
        tags={
            'string': 'string'
        }
    )
    
  :type farmId: string
  :param farmId: **[REQUIRED]** 

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

    

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

    The ID of the queue that the job is submitted to.

    

  
  :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 template: string
  :param template: 

    The job template to use for this job.

    

  
  :type templateType: string
  :param templateType: 

    The file type for the job template.

    

  
  :type priority: integer
  :param priority: **[REQUIRED]** 

    The priority of the job. The highest priority (first scheduled) is 100. When two jobs have the same priority, the oldest job is scheduled first.

    

  
  :type parameters: dict
  :param parameters: 

    The parameters for the job.

    

  
    - *(string) --* 

    
      - *(dict) --* 

        The details of job parameters.

        .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``int``, ``float``, ``string``, ``path``. 

      
        - **int** *(string) --* 

          A signed integer represented as a string.

          

        
        - **float** *(string) --* 

          A double precision IEEE-754 floating point number represented as a string.

          

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

          A UTF-8 string.

          

        
        - **path** *(string) --* 

          A file system path represented as a string.

          

        
      


  :type attachments: dict
  :param attachments: 

    The attachments for the job. Attach files required for the job to run to a render job.

    

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

      The manifest properties for the attachments.

      

    
      - *(dict) --* 

        The details of the manifest that links a job's source information.

        

      
        - **fileSystemLocationName** *(string) --* 

          The file system location name.

          

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

          The file's root path.

          

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

          The format of the root path.

          

        
        - **outputRelativeDirectories** *(list) --* 

          The file path relative to the directory.

          

        
          - *(string) --* 

          
      
        - **inputManifestPath** *(string) --* 

          The file path.

          

        
        - **inputManifestHash** *(string) --* 

          The hash value of the file.

          

        
      
  
    - **fileSystem** *(string) --* 

      The file system location for the attachments.

      

    
  
  :type storageProfileId: string
  :param storageProfileId: 

    The storage profile ID for the storage profile to connect to the job.

    

  
  :type targetTaskRunStatus: string
  :param targetTaskRunStatus: 

    The initial job status when it is created. Jobs that are created with a ``SUSPENDED`` status will not run until manually requeued.

    

  
  :type maxFailedTasksCount: integer
  :param maxFailedTasksCount: 

    The number of task failures before the job stops running and is marked as ``FAILED``.

    

  
  :type maxRetriesPerTask: integer
  :param maxRetriesPerTask: 

    The maximum number of retries for each task.

    

  
  :type maxWorkerCount: integer
  :param maxWorkerCount: 

    The maximum number of worker hosts that can concurrently process a job. When the ``maxWorkerCount`` is reached, no more workers will be assigned to process the job, even if the fleets assigned to the job's queue has available workers.

     

    You can't set the ``maxWorkerCount`` to 0. If you set it to -1, there is no maximum number of workers.

     

    If you don't specify the ``maxWorkerCount``, Deadline Cloud won't throttle the number of workers used to process the job.

    

  
  :type sourceJobId: string
  :param sourceJobId: 

    The job ID for the source job.

    

  
  :type nameOverride: string
  :param nameOverride: 

    A custom name to override the job name derived from the job template.

    

  
  :type descriptionOverride: string
  :param descriptionOverride: 

    A custom description to override the job description derived from the job template.

    

  
  :type tags: dict
  :param tags: 

    The tags to add to your job. 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**

    
    ::

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

    

    - *(dict) --* 
      

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

        The job 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.ValidationException`

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

  