Downloading a script from the switch 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
Use the GET method on the URI of the script.

This example downloads 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 the length of the script, the example shows only part of the script.

{
  "author": "Aruba Networks",
  "description": "MAC address learned on VLAN ID 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"
}