====== 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_cat_virtual_systems|Virtual Systems]] - Commands to create, delete, and manage virtual or real systems * [[vm2_cat_virtual_disks|Virtual Disks]] - Add, delete and resize virtual disks * [[vm2_cat_amazon_ec2|Amazon EC2]] - List EC2 accounts and other objects * [[vm2_cat_network_interfaces|Network Interfaces]] - Create, list and delete network interfaces on virtual systems * [[vm2_cat_system_owners|System Owners]] - Create and manage additional owner accounts * [[vm2_cat_virtualmin_domains|Virtualmin Domains]] - Create, list and move Virtualmin domains on VM2 systems * [[vm2_cat_license_management|License Management]] - List and add Virtualmin serial numbers for systems * [[vm2_cat_file_management|File Management]] - Transfer files to, from and between systems * [[vm2_cat_other_scripts|Other Scripts]] - Commands that don't fall into any category