Start a Conversation

Unsolved

KL

1 Message

263

February 2nd, 2023 12:00

Filter on multiple attributes

Looking to pull a list of failed jobs within the last 24 hours via an API. 

/v3/global/jobs?q=startTime:[24%20hours] - This end point works great to pull jobs started within 24 hours. What is the syntax to also include AND completionStatus:Failed? 

I can do them separately, but not together. 

 

Thanks. 

February 5th, 2023 05:00

did you have a look at the NW api setup on https://developer.dell.com (or NW specifically https://developer.dell.com/apis/2378/versions/v3/docs/GettingStarted.md)? Might wanna use Chrome as FF doesn't seem to be rendering the site OK enough (missing scroll bar on left hand side).

https://developer.dell.com/apis/2378/versions/v3/docs/examples/Example-9JobMonitoring.md

"If you want to search the job database for a specific set of jobs, for example, all the failed jobs in the last 2 hours, you can build an API query like the following:"

GET /nwrestapi/v3/global/jobs?q=completionStatus:Failed AND startTime:['2020-03-25T10:00:00' TO '2020-03-25T12:00:00']&fl=id,command,exitCode

API response:

{
   "count":2,
   "jobs":[
      {
         "command":"/usr/sbin/nsrworkflow -s blrv09a230 -p Bronze_Critical -w Workflow1 -L -f",
         "exitCode":1
      },
      {
         "command":"/usr/sbin/nsrworkflow -s blrv09a230 -p SAP_HANA -w Workflow1 -L -f",
         "exitCode":1
      }
   ]
}

 
Or doesn't that work combined with the last 24h query?

No Events found!

Top