cancel
Showing results for 
Search instead for 
Did you mean: 

Pipeline monitoring api usage of org_wide

vincenr
New Contributor III

Please help me figure out what the syntax is for using the org_wide parameter for the pipeline monitoring api.

I’ve tried, but get an error for all of the below:

https://elastic.snaplogic.com/api/1/rest/public/runtime/” + _org + “?last_hours=” + _last_hours + “?org_wide=1”

https://elastic.snaplogic.com/api/1/rest/public/runtime/” + _org + “?last_hours=” + _last_hours + “?org_wide=0”

https://elastic.snaplogic.com/api/1/rest/public/runtime/” + _org + “?last_hours=” + _last_hours + “?org_wide=-1”

If I remove the org_wide, it works but only returns for root of org, understandably. When I look at the error it says it’s expecting an integer, but I’ve already tried: 0, 1, and -1 and none of them work.

Also, the documentation is no help. There’s no example of usage and ‘N/A’ makes no sense for a default value for the boolean.

image

12 REPLIES 12

@vincenr: The newer topic is this page.

vincenr
New Contributor III

Thanks for the new page reference. However, I don’t see the ‘level’ parm mentioned that Craig Stewart used. Is there a different API for that?

The API you are using will return you a list of runtimes, with summary data. If you take the RUUID from that make another request with the RUUID in the request too, you get the more detailed info.

vincenr
New Contributor III

Hi Craig,

Just wondering why you had to do all the ternary comparisons with state and hours to get the call to work? Is that analogous to SQL where if sometimes you don’t deal with nulls correctly you won’t get all the results or get incorrect results?

@vincenr - The ternary statements will optionally include the state, hours, last_hours, and limit query parameters to the API call. The values for these are coming from pipeline parameters so you can configure that at run time rather than have them hardcoded into the call.