Exablaze is now part of Cisco.

Using ExaLINK as a kill switch

Author Brendan - Date 2014/12/08

In this blog I want to go over how a web application can be written to control an ExaLINK, for example a kill switch.

The ExaLINK is touted for its low latency and ability for remote management. Rather than allow full configuration access to all users, you may want to allow different sets of functionality to different groups of people. For example, you may want an account manager to be able to activate a kill switch, but only allow system adminitrators to manage port configuration. One approach to this, is to provide web applications with suitable functionality for the particular users. In this blog we demonstrate how one could set up a web application to make use the the ExaLINK's API to perform specific tasks.


Some features that are accessible in the ExaLINK's web interface are also accessible through POST requests. The request and response are encoded in structured JSON.

For any set of ports, one can query:

For any set of ports, one can set:

In our example, we imagine an account manager being able to control whether a client has access to a service. In other words, we want a user to be able to disable or enable a particular port pairing. Using a command line tool, such as curl, one can perform some basic configuration and maintenance on an ExaLINK.

For example, to enable ports 15, 16 and 17:

 curl -H 'Accept: application/json' \
  -X POST \
  -d '{ "auth":{ "username":"user", "password":"pass"},
                    "set":{ "enable":[15,16,17] } }'


It is easier and more intuitive to present the required functionality through a web page. This is safer too, as all relevant data and options can be presented in a single place, and easily updated as required.

The example we have produced (available from GitHub ) is functional. We leave it as an exercise for the reader to improve its appearance. Similarly we do not attempt to address web security in this blog.

The first thing to note is that the ExaLINK's api makes use of POST requests. That means that we are not able to submit data directly to the ExaLINK, as browsers block POST's to different domains. For this reason, we provide the functionality in a separate web server, using node. The web server is able to post requests to a different domain.

In our example, the account manager has access to three clients, and is easily able to disable/enable any of them. The node application, control.js, provides underlying functionality for the page client.html. The page submits a get request to the node app, to get the current status. It uses a timer to periodically get updates. There are two pieces of information we are after for each port:

These are represented by fields "status" and "linked" in our example, see

![Diagram showing normal web app output] (https://exablaze.com/img/media/link-app-blog01.png)

Depending on the status returned from the node app, we display different data in a table:

![Diagram showing port needing to be relinked] (https://exablaze.com/img/media/link-app-blog02.png)

![Diagram showing disabled port] (https://exablaze.com/img/media/link-app-blog03.png)

In each case, the button results in a simple post request being made to the node app. The node app then constructs and sends the appropriate JSONstructure to the ExaLINK.

Please take the code and craft your own version of a kill switch.

As usual if you have any questions or want more information about anything we've discussed in this blog, get in touch!