Creating an agent from an existing script using the REST API

Instructions and examples in this document use an IP address that is reserved for documentation,, 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.

  • You must be logged in to the switch REST API with a user name that has administrator rights.

  • The switch REST API access mode must be read-write.

  • The script you will use to create the agent must be in a VALIDATED state.

Use the POST method on the URI of the nae_agents collection of the script. In the request body, provide the required information in JSON format.

This example creates an agent with the following characteristics:

  • The name of the agent is: com.arubanetworks.bgp_monitor.Agent1

  • The name of the script is: com.arubanetworks.bgp_monitor

  • The agent is created in a disabled state ("disabled":true).

  • The threshold parameter of the script is set to the value 10.

    "name": "com.arubanetworks.bgp_monitor1.0.Agent1",
  • Agents must have a unique name. If an agent that has the same name exists, the request fails with response code 400 and the message: "NAE agent <agent_name> exists already"

  • If you supply a parameter value that is not the expected type for that parameter, the request fails with response code 400 and the message: "Value type mismatch for the parameter <parameter_name>"

  • If the JSON request body does not include a parameter that is required by the script, the default value of that parameter is used when creating the agent.