Getting information about scripts using the REST API
Instructions and examples in this document use an IP address that is reserved for documentation, 192.0.2.5, as an example of the IP address for the switch. To access your switch, you must use the IP address or hostname of that switch.
Prerequisites
You must be logged in to the switch REST API.
Procedure
-
To get detailed information about a specific script, use the GET method on the URI of the script.
This example gets information about the script named
com.arubanetworks.mac_arp_count_monitor
:GET https://192.0.2.5/rest/v1/system/nae_scripts/com.arubanetworks.mac_arp_count_monitor
The following example is the response body for the request. The entire script is returned in base64 format. Because of its length, the example shows only part of the script.
{ "author": "Aruba Networks", "description": "Agent to monitor MAC address learned on a given VLAN and number of neighbors learned using ARP", "expert_only": false, "nae_parameters": { "Vlan_Id": "/rest/v1/system/nae_scripts/mac_arp_count_monitor/nae_parameters/Vlan_Id" }, "name": "mac_arp_count_monitor", "origin": "user", "script": "IyAtKi0gY29XBUCAgICpdGRvcih1cmky...LCAnQVJQIFRhYmxlIENvdW50JykK", "status": { "state": "VALIDATED" }, "version": "1.0" }
-
To get a list of all the scripts, use the GET method on the URI of the
nae_scripts
collection of the script.For example:
GET https://192.0.2.5/rest/v1/system/nae_scripts
Example response:
[ "/rest/v1/system/nae_scripts/system_resource_monitor", "/rest/v1/system/nae_scripts/mac_arp_count_monitor", "/rest/v1/system/nae_scripts/ospf_neighbor" ]