VM2 Command Line API

Like Virtualmin, everything that you can do via VM2's web interface can also be done from the command line. In the directory server-manager under the Webmin root (usally /usr/libexec/webmin or /usr/share/webmin) are a set of Perl scripts that can be run as root either manually or from your own scripts, or perform operations such as rebooting systems, creating new instances and adding Virtualmin domains.

All of these scripts take command-line arguments that start with '--', and may be followed by a parameter. For example, to display the details of a single managed system, you might run :

cd /usr/libexec/webmin/server-manager
./list-systems.pl --host box1.xen.yourcompany.com --multiline

All of the scripts produce output showing either the progress of the actions they are taking, or a list of requested results. Scripts that perform some action (like creating a virtual system) exit with a non-zero status on failure, or zero on success. Scripts that display information all have an optional --multiline parameter to display their output in a complete and easily-parsable format. Without it, output is shown in a table that is easier for a human to read.

All of the commands accept the --help parameter, which will cause them to output a list of all accepted command-line parameters. Optional parameters are shown surrounded by [ ]. This same information will also be displayed if a command is called with an unknown or missing parameter, sometimes accompanied by a more detailed error message.

Commands are broken down into categories by function, listed below :

 
vm2_command_line_api.txt (18182585 views) · Last modified: 2008/07/18 01:20 by JamieCameron
 
Recent changes RSS feed

Talk and Get Help

Support
Forums
Bugs and Issues

Get Virtualmin

OS Support
Buy Online
Download
Copyright 2005-2007 Virtualmin, Inc. All rights reserved.