Difference between revisions of "API Application Mapping"
From Observer GigaFlow Support | VIAVI Solutions Inc.
Kevin Wilkie (Talk | contribs) (Created page with "http://viavi.anuview.net/rest/?jsonRequest={“type”:”configurationout”} This will return a few elements but the interesting ones are “Named Ports” and “Defined Ap...") |
Kevin Wilkie (Talk | contribs) |
||
Line 1: | Line 1: | ||
+ | API endpoint is: | ||
http://viavi.anuview.net/rest/?jsonRequest={“type”:”configurationout”} | http://viavi.anuview.net/rest/?jsonRequest={“type”:”configurationout”} | ||
+ | |||
This will return a few elements but the interesting ones are “Named Ports” and “Defined Applications” | This will return a few elements but the interesting ones are “Named Ports” and “Defined Applications” | ||
+ | |||
Both are just json arrays, Named Ports maps the basic port/protocol to a human name, these are always the positive IDs. | Both are just json arrays, Named Ports maps the basic port/protocol to a human name, these are always the positive IDs. | ||
e.g. | e.g. | ||
− | "Named Ports": [{ | + | "Named Ports": [{ |
"id": 393223, | "id": 393223, | ||
"value": "ECHO" | "value": "ECHO" | ||
Line 22: | Line 25: | ||
"value": "VNC-SERVER" | "value": "VNC-SERVER" | ||
}] | }] | ||
+ | |||
If there is no name or you just want the port/protocol you can decode the ID directly using | If there is no name or you just want the port/protocol you can decode the ID directly using | ||
− | public static int[] getProtocolPortInts(int integer) { | + | |
+ | public static int[] getProtocolPortInts(int integer) { | ||
int protocol = integer / 65536; | int protocol = integer / 65536; | ||
int protocolMultiplied = integer - (integer % 65536); | int protocolMultiplied = integer - (integer % 65536); | ||
Line 31: | Line 36: | ||
Defined Applications are the profiler-based application mappings, these always have a negative ID, the “profileid” in each object maps to the flow object used to mark the traffic. | Defined Applications are the profiler-based application mappings, these always have a negative ID, the “profileid” in each object maps to the flow object used to mark the traffic. | ||
− | "Defined Applications": [{ | + | "Defined Applications": [{ |
"description": "Just for test", | "description": "Just for test", | ||
"id": -212, | "id": -212, |
Latest revision as of 08:55, 28 January 2020
API endpoint is: http://viavi.anuview.net/rest/?jsonRequest={“type”:”configurationout”}
This will return a few elements but the interesting ones are “Named Ports” and “Defined Applications”
Both are just json arrays, Named Ports maps the basic port/protocol to a human name, these are always the positive IDs. e.g.
"Named Ports": [{ "id": 393223, "value": "ECHO" }, { "id": 393730, "value": "SHELL" }, { "id": 393731, "value": "PRINTER" }, { "id": 395265, "value": "NFSD" }, { "id": 397327, "value": "XGRID" }, { "id": 399116, "value": "VNC-SERVER" }]
If there is no name or you just want the port/protocol you can decode the ID directly using
public static int[] getProtocolPortInts(int integer) { int protocol = integer / 65536; int protocolMultiplied = integer - (integer % 65536); int port = integer - protocolMultiplied; return new int[]{protocol, port}; }
Defined Applications are the profiler-based application mappings, these always have a negative ID, the “profileid” in each object maps to the flow object used to mark the traffic.
"Defined Applications": [{ "description": "Just for test", "id": -212, "name": "DNS TEST", "profileid": -210, "rank": -1 }, { "description": "Teamviewer Remote Access", "id": -199, "name": "Teamviewer", "profileid": -197, "rank": -1 }, { "description": "Yahoo Test icon ", "id": -150, "name": "Yahoo App ", "profileid": -148, "rank": -1 }]