โ08-29-2022 09:43 AM
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.
โ08-30-2022 08:48 AM
โ08-30-2022 09:01 AM
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?
โ08-30-2022 09:41 AM
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.
โ08-30-2022 10:19 AM
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?
โ08-31-2022 05:19 AM
@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.