> xo-cli helpUsage: Global options: --allowUnauthorized, --au Accept invalid certificate (e.g. self-signed). --url <url>, -u <url> Specify an XO instance to use for the command instead of relying on the one registered. The URL must include credentials: https://token@xo.company.net/ xo-cli register [--allowUnauthorized] [--expiresIn <duration>] [--otp <otp>] <XO-Server URL> <username> [<password>] xo-cli register [--allowUnauthorized] [--expiresIn <duration>] --token <token> <XO-Server URL> Registers the XO instance to use. --allowUnauthorized, --au Accept invalid certificate (e.g. self-signed). --expiresIn <duration> Can be used to change the validity duration of the authorization token (default: one month). --otp <otp> One-time password if required for this user. --token <token> An authentication token to use instead of username/password. xo-cli create-token <params>… Create an authentication token for XO API.
Register your XO instance
> xo-cli register http://xo.my-company.net admin@admin.net adminSuccessfully logged with admin@admin.net
Note: only a token will be saved in the configuration file.
List available objects
Prints all objects:
> xo-cli list-objects
It is possible to filter on object properties, for instance to prints
all VM templates:
> xo-cli list-objects type=VM-template
List available commands
> xo-cli list-commands
Commands can be filtered using patterns:
> xo-cli list-commands '{user,group}.*'
Execute a command
The same syntax is used for all commands: xo-cli <command> <param name>=<value>...
The return value is the identifier of this new server in XO.
Because command lines are usually untyped, parameters (except true and false which are considered as
booleans) are assumed as strings by default, other types must be encoded as JSON and prefixed by json::