Volt MX Foundry console User Guide: Jobs > Scheduling Job APIs
Scheduling Job APIs
Scheduling Job APIs enable you to configure Admin Console jobs for Integration, Object, and Orchestration services from V8 SP4 onwards. You can configure the jobs by invoking APIs from either Postman, Curl, or any Rest Client.
Scheduling Job APIs help to schedule activities like the following:
- Caching data at a specific time to sync data across the devices.
- Performing a health check on the service.
Get All Jobs
The Get All Jobs API is used to get all the jobs.
URL
The HTTP URL for the Get All Jobs API is as follows:
http://<<host>>:<<port>>/admin/api/jobs/job
Method
GET
Header
The request header includes X-VoltMX-Authorization
as <X-VoltMX-Authorization>
.
Note: For more information on X-VoltMX-Authorization, refer Authentication.
Output Parameters
Output Parameter | Type | Description |
---|---|---|
jobId | integer | A unique ID generated by the system. It cannot be null for all the jobs. |
jobName | string | Name of the configured job. |
description | string | Description provided while creating a job. |
cronExpression | string | Expression used while configuring the job. For more information on CRON expression, refer https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.html https://www.freeformatter.com/cron-expression-generator-quartz.md |
updatedUser | string | Email that is used to update the job. |
updatedDate | string | Date on which the job is updated. |
jobStatus | string | Current status of the job. It can either be Active or Inactive . |
jobHistoryTotal | integer | Number of records in the Job History tab. |
jobHistorySuccessCount | integer | Number of successful runs. |
jobHistoryFailCount | integer | Number of runs that failed. |
jobHistorySucPercentage | integer | Percentage of runs that were successful. |
jobHistoryFailPercentage | integer | Percentage of runs that failed. |
jobLastRunStatus | string | Status of the last run of the configured job. |
jobNextRunTime | string | Occurrence of the job. |
Sample Response
[
{
"jobId": 1,
"jobName": "job1",
"description": null,
"cronExpression": null,
"updatedUser": "xxxxx",
"updatedDate": "2018-12-24 09:04:55",
"jobStatus": "Active",
"jobHistoryTotal": 0,
"jobHistorySuccessCount": 0,
"jobHistoryFailCount": 0,
"jobHistorySucPercentage": 0,
"jobHistoryFailPercentage": 0,
"jobLastRunStatus": null,
"jobNextRunTime": "2018-12-24 09:35:41"
}
]
Get All Job Details with Job ID
The Get All Jobs Details with Job ID API accepts Job ID as an input parameter and returns the job details.
URL
The HTTP URL for the Get All Jobs with Job ID API is as follows:
http://<<host>>:<<port>>/admin/api/jobs/job1
Method
GET
Header
The request header includes X-VoltMX-Authorization
as <X-VoltMX-Authorization>
.
Note: For more information on X-VoltMX-Authorization, refer Authentication.
Input Parameters
Input Parameter | Type | Description |
---|---|---|
jobId | integer | A unique job ID for which the details must be retrieved. |
Output Parameters
Output Parameter | Type | Description |
---|---|---|
jobId | integer | A unique ID generated by the system. It cannot be null for all the jobs. |
jobName | string | Name of the configured job. |
jobFrequency | string | Frequency at which the job is running. |
jobServiceInfo | JSON | Contains the service information configured for the job. |
version | string | Version of the service that is configured for the job . |
serviceType | string | Service type of the configured job. It includes the following: intSer for Integration Service objSer for Object Service orchSer for Orchestration Service |
serviceName | string | Name of the service for which the job will run. |
objectName | string | Name of the Object service for which the job is running. > Note: The Objects field is displayed only when you select the service type as Object Services. |
operationName | string | Name of the operation for which the job is running, |
requestheaderMap | JSON | Headers map that is required to execute the job, |
serviceExecutionType | string | The owner who runs the job as Admin for the job execution, the Value must be SERVER_URL . This parameter is mandatory while creating a job. |
postData | JSON | Job parameters that are required to run the service, |
operationSecurityLevel | string | Security level that is configured to execute the underlying service, |
jobStatus | string | Current status of the job. It can either be Active or Inactive . |
historyStrategy | string | History strategy that is configured for the job. The possible values for this parameter are as follows: OFF: History is not recorded or displayed . MINIMAL: History related to audits is recorded and displayed. ERROR: History of failed runs is recorded and displayed. FULL: History for all runs (including the payload and response) is recorded and displayed. |
retentionPeriod | string | Length of time for which the job should retain its history, |
jobFrequencyInfo | JSON | Frequency at which the job must run, |
frequencyType | integer | Type of frequency that was configured. The following are the possible values: 1: Hour-based Frequency 2: Day-based Frequency 3: Week-based Frequency 4: Month-based Frequency |
Sample Response
{
"jobId": 1,
"jobName": "job1",
"jobFrequency": "41 5 * * * ? *",
"jobServiceInfo": {
"version": "1.0",
"serviceType": "intSer",
"serviceName": "openweather",
"objectName": "",
"operationName": "getWeather",
"requestheaderMap": {},
"serviceExecutionType": "SERVER_URL",
"postData": "{\"cityName\":\"\"}",
"operationSecurityLevel": "public"
},
"jobStatus": "Active",
"historyStrategy": "MINIMAL",
"retentionPeriod": "30",
"jobFrequencyInfo": {
"frequencyType": 1,
"minuteValues": [
5
]
}
}
Create a Job
The Create Job API is used to create a server job.
URL
The HTTP URL for the Create Job API is as follows:
http://<<host>>:<<port>>/admin/api/jobs/job
Method
POST
Header
The following are the request headers :
-
X-VoltMX-Authorization
as<X-VoltMX-Authorization>
Note: For more information on X-VoltMX-Authorization, refer Authentication.
-
Content -Type
asapplication/json
Input Parameters
Input Parameter | Type | Description |
---|---|---|
jobId | integer | A unique ID generated by the system. It cannot be null for all any job. |
jobName | string | Name of the configured job. |
jobFrequency | string | Frequency at which the job is running. |
jobServiceInfo | JSON | Contains the service information configured for the job. |
version | string | Version of the service that is configured for the job . |
serviceType | string | Service type of the configured job. It includes the following: intSer for Integration Service objSer for Object Service orchSer for Orchestration Service |
serviceName | string | Name of the service for which the job will run. |
objectName | string | Name of the Object service for which the job is running. > Note: The Objects field is displayed only when you select the service type as Object Services. |
operationName | string | Name of the operation for which the job is running, |
requestheaderMap | JSON | Headers map that is required to execute the job, |
serviceExecutionType | string | The owner who runs the job as Admin for the job execution, the Value must be SERVER_URL . This parameter is mandatory while creating a job. |
postData | JSON | Job parameters that are required to run the service, |
operationSecurityLevel | string | Security level that is configured to execute the underlying service, |
jobStatus | string | Current status of the job. It can either be Active or Inactive . |
historyStrategy | string | History strategy that is configured for the job. The possible values for this parameter are as follows: OFF: History is not recorded or displayed . MINIMAL: History related to audits is recorded and displayed. ERROR: History of failed runs is recorded and displayed. FULL: History for all runs (including the payload and response) is recorded and displayed. |
retentionPeriod | string | Length of time for which the job should retain its history, |
jobFrequencyInfo | JSON | Frequency at which the job must run, |
frequencyType | integer | Type of frequency that was configured. The following are the possible values: 1: Hour-based Frequency 2: Day-based Frequency 3: Week-based Frequency 4: Month-based Frequency |
Sample Request
{
"jobId": 2,
"jobName": "testjob1",
"jobFrequency": "19 0 * * * ? *",
"description": "Job for testjob2",
"jobServiceInfo": {
"version": "1.0",
"serviceType": "intSer",
"serviceName": "jsonservices",
"objectName": "",
"operationName": "metadatajson",
"requestheaderMap": {},
"serviceExecutionType": "SERVER_URL",
"postData": "{}",
"operationSecurityLevel": "public"
},
"jobStatus": "Active",
"historyStrategy": "OFF",
"retentionPeriod": "30",
"jobFrequencyInfo": {
"frequencyType": 1,
"minuteValues": [
0
],
"hourValues": [
1
]
}
}
Output Parameters
Output Parameter | Description |
---|---|
status | Represents the status of the operation. It can either be SUCCESS or FAIL |
result | If any operations failed to execute, the parameter contains the full results. Otherwise, the value is null. |
message |