Creating Jobs
Last updated
Last updated
Jobs can only have a single source. Jobs with more than one source will not sync content and run forever. Transactions started with this job configuration should be canceled. We intend to add support for multiple jobs in the future.
To save a job, you will need all the endpoint IDs you want to use in the job. If you do not have all the endpoint IDs already saved you can use the to view all endpoints and find the endpoint you want to use.
From this response, you can identify the endpoints by their name
, which is unique. In addition you can view the contentRepo
to determine what connector the endpoint is associated with.
The connectorId
returned in the response can be used to find the job options for the connector.
To save a job you will need to use the .
To save a job the payload will require a few attributes:
name
The name of the job.
Must be unique
endpoints
The list of endpoints to be used by the job. This is an array of endpoint objects
Jobs can also have the following attributes:
type
Type of job.
We currently only support "manual" value
active
Determines if the job is active or not.
description
A description of the job
Each endpoint object requires the following attributes:
endpoint.id
The ID of the endpoint to be used
type
The type of the endpoint.
Either "source" or "destination"
detail
The job options for the endpoint
Comma separated string of job options following key:value notation.
For this example we will save a job with a source dotCMS endpoint and a destination dotCMS endpoint.
The response returned after the job is saved will contain the job ID. You will need to make note of this ID and use it in later API to start a transaction.
Using the connectorId
from the endpoint response you can make a call like the following.
From this response you can view the jobOptions
array. Based on if the endpoint is a source or destination, the available job options are listed with the connectorType
"Read" or "Write" respectively.
In this response you can see the various keys available for job options as well as the data type. For example, the source connector has the job option contentType
which is a data type "Array". While the destination connector has the job option location.path
which is a data type "Text".
This response can be used to find the keys of the job options to set and in the details for the endpoint in the job.
A job option can have the following data types.
Text
String value.
key:myvalue
Integer
Whole number value
key:4
Decimal
Decimal number value
key:4.2
Boolean
Boolean value
key:true
Array
Multiple string key:values
key:myvalue,key:myothervalue
To get the possible job options for a connector to set in the job payload endpoints.detail, you can view the for the chosen connector to view details about the job options. As well as use the to know the key value to use.