Skip to content

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

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 orchSerfor 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 as application/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 orchSerfor 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 If any operations failed to execute, the parameter contains a short notation of the error that occurred. Otherwise, the value is null.
token Represents the CSRF token, if available

Sample Response

{
    "status": "SUCCESS",
    "result": null,
    "message": null,
    "token": null
}

Update a Job

The Update Jobs API is used to update server jobs.

URL

The HTTP URL for the Update Jobs API is as follows:

http://<<host>>:<<port>>/admin/api/jobs/job

Method

PUT

Header

The following are the request headers:

  • X-VoltMX-Authorization as <X-VoltMX-Authorization>

    Note: For more information on X-VoltMX-Authorization, refer Authorization.

  • Content -Type as application/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 orchSerfor 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 testjob 1",
    "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 If any operations failed to execute, the parameter contains a short notation of the error that occurred. Otherwise, the value is null.
token Represents the CSRF token, if available

Sample Response

{
    "status": "SUCCESS",
    "result": null,
    "message": null,
    "token": null
}

Delete a Job with Job ID

The Delete Job with Job ID API takes job ID as an input parameter and deletes the job.

URL

The HTTP URL for the Delete Job with Job ID API is as follows:

http://<<host>>:<<port>>/admin/api/jobs/job1

Method

DELETE

Header

The request header includes X-VoltMX-Authorization as <X-VoltMX-Authorization>.

Note: For more information on X-VoltMX-Authorization, refer Authorization.

Input Parameters

Input Parameter Type Description
jobId integer A unique job ID for which the details must be retrieved.

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 If any operations failed to execute, the parameter contains a short notation of the error that occurred. Otherwise, the value is null.
token Represents the CSRF token, if available

Sample Response

{
    "status": "SUCCESS",
    "result": null,
    "message": null,
    "token": null
}

Get Job History

The Get Job History API is used to get the history of a job.

URL

The HTTP URL for the Get Job History API is as follows:

http://<<host>>:<<port>>/admin/api/jobs/history/2

Method

GET

Header

The request header includes X-VoltMX-Authorization as <X-VoltMX-Authorization>.

Note: For more information on X-VoltMX-Authorization, refer Authorization.

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
jobRunId integer A unique ID of the job.
jobStartTime string Time at which the job execution process started.
jobEndTime string The time at which the job execution process ended.
jobDuration integer Job execution time.
executionFrequency string Frequency at which the job was running.
executionStatus string Status of the job run.
completeHistory boolean If the history strategy of the run is complete, this parameter is true. Otherwise, it is false.

Sample Response

[
    {
        "jobRunId": 2,
        "jobStartTime": "2018-12-24 10:35:41",
        "jobEndTime": "2018-12-24 10:35:41",
        "jobDuration": 0,
        "executionFrequency": "41 5 * * * ? *",
        "executionStatus": "Fail",
        "completeHistory": false
    },
    {
        "jobRunId": 1,
        "jobStartTime": "2018-12-24 09:35:41",
        "jobEndTime": "2018-12-24 09:35:43",
        "jobDuration": 2000,
        "executionFrequency": "41 5 * * * ? *",
        "executionStatus": "Fail",
        "completeHistory": false
    }
]

Run a Job Now

The Run Job Now API is used to run a job.

URL

The HTTP URL for the Run Job Now API is as follows:

http://<<host>>:<<port>>/admin/api/jobs/job/run/2

Method

POST

Header

The request header includes X-VoltMX-Authorization as <X-VoltMX-Authorization>.

Note: X-VoltMX-Authorization must be retrieved from the accounts login call.
For more information on X-VoltMX-Authorization, refer Authorization.

Input Parameters

Input Parameter Type Description
jobId integer A unique job ID for which the details must be retrieved.

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 If any operations failed to execute, the parameter contains a short notation of the error that occurred. Otherwise, the value is null.
token Represents the CSRF token, if available

Sample Response

{
    "status": "SUCCESS",
    "result": null,
    "message": null,
    "token": null
}

Accounts Login API

URL

The HTTP URL for the Accounts Login API is as follows:

http://<<host>>:<<port>>/authService/accounts/login

Method

POST

Header

The request header includes Content-Type as application/x-www-form-urlencoded.

Input Parameters

Input Parameter Description
userid User ID of the account.
password Password of the account.

Sample Response

{
    "profile": {
        "userid": "user.name@voltmx.com",
        "email": "user.id@voltmx.com",
        "firstname": "xxxxxx",
        "lastname": "xxxxxxx",
        "user_attributes": {
            "user_id": "user.name@voltmx.com"
        },
        "profile_attributes": {
            "firstname": "xxxxxx",
            "userid": "user.name@voltmx.com",
            "email": "user.id@voltmx.com",
            "lastname": "xxxxxxx"
        }
    },
    "claims_token": {
        "value": "xxxxx",
        "exp": 1540293966000,
        "integrity_check_required": false
    },
    "refresh_token": "xxxxx"
}