B Appendix- II

Public APIs for Scheduler Operations

The following APIs are exposed for the Scheduler Operations.

Note:

  1. All the below APIs are POST requests.
  2. All the APIs accept below values in request header:
    • ofs_tenant_id - Optional
    • ofs_service_id - Optional
    • ofs_workspace_id - Respective workspace id where the batch needs to be created
    • ofs_remote_user – MMG login user The ofs_workspace_id and ofs_remote_user are mandatory fields.

Base URL: http(s)://<MMG_Service_HostName>:<MMG-Service_Port>/<CONETXTNAME>/

Table B-1 APIs for Scheduler Operations

Functionality API Sample Request JSON Sample Response JSON Comments
Execute Immediate rest-api/v1/external/trigger

{

"batchName": "batch1",

"batchType": "rest",

"includedTasks":"task1,task2",

"excludedTasks":"task1,task2",

"heldTasks":"task1,task2"

}

{

"severity": "info",

"summary": "Object triggered successfully with Run Id:

batch1_2022-08-17_1660721567845_1",

"batchRunId": "batch1_2022-08-17_1660721567845_1",

"details": "Object triggered successfully.",

"status": "success",

"statusCode": "0"

}

  • The includedTasks/ excludedTasks/ heldTasks are options keys.
  • The batchType will be “group” for batch group execution.
Execution Status rest-api/v1/external/status

{

"batchRunId": "batch1_2022-08-17_1660721567845_1",

"tasks":["task1","task2"]

}

{

"severity": "info",

"batchRunId": "batch1_2022-08-17_1660721567845_1",

"taskStatusList": [

{

"taskCode": "task1",

"taskStatus": "SUCCESSFUL",

"statusCode": "0"

},

{

"taskCode": "task2",

"taskStatus": "EXCLUDED",

"statusCode": "4"

}

],

"batchStatusCode": "0",

"batchList": [],

"batchStatus": "SUCCESSFUL",

"status": "success",

"statusCode": "0"

}

  • “tasks” is options key.

If not passed, then response will contain status all the tasks inside a batch.

Rerun rest-api/v1/external/rerun

{

"batchName": "batchgroup1",

"batchRunId": "batchgroup1_2022-08-17_1660720814942_1"

}

{

"severity": "info",

"summary": "Object triggered successfully for rerun with Run Id:

batchgroup1_2022-08-17_1660730049819_1",

"batchRunId": "batchgroup1_2022-08-17_1660730049819_1",

"details": "Object triggered successfully.",

"status": "success",

"statusCode": "0"

}

Restart rest-api/v1/external/restart

{

"batchName": "MMG_R1",

"batchRunId": "MMG_R1_2022-07-15_1657867378160_1"

}

{

"severity": "info",

"summary": "Object triggered successfully for restart with Run Id:

MMG_R1_2022-07-15_1657867378160_1",

"batchRunId": "MMG_R1_2022-07-15_1657867378160_1",

"details": "Object triggered successfully.",

"status": "success",

"statusCode": "0"

}

Interrupt rest-api/v1/external/interrupt

{

"batchName": "B2001",

"batchRunId": "B2001_2022-05-22_1653222717896_1"

}

{

"summary": "Execution interrupted successfully for Run Id:

B2001_2022-05-30_1653233511394_1",

"severity": "info",

"batchRunId": "B2001_2022-05-30_1653233511394_1",

"details": "Execution interrupted successfully.",

"statusCode": "0",

"status": "success"

}

Table B-2 Failed Response Body

Failed Sample Response JSON Description
Batch Status Failed

{

"severity": "info",

"batchRunId": "BT-BI-EXCHG_RATES_EOD_2022-05-27_1653662703599_1",

"batchStatusCode": "-1",

"batchList": [],

"batchStatus": "FAILED",

"statusCode": "0",

"status": "success"

}

Object Not found

{

"severity": "error",

"summary": "Object does not exist.",

"details": "Object does not exist.",

"error": {

"errorCode": "OBJECT_NOT_EXIST",

"errorMsg": "Object does not exist."

},

"statusCode": "-3",

"status": "failed"

}

Table B-3 Status Codes in the Response Body

Status Code Description
0 Success
1 Not Started
2 Ongoing
4 Excluded
5 Held
-1 Failure
-2 Interrupted
-3 Object does not exist
-4 Invalid arguments passed in request/not enough parameters in the Request body
-5 Invalid request headers/request headers missing
-6 No executable job is present
-7 Job is already interrupted