Traffic Sentinel : Help
Help Index Top > File > REST

The REST page is used to install, edit and test REST API scripts.

Topics:

See Also:


What is a query script?

Each script defines a REST API that allows traffic queries and other scriptable features to be invoked remotely by third party and internally developed tools. Each script can be adapated to the requirements of the client application, defining custom input argumements and formatting results to suite the needs of the client.

Back to Top

How do I install a script?

You must first put the script file on the computer you are using to access Traffic Sentinel. Next, go to the Sentinel:File>REST page. Select the Scripts option. Click on the Upload button at the bottom of the table and enter the location of the script file into the input box and click Submit. Once uploaded, the new script will appear in the list of scripts.

Back to Top

How do I edit a script?

Select the Scripts option. Click on the Edit button to the right of the script in the table. Make changes to the script sources and then click the Test button to check for syntax errors and examine script output. Click Save Changes to save the new version of the script, or Cancel to exit without saving changes.

See Tutorial: REST API Builder for information on developing scripts and Tutorial: Customizing the Dashboard to see how scripts can be used to build dashboards.

Back to Top

How do I create a new script?

Select the Scripts option. Click on the New button at the bottom of the table. Fill in the form, giving the script a File name, author, description and specify the output format for data generated by the script. Click Submit to create the empty script which will appear in the table.

Alternatively, if there is an existing script that can be used as a template for the new script, click on the Copy button next to the script and provide a name for the copy.

See How do I edit a script? for instructions on editing the new script.

Back to Top

How do I access the REST API?

Select the Scripts option to see the Query URL associated with each query. The query URL takes the form /inmsf/Q/<file_name>. Script Inputs are listed in the table and are provided as URL query parameters. For example, if the script test.js takes an argument ipaddress then the following URL will invoke the script for address 10.0.0.1, http://localhost/inmsf/Q/test.js?ipaddress=10.0.0.1

Back to Top

How do I get usage statistics for scripts?

Select the Statistics option to see how many times each script has been invoked, the number of cache hits, average excecution time, total time, error, last access time and last modified time for each script.

Back to Top

How do I monitor and control currently running scripts?

Select the Running option to see a list of the currently running queries. The table includes the remote host invoking each query and the run time associated with the query. Click on the Kill button associated with a specific query to selectively terminate the query. Click on the Kill All Queries button at the bottom of the table to terminate all the queries.

Back to Top