Jobs API
Last updated on:
The API allows you fetch/delete the status of all the running and completed background search/alerts task running in EventLog Analyzer.
A) Get jobs status:
Request URL
GET http://localhost:8095/RestAPI/v1/jobs
Request Header
| Header name | Value | Mandatory | Description |
|---|---|---|---|
| Authorization | Bearer {{AuthToken}} | Yes |
Request Parameters
| Parameter name | Mandatory | Type | Description |
|---|---|---|---|
| request_id | No | String | If provided only this request_id's status will be fetched |
Response
The response will be a JSON object which will contain the following key/value pairs
| Parameter name | Description |
|---|---|
| total | cursor for the next set of results |
| requests | JSON array contains information about each job as a JSONObject.
Each JSONObject contains following fields
|
B) Delete jobs:
This allows you to delete the job and its hits
DELETE http://localhost:8095/RestAPI/v1/jobs
Request Header
| Header name | Value | Mandatory | Description |
|---|---|---|---|
| Authorization | Bearer {{AuthToken}} | Yes |
Request Parameters
| Parameter name | Mandatory | Type | Description |
|---|---|---|---|
| request_id | No | String | If provided only this request_id's status will be fetched |
Response
The response will be a JSON object which will contain a message field
| Parameter name | Description |
|---|---|
| message | result of the delete request |
Example usage using cURL
i) Delete status info & hits for particular request_id
Sample request
Copy to Clipboard
curl --location --request DELETE 'http://localhost:8095/RestAPI/v1/jobs?request_id=AYVTeCb0wPH5eWuO5jkC' \ -H "Accept: application/json" -H "Authorization: Bearer mdrkoda0odmtmznloc00ndziltg0mgutmwzkztljmjvmzwmx "
Sample response:
Copy to Clipboard
{ "message": "deleted hits for for request_id [AX6qJeaDhJby8kAkaqDE]" }
Example usage using Postman (Third party tool)
i). Get status for all jobs
ii) Get status for particular request_id
iii) Delete hits for particular request_id