Difference between revisions of "API Overview"
From Observer GigaFlow Support | VIAVI Solutions Inc.
Line 4: | Line 4: | ||
http://xxx.xx.xx.xxx:7902/rest/?jsonRequest={"reportName":"Applications","type":"Table"}&portalUser=admin@myipsla.com | http://xxx.xx.xx.xxx:7902/rest/?jsonRequest={"reportName":"Applications","type":"Table"}&portalUser=admin@myipsla.com | ||
− | Sending data to scripts | + | Sending data to scripts: |
+ | |||
curl -H "Content-Type: application/json" -X POST -d '{"type":"processscript","scriptid":-5,"data":{"test":false}}' "http://xxx.xx.xx.xxx:7902/rest/api/?userName=admin&userPass=admin" | curl -H "Content-Type: application/json" -X POST -d '{"type":"processscript","scriptid":-5,"data":{"test":false}}' "http://xxx.xx.xx.xxx:7902/rest/api/?userName=admin&userPass=admin" | ||
curl -H "Content-Type: application/json" -X POST -d '{"type":"processscript","scriptname":"data script 1","data":{"test":false}}' "http://xxx.xx.xx.xxx:7902/rest/api/?userName=admin&userPass=admin" | curl -H "Content-Type: application/json" -X POST -d '{"type":"processscript","scriptname":"data script 1","data":{"test":false}}' "http://xxx.xx.xx.xxx:7902/rest/api/?userName=admin&userPass=admin" | ||
+ | |||
+ | [More about cUrl https://en.wikipedia.org/wiki/CURL] | ||
Event Script to process incoming data: | Event Script to process incoming data: |
Revision as of 14:13, 24 April 2019
Browser rest access:
http://xxx.xx.xx.xxx:7902/rest/?jsonRequest={"reportName":"Applications","type":"Table"}&portalUser=admin@myipsla.com
Sending data to scripts:
curl -H "Content-Type: application/json" -X POST -d '{"type":"processscript","scriptid":-5,"data":{"test":false}}' "http://xxx.xx.xx.xxx:7902/rest/api/?userName=admin&userPass=admin" curl -H "Content-Type: application/json" -X POST -d '{"type":"processscript","scriptname":"data script 1","data":{"test":false}}' "http://xxx.xx.xx.xxx:7902/rest/api/?userName=admin&userPass=admin"
[More about cUrl https://en.wikipedia.org/wiki/CURL]
Event Script to process incoming data:
var thisdata = JSON.parse(data); log.warn(data); log.warn(thisdata); log.warn(thisdata.data.test);