Difference between revisions of "API Overview"

From Observer GigaFlow Support | VIAVI Solutions Inc.
Jump to: navigation, search
(Created page with "Category:APICategory:NetFlowCategory:Technical Notes Browser rest access: http://xxx.xx.xx.xxx:7902/rest/?jsonRequest={"reportName":"Applications","type":"Table"}&...")
 
 
(8 intermediate revisions by one user not shown)
Line 1: Line 1:
 
[[Category:API]][[Category:NetFlow]][[Category:Technical Notes]]
 
[[Category:API]][[Category:NetFlow]][[Category:Technical Notes]]
 
Browser rest access:
 
Browser rest access:
http://xxx.xx.xx.xxx:7902/rest/?jsonRequest={"reportName":"Applications","type":"Table"}&portalUser=admin@myipsla.com
 
  
Sending data to scripts
+
<pre>
 +
http://xxx.xx.xx.xxx:7902/rest/?jsonRequest={"reportName":"Applications","type":"Table"}&portalUser=admin@myipsla.com
 +
</pre>
 +
 
 +
The API can also be accessed at:
 +
 
 +
<pre>
 +
http://xxx.xx.xx.xxx:7902/rest/api?jsonRequest={"reportName":"Applications","type":"Table"}&portalUser=admin@myipsla.com
 +
</pre>
 +
 
 +
Sending data to scripts:
 +
 
 +
<pre>
 
  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"
 +
</pre>
 +
 +
[https://en.wikipedia.org/wiki/CURL More about cUrl].
 +
 +
Event script to process incoming data:
  
Event Script to process incoming data
 
 
  var thisdata = JSON.parse(data);
 
  var thisdata = JSON.parse(data);
 
  log.warn(data);
 
  log.warn(data);
 
  log.warn(thisdata);
 
  log.warn(thisdata);
 
  log.warn(thisdata.data.test);
 
  log.warn(thisdata.data.test);

Latest revision as of 09:49, 25 April 2019

Browser rest access:

 http://xxx.xx.xx.xxx:7902/rest/?jsonRequest={"reportName":"Applications","type":"Table"}&portalUser=admin@myipsla.com

The API can also be accessed at:

 http://xxx.xx.xx.xxx:7902/rest/api?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.

Event script to process incoming data:

var thisdata = JSON.parse(data);
log.warn(data);
log.warn(thisdata);
log.warn(thisdata.data.test);