Usecase:
Here, we will see how to invoke a scheduled integration now and then monitor or retrieve scheduled integration run status.
Rest API details:
Run a Scheduled Integration Now:
Method: POST
Path: /ic/api/integration/v1/integrations/{id}/schedule/jobs
Request json Payload:
Without schedule params
{
"action":"NOW"
}
with schedule params if any:
{
"action":"NOW",
"parameters" : [{
"name": "p_encryptFlag",
"value": "Y"
},{
"name": "p_essJobName",
"value": ""
}]
}
Retrieve scheduled integration run status:
Method: POST
Path: /ic/api/integration/v1/integrations/{id}/schedule/jobs/{job_id}
Response json payload:
{
"id" : "111",
"links" : [{
"href" : "https://test.oraclecloud.com:443/icsapis/v2/integrations/schedulejobs/111",
"rel":"self",
},{
href" : "https://test.oraclecloud.com:443/icsapis/v2/integrations/schedulejobs/111",
"rel": "self"
}],
"status": " SUCCEEDED"
}
High level steps:
- Create a dummy scheduled service with scheduled parameters.
- Create a Rest OIC connection with OIC host,user and password details.
- Create another integration and call the rest oic invoke connection and configure with a location standard http header.
- Assign the job request id to a variable.
- Take a while loop construct and repeat until it gets the status
- Configure rest retrieve endpoint and get the status
- Update the status.
Detailed screenshots:
Step 1 : Create a dummy Scheduled integration with some scheduled parameters.
Step 2 : create another integration from where we will configure rest OIC invoke to call that created dummy scheduled service.
In the standard http header response, we have to add location header field so that we can fetch job request id of the invoked dummy scheduled service.
Step3: Monitor or retrieve the called scheduled service job status.
To convert job status to boolean true or false values:
https://soalicious.blogspot.com/2021/03/oic-js-return-boolean-status-based-on.html
Oracle Reference: