
The Argo server is a simple daemon which listens upon a network socket and accepts client commands.
This page documents the protocol which is used by clients to communicate with the server.
The API which the network server uses is deliberately designed to be very simple, and easy to work with. The protocol is line-orientated, with each client-request being of the form "command arg1 arg2 arg3 .. argN". (Internally each command word is implemented by a different plugin.)
When the server recieves a command from the client it will acknowlege it with one of the following return codes:
200 [comment] - Command accepted 300 [comment] - End of command output 400 [comment] - Error
As you can see there are three different codes in use at the moment:
In the normal course of a connection the exchange is assumed to look like this:
At any point the server may send an error message "400 ERROR" which denotes the end of this command.
As an example here we'll list all installed Xen instances:
skx@lappy:~$ telnet itchy 20203 Trying 192.168.1.50... Connected to itchy. Escape character is '^]'. list available 200 OK lj < This is a Xen instance with the name 'lj' builder < This is a Xen instance with the name 'builder' test < This is a Xen instance with the name 'test' dev < This is a Xen instance with the name 'dev' 300 END
To pause a machine we need to authenticate:
skx@lappy:~$ telnet itchy 20203 Trying 192.168.1.50... Connected to itchy. Escape character is '^]'. pause lj 400 NOT AUTHENTICATED
For a client to authenticate itself it should use the "auth" command, along with a username and password. The server will compare these values to those set in its configuration file /etc/argo-server/argo-server.conf.
kx@lappy:~$ telnet itchy 20203 Trying 192.168.1.50... Connected to itchy. Escape character is '^]' auth steve steve 200 OK 300 DONE pause lj 200 OK 300 DONE exit 200 OK 300 DONE
Note: it is possible to add accounts which are only allowed to control a particular virtual host. This makes it possible for you to allow a Xen "owner" to control their own instance without them being able to reboot/pause/shutdown your own instances. If a user attempts to perform an action for which they have no permission it will be denied :)
(Users who do not have permission to modify a particular instance will not have those instances displayed when they use the "list running", or "list available" commands.)
Here is an example of a user steve attempting to pause an instance which they are not allowed to modify:
skx@itchy:$ telnet localhost 20203 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. auth steve steve <- Authenticate 200 OK 300 DONE list available <- List available instances 200 OK lj <- Several available instances one.my.flat three.my.flat two.my.flat 300 DONE pause lj <- Attempt to pause somebody elses instance. 400 NOT ALLOWED <- Request denied.
This is a list of the currently implemented primitives. There is certainly room for more to be added. I think the obvious missing ones are:
dmesg > Show the DMESG output of the Xen host. exit > Disconnect info name > Give information on the Xen instance called 'name' ip name > Show the IP address of the given host. mac name > Show the MAC address of the given host. nop > Keep the connection open. pause name > Pause the Xen instance called 'name' reboot name > Reboot the given running instance. start name > Start a Xen instance called 'name' stop name > Stop the running instance with the name 'name' tx name > Show network traffic transmitted by this host. rx name > Show network traffic recieved by this host. unpause name > Unpause the Xen instance called 'name' uptime name > Show the uptime for the Xen instance called 'name' list available > List all available xen instances. list running > List all running xen instances. exit > Disconnect. help > Give brief help information
Each command is implemented in a dynamically loaded plugin, see /usr/share/perl5/Xen/Monitor/Plugins for examples. Adding new ones should be fairly trivial for somebody comfortable with Perl.
A plugin can contain a number of different commands if you wish. See start.pm for an example of that.
Development upon argo has ceased pending a redesign.