The LoadMaster RESTful API can be used in conjunction with many scripting methods and applications to allow users and applications to directly access the LoadMaster.

The examples provided in this document use the cURL tool (a Linux command line tool for transferring data with URL syntax) to demonstrate the structure of the API URL.

The syntax for using cURL is as follows:

curl -o <output XML> -k -silent -u <user>:<Password> <URL>
Note: If the username or password has a space in them, please surround <user> and <password> with double quotes, for example “<user>”:”<password>”.
  • -o: output to the following file rather than just showing the results on screen
  • <output XML>: the filename to store the response XML from the LoadMaster.
  • -k: ignore the SSL certification on the LoadMaster
  • -silent: do not output anything on screen
  • -u: use the following login information
  • <user>: the username
  • <Password>: the user password
  • <URL>: the query to send

The syntax for xpath is as follows:

xpath -q –e <XML path> <XML file>
  • -q do not output anything informational, only output the raw data
  • <XML path> the path inside the XML structure to look for the raw data
  • <XML file> the XML file to parse

Instead of printing the data output from the XML parsing on the screen, the output can be assigned to a variable as follows:

var=“expr xpath -q –e <XML path> <XML file>”

It is possible to pass parameters in a cURL command via the HTTP POST method. This is a more secure method because the parameters are not passed in the URL.

Examples of a get and set command using this method are below:

curl --data "param=motd" –k https://<user>:<password>@<LoadMasterIPAddress>/access/get
curl --data "param=motd&value=<value>" –k https:// <user>:<password>@<LoadMasterIPAddress>/access/set

The examples in this document include a typical XML response which is generated by the command.

Some examples show a “before” situation and an “after” situation where the object has been changed.

Items in the response which have changed as a result of the command are highlighted in yellow.