Updating a script 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 with a user name that has administrator rights.

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

Procedure
  1. If the name of the script in the Manifest is an exact match to the name of the existing script, and the existing script was installed while the switch was running ArubaOS-CX software version 10.03 or later, use the PUT method to update the script.

    When the PUT method is used, the existing script and agents are deleted, the script is replaced, and the agents are automatically recreated with the same parameters that were used before the script was updated. If the monitors in the new script and the existing script are the same, previously collected time-series data is preserved when the script is updated.

  2. If the existing script was installed while the switch was running an ArubaOS-CX software version earlier than 10.03, or the script name in the Manifest does not match the name of the existing script—for example one has a version number in the name and the other does not—you must delete the existing script and then upload the new script:
    1. Use the DELETE method to delete the script.

      When you delete a script, all associated agents are deleted automatically.

    2. Use the POST method to upload the modified script.
    3. Clear the NAE data.
    4. Create agents associated with the new switch.