New Documentation of Petals CLI-Command Line Interface

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (12)

View Page History
_$PETALS_CLI_PREFS_ is the variable environement that points to the location of the preferences file.

This file contains the following a set of keys:
* *default.connection.host*: the host of the default Petals node (required). Initial Value: localhost
* *server<N>.host*: the host of the default Petals node (required).
* *default.connection.port*: *server<N>.port*: the JMX port of the default Petals node (required). Initial Value: 7700
* *default.connection.user*: *server<N>.user*: the JMX user name for the default Petals node (optional). Initial Value: petals
* *default.connection.password*: *server<N>.password*: the JMX password for the default Petals node (optional). Initial Value: petals
* *server<N>.alias*: the alias that identifies all the properties of a connection (required).
* *default.alias*: the default alias to use (required).
* *user.lang*: the language to use in Petals CLI.
** This property is optional. If not set, OS settings are used. If the OS language setting is not supported, then English is used.
If the file does not exist, or that _$PETALS_CLI_PREFS_ points to an invalid location, Petals CLI will use default settings when possible. Otherwise, it will display an error message.

\\
For a server, the *user* and *password* must both be set or both be absent.
An error message is displayed if only one of them is specified.

\\
The server alias must be unique in the properties file.
If a server alias is used twice, an error message will be displayed.

\\
Initial content of the file:

{quote}
# The default server / connection
default.alias = server1

# The connection properties of the 1st server
server1.alias = server1
server1.host = localhost
server1.port = 7700
server1.user = petals
server1.password = petals
{quote}

h1. Connection to a Petals node

{code}

\\
An alias can also be used.
{code}
> ./petals-cli.sh -a <alias> -c <command>
> ./petals-cli.sh -a <alias> -C
petals-cli@<host1>:<port1>>
{code}

h2. Interacting with several Petals nodes without exiting Petals CLI

Connected on <host1>:<port1> with '<user1>'
petals-cli@<host1>:<port1>> disconnect
petals-cli> connect -a <alias>
Connected on <host1>:<port1> with '<user1>'
petals-cli@<host1>:<port1>> disconnect
petals-cli> connect -h <host2> -n <port2> -u <user2> -p <password2>
Connected on <host2>:<port2> with '<user2>'
{code}

h2. Error Messages

{tip}Error messages should be written in active form.
Negative forms should be avoided.{tip}

\\
The preferences file does not exist.
The connect command results in the following error message.

{quote}No default connection is available. Use 'help connect' for more information.{quote}

\\
The preferences file is invalid (missing property, or duplicate alias...).
The connect command results in the following error message.

{quote}The preferences file contains <N> error(s).
- Error 1
- Error2{quote}

\\
Duplicate Alias.
{quote}The alias '<alias>' can only be used once.{quote}

\\
Missing property.
{quote}The property '<property>' is missing.{quote}

\\
Only *user* was specified for a server.
{quote}The credentials for '<alias>' are invalid: add the password or remove the user.{quote}

\\
Only *password* was specified for a server.
{quote}The credentials for '<alias>' are invalid: add the user or remove the password.{quote}

h1. Administration Commands