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.1.0.

GET https://192.0.2.5/rest/v1/system/nae_scripts/com.arubanetworks.mac_arp_count_monitor.1.0

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 learnt on a given VLAN and number of neighbors learnt using ARP",
  "expert_only": false,
  "nae_parameters": {
    "Vlan_Id": "/rest/v1/system/nae_scripts/mac_arp_count_monitor.1.0/nae_parameters/Vlan_Id"
  },
  "name": "mac_arp_count_monitor.1.0",
  "origin": "user",
  "script": "IyAtKi0gY29XBUCAgICpdGRvcih1cmky...LCAnQVJQIFRhYmxlIENvdW50JykK",
  "status": {
    "state": "VALIDATED"
  },
  "version": "1.0"
}