lhs-panel Click here to expand

Jobs API

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:8400/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

  • running_time_in_millis = Human-readable running time, type = long
  • hits_done = Total hits done
  • status = Status of job, values = SUCCESS or FAILED or RUNNING
  • submitted_at = Epoch time in unix milliseconds at which the job was submitted
  • started_at = Epoch time in unix milliseconds at which the job started
  • running_time = Job running time
  • last_synced_time = Last synced time in unix milliseconds when the status was flushed to database
  • total_pages = Total number of pages in this search result
  • request_id = Request ID of the job

B) Delete jobs:

This allows you to delete the job and its hits

DELETE http://localhost:8400/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:8400/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

Jobs API

ii) Get status for particular request_id

Jobs API

iii) Delete hits for particular request_id

Jobs API

Copyright © 2020, ZOHO Corp. All Rights Reserved.

Get download link