Skip to content
dswd edited this page Mar 11, 2014 · 3 revisions

API Usage

ToMaTo offers an XML-RPC API that can be used to control topologies. The web-frontend also uses this API, so everything that is possible in the web-frontend is also possible via the API. The API even offers somec features like executing commands on openvz devices that are not available in the web-frontend.

Tho API can be used with the client library that can easily be used interactively, scripted, or embedded into another application.

The client library

The client library can be downloaded directly from the source code (development version, stable version). The client library can either be used as a library to establish a connection to the API or it can be executed directly as a command-line client.

The command-line client accepts the following parameters:

usage: tomato.py [-h] --hostname HOSTNAME [--port PORT] [--ssl]
                 [--username USERNAME] [--password PASSWORD] [--file FILE]
                 [arguments [arguments ...]]

The German-Lab ToMaTo API server runs on tomato.german-lab.de on port 8000 and uses SSL so the call should be tomato.py --hostname master.tomato-lab.org --port 8001 --ssl

API documentation

Good examples how to use the API can be obtained from the test cases. More information about the API can be found in the APIDocumentation.