History Search REST Service

Follow

What is History Service?

History Service, also known as History REST API, will allow users to query the database for history entries by sending an odata filter.

 

History Service is different than other REST services available in JAMS, as criteria filters must be entered to retrieve the correct results.

For example:

  • Search criteria can be added, such as a complex name, on top of the first filter as well as serving the root and sub-folders.
  • The criteria can also filter restarts using operators, such as greater than and less than.

 

History Service Filter Examples

 

URL REST Filters

Filter Description
searchRecursively
  • True/False Value.
  • If True, then service will recursively search within child folders.
folderName
  • The folder to search for the history items.
  • '\" will be the root folder.
  • To search all existing folders, set the folderName to "\" (root folder) and set searchRecursively to True.
jobName
  • The specific job name used in search.

 

 

oData Time Filters

Filter Description
CompletionTimeUTC
  • Job completion time in universal time.
HoldTimeUTC
  • Job hold time in universal time.
ScheduleTimeUTC
  • Job schedule time in universal time.
StartTimeUTC
  • Job start time.

 

 

oData Final Severity Filters

  • Error
  • Fatal
  • Info
  • Success
  • Warning

 

 

oData Field Filters

  • JobName
  • SubmittedBy
  • RestartCount
  • JAMSEntry
  • RON
  • ParentFolderName
  • Note
  • JobStatus
  • FinalStatus
  • JobID

 

 

Operations Filters

Filter Description
eq
  • Equals
gt
  • Greater Than
ge
  • Greater or Equals
lt
  • Less Than
le
  • Less or Equal
contains({Field Name},{Value})
  • Search contains criteria identified within curly brackets.

 

Return to Top

 


 

Filters and Resulting URL Examples

This section includes a sample of the URL, detailed information on the filters used, and an escaped version of the same sample URL.

 

URL Example

http://localhost:62405/api/history/odata?$filter=(CompletionTimeUTC ge 2019-01-07T00:00:00-05:00 and CompletionTimeUTC le 2019-01-07T23:59:59-05:00 or HoldTimeUTC ge 2019-01-07T00:00:00-05:00 and HoldTimeUTC le 2019-01-07T23:59:59-05:00 or ScheduledTimeUTC ge 2019-01-07T00:00:00-05:00 and ScheduledTimeUTC le 2019-01-07T23:59:59-05:00 or StartTimeUTC ge 2019-01-07T00:00:00-05:00 and StartTimeUTC le 2019-01-07T23:59:59-05:00) and (FinalSeverity eq 'Error' or FinalSeverity eq 'Fatal' or FinalSeverity eq 'Info' or FinalSeverity eq 'Success' or FinalSeverity eq 'Warning') and (contains(SubmittedBy,'Sally') and JAMSEntry gt 5)&searchRecursively=true&folderName=\&jobName=*

 

URL REST Filters

  • searchRecursively is true, therefore it will search recursively in child folders of the chosen folder.
  • folderName is '\' which is the root folder.
  • jobName is '*' which means search for all jobs, not a specific job name.

 

oData Time Filters

  • CompletionTimeUTC is greater or equal to 2019-01-07T00:00:00-05:00 AND CompletionTimeUTC is less or equal to 2019-01-07T23:59:59-05:00 which means search for today's date.
  • HoldTimeUTC,ScheduledTimeUTC,StartTimeUTC same as above.
  • * Severity will search for all severity levels.
  • SubmittedBy 'Sally' filter applied.
  • JAMSEntry greater than 5 applied.

 

Escaped Version of the Above URL Example

http://localhost:62405/api/history/odata?$filter=(CompletionTimeUTC%20ge%202019-01-07T00%3A00%3A00-05%3A00%20and%20CompletionTimeUTC%20le%202019-01-07T23%3A59%3A59-05%3A00%20or%20HoldTimeUTC%20ge%202019-01-07T00%3A00%3A00-05%3A00%20and%20HoldTimeUTC%20le%202019-01-07T23%3A59%3A59-05%3A00%20or%20ScheduledTimeUTC%20ge%202019-01-07T00%3A00%3A00-05%3A00%20and%20ScheduledTimeUTC%20le%202019-01-07T23%3A59%3A59-05%3A00%20or%20StartTimeUTC%20ge%202019-01-07T00%3A00%3A00-05%3A00%20and%20StartTimeUTC%20le%202019-01-07T23%3A59%3A59-05%3A00)%20and%20(FinalSeverity%20eq%20%27Error%27%20or%20FinalSeverity%20eq%20%27Fatal%27%20or%20FinalSeverity%20eq%20%27Info%27%20or%20FinalSeverity%20eq%20%27Success%27%20or%20FinalSeverity%20eq%20%27Warning%27)%20and%20(contains(SubmittedBy,%27Sally%27)%20and%20JAMSEntry%20gt%205)&searchRecursively=true&folderName=\&jobName=*

 

Return to Top


 

For More Information

Have more questions? Submit a request

Comments