06-23-2022 10:27 AM
I am new to snaplogic so please bear with me!
I am trying to build a pipeline to extract the pipeline execution history for specified time range using GET REST snap. I could see below Query in the documentation:
GET https://elastic.snaplogic.com/api/1/rest/public/runtime/orgname?start=&end=>
has anyone used this api? how can I pass the value of start and end dates?
I don’t want to hard code these dates as i want to make my pipeline more dynamic. I want to pass start date as first day of the previous month and end date as the last date of the previous month.
I got above error while I try to create a snap. it says error on the index 87 which is “>” in the api query. So, I removed “>” and only used
https://elastic.snaplogic.com/api/1/rest/public/runtime/orgname?start=&end=
but still got below error:
Failure: REST API service endpoint returned error result: status code = 404, Reason: REST API service endpoint returned error result: status code = 404, reason phrase = NOT FOUND, refer to the error_entity field in the error view document for more details, Resolution: Please check the values of Snap properties.
Any help will be appreciated!
06-23-2022 10:48 AM
Welcome to the community.
The start
and end
parameters can be passed in via the query string. The snap can take care of that for you. You’ll have to make a couple changes.
You’ll need to modify the Service URL to include everything up to the question mark, eg. https://elastic.snaplogic.com/api/1/rest/public/runtime/abc123
Modify the Query parameters to so that the left column, which is the query parameter key, looks like start
and the left could look like _START
.
Then you’ll need to modify the Pipeline so that it has a Pipeline Parameter called START
.
Do steps 2 and 3 again for the end
query string parameter.
To make your pipeline dynamic, you could look at this documentation for more information.
06-27-2022 02:51 PM
Thank you @tlikarish
I made the changes as you suggested but I am still getting error:
here is the pipeline property i have :
Error I am getting:
Failure: REST API service endpoint returned error result: status code = 400, Reason: REST API service endpoint returned error result: status code = 400, reason phrase = BAD REQUEST, refer to the error_entity field in the error view document for more details, Resolution: Please check the values of Snap properties.
Not sure what I am missing. 🙁
03-23-2023 01:32 PM
Hi RavNeu,
Did you ever figure out why you received the error?
Failure: REST API service endpoint returned error result: status code = 400, Reason: REST API service endpoint returned error result: status code = 400, reason phrase = BAD REQUEST, refer to the error_entity field in the error view document for more details, Resolution: Please check the values of Snap properties.
03-29-2023 05:19 AM
Hi All,
Just to share my experience: to retrieve runtime statuses, I use the following endpoint: https://elastic.snaplogic.com/api/1/rest/public/runtime/%1$s?last_hours=%2$s&limit=%3$s&offset=%4$s
, that I call .sprintf()
on it with following variables:
%1$s
is replaced by my Org%2$s
is replaced by a number of hours from now in the past%3$s
and %4$s
are used by paginationThis is associated with my personal account, stored as REST Basic Auth account.
Hope this helps!