This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

How are get trends list and them data via HTTP request?
#1
Question 
Hi,

I developing some web-service and it need get trends  list from LM via HTTP request.
How can I get trends list and them data as json object via HTTP request using POST or GET?
Reply
#2
Only via admin interface: http://LM_IP/scada-main/trends/main
Reply
#3
(16.03.2017, 13:40)admin Wrote: Only via admin interface: http://LM_IP/scada-main/trends/main

Yes! I use it URL, but I can't get list of trends as json objects.  I get only values of each trends separately(.
Reply
#4
To get trend data, you have to call fetch instead of main.
Reply
#5
(16.03.2017, 14:23)admin Wrote: To get trend data, you have to call fetch instead of main.

If I request fetch I get error message: 

Code:
Error: /lib/genohm-scada/web/trends/fetch.lua:0: attempt to index a nil value

Which are parameters need to add to POST or GET request for the url ("http://LM-IP/scada-main/trends/fetch") if I need get list of trends?

I add followoing parameters to POST request for get values of trend 


Code:
data:"{"dates_curr":{"start":{"year":2017,"day":1,"month":3},"end":{"year":2017,"day":17,"month":3}},"id":14,"dates_prev":{"start":{"year":2017,"day":16,"month":3},"end":{"year":2017,"day":17,"month":3}}}"
where "id" - the id of some trend

But I don't know which parameters using for get list of all trends in a system.
Reply
#6
To get a list of trends you need to send GET request to http://LM_IP/scada-main/trends/main
Reply
#7
(16.03.2017, 16:41)admin Wrote: To get a list of trends you need to send GET request to http://LM_IP/scada-main/trends/main

Great! It is what I wanted!
Thank you very much!!!
Reply


Forum Jump: