Job Management API


Job Management API


Job Management

The REST API supported the following Job management actions:

List all Jobs

Returns a list of all Jobs within the Sync application.

GET http://mydomain.com:8001/api.rsc/jobs(jobname)

Query Parameters

Name Description
JobName Name of the Job to retrieve.

Create a Job

Create a new Job to run in the Sync application.

POST http://mydomain.com:8001/api.rsc/jobs

Body Parameters

Name Description
JobName The name of the job.
Source The name of the Source Connection.
Destination The name of the Destination connection.
Scheduled Set this to true to the job can be executed according to a specific scheduler.
ScheduledCron The scheduler cron string.
NotifyWindowsEvent Set this to true to write error messages to the Windows Application Event Log.
SendEmailNotification Set this to true to send email notifications after jobs are completed.
NotifyEmailTo The email address where notifications will be sent to.
NotifyEmailSubject The email subject for notifications.
EmailErrorOnly Only send an email on error.
Verbosity The log verbosity level of the job.
TableNamePrefix A prefix for all tables being replicated.
UseGmtDateTime Set this to true to synchronize times in the GMT time zone as opposed to local time.
TruncateTableData Set this to true to delete all rows before each update.
DropTable Set this to true to drop the table before each update.
AutoTruncateStrings Set this to true to automatically truncate strings that are too large for the column size.
ContinueOnError Set this to true to continue onto the next table when previous table throws error.
AlterSchema Set this to true to add columns and alter data types if there is a mismatch between the source table metadata and the destination table metadata.
ReplicateInterval Paired with ReplicateIntervalUnit, ReplicateInterval controls the time frames to split the data into when replicating.
ReplicateIntervalUnit Paired with ReplicateInterval, ReplicateIntervalUnit controls the time frames to split the data into when replicating. Values are minutes, hours, days, weeks, months, years.
ReplicateStartDate This option sets the minimum date to start replicating data from (yyyy-MM-dd).
BatchSize Sets the size of batch.
CommandTimeout Controls the timeout for destination connections.
SkipDeleted Whether or not skip retrieving deleted records from source.
OtherCacheOptions A comma separated list of additional options to include.
CacheSchema Assign a specific schema for the destination database.
PreJob The code of Pre-Job event.
PostJob The code of Post-Job event.
Query# An array of SQL statements to include in the Job.
{ 
  "JobName": "MyNewJob", 
  "Source": "SourceConnection",
  "Destination": "DestinationConnection",
  "Query#1":"REPLICATE [Accounts]",
  "Query#2": "REPLICATE [Invoices]"
}

Modify a Job

Modifies an Existing Job. You are unable to modify a Job that is currently running.

PUT http://mydomain.com:8001/api.rsc/jobs(jobname)

Query Parameters

Name Description
JobName (required) The name of the job to modify.

Body Parameters

Name Description
Source The name of the Source Connection.
Destination The name of the Destination connection.
Scheduled Set this to true to the job can be executed according to a specific scheduler.
ScheduledCron The scheduler cron string.
NotifyWindowsEvent Set this to true to write error messages to the Windows Application Event Log.
SendEmailNotification Set this to true to send email notifications after jobs are completed.
NotifyEmailTo The email address where notifications will be sent to.
NotifyEmailSubject The email subject for notifications.
EmailErrorOnly Only send an email on error.
Verbosity The log verbosity level of the job. Values are 1,2,3,5.
TableNamePrefix A prefix for all tables being replicated.
UseGmtDateTime Set this to true to synchronize times in the GMT time zone as opposed to local time.
TruncateTableData Set this to true to delete all rows before each update.
DropTable Set this to true to drop the table before each update.
AutoTruncateStrings Set this to true to automatically truncate strings that are too large for the column size.
ContinueOnError Set this to true to continue onto the next table when previous table throws error.
AlterSchema Set this to true to add columns and alter data types if there is a mismatch between the source table metadata and the destination table metadata.
ReplicateInterval Paired with ReplicateIntervalUnit, ReplicateInterval controls the time frames to split the data into when replicating.
ReplicateIntervalUnit Paired with ReplicateInterval, ReplicateIntervalUnit controls the time frames to split the data into when replicating. Values are minutes, hours, days, weeks, months, years.
ReplicateStartDate This option sets the minimum date to start replicating data from (yyyy-MM-dd).
BatchSize Sets the size of batch.
CommandTimeout Controls the timeout for destination connections.
SkipDeleted Whether or not skip retrieving deleted records from source.
OtherCacheOptions A comma separated list of additional options to include.
CacheSchema Assign a specific schema for the destination database.
PreJob The code of Pre-Job event.
PostJob The code of Post-Job event.
Query# An array of SQL statements to include in the Job.
{ 
  "Scheduled": "true",
  "ScheduledCron": "0-30/5 * * * *"
}

Delete a Job

Remove a Job from the Sync application. You are unable to delete a Job that is currently running.

DELETE http://mydomain.com:8001/api.rsc/jobs(jobname)

Query Parameters

Name Description
JobName Name of the Job to Delete.

Execute a Job

Start running the specified Job.

POST http://mydomain.com:8001/api.rsc/executeJob

Body Parameters

Name Description
JobName (required) The name of the job to execute.
{
  "JobName": "MyJob"
}

Execute Queries in Job

Start running specific queries within a Job. The Queries must already be part of the Job.

POST http://mydomain.com:8001/api.rsc/executeQuery

Body Parameters

Name Description
JobName (required) The name of the job to execute.
Query# (required) An array of Query statements to execute. Specify multiple queries with the syntax Query#1, Query#2, etc.
{
  "JobName": "MyJob",
  "Query#1": "REPLICATE [Accounts]",
  "Query#2": "REPLICATE [Contacts]"
}

Cancel a Job

Cancel a currently running Job. The Job must already be running.

POST http://mydomain.com:8001/api.rsc/cancelJob

Body Parameters

Name Description
JobName (required) The name of the job to cancel.
{
  "JobName": "MyJob"
}

Retrieve Job Status

Retrieves the status of a Job.

POST http://mydomain.com:8001/api.rsc/getJobStatus

Body Parameters

Name Description
JobName Name of the Job to retrieve the status for. If specified, the response will contain details for each query within a Job.
{
  "JobName":"MyJob"
}

Retrieve History of Job

Retrieve the history of the previous runs for a Job.

GET http://mydomain.com:8001/api.rsc/history

Query Parameters

Name Description
JobName Name of the Job to retrieve the history of.

Download Logs of Job

Download the Base64 encoded contents of the logs file(s) for a job.

POST http://mydomain.com:8001/api.rsc/getLogs

Body Parameters

Name Description
JobName (required) Name of the Job to retrieve logs from.
Days (required) Number of Days worth of Log files to include.