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 (14)

View Page History
{section}
{column}

h1. Introduction

The connection is a JMX connection (see the credentials defined in the _topology.xml_ file of Petals).

Petals CLI works with Petals 4 and higher, but may also work with Petals 3 versions.
{column}
{column:width=40%}
{code}

On Windows, to be able to launch Petals CLI by a double-click, this command is wrapped by another script: *petals-cli-console.bat*.
On Linux, there is no wrapper script but a shell alias can be created. Next, this alias will be automatically created by a RPM or debian package.

* The attribute {{lastErrorCode}} is an argument of the command {{exit}} to return the return code of the last executed command.

h2. Exit from the Console mode

To exit the console mode, use the '_exit_' command.
If a number is set as an argument, it is used as return code. Otherwise, the 0 is returned.
{code}
* section 'Global preferences':
** *alias.default*: 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 value is specified and not supported, then English is picked up.

For security reasons, a Petals CLI user may decide that there should be no default connection.
In that case, he may decide to delete the preference file, so that any user will have to type in the right information.
If the preference (properties file) does not exist, Petals CLI displays an error message.

Petals CLI is able to deploy and start a JBI artifact without distinction between shared-library, component and service assembly using the following command:
{code}
deploy <artifact-file> [<configuration-file> | <configuration-properties>]
deploy <artifact-file> [-f,--file <configuration-file> | -D<configuration-properties>]
{code}
where:
* *<artifact-file>* is the local file name or the URL of the artifact to install or deploy and start
* *<configuration-file>* is the local file name or the URL of the properties file used to configure the artifact. This argument is used only if the artifact is a component. It has no sense for other artifacts. This argument is exclusive with {{<configuration-properties>}}.
* *<configuration-properties>* is a list of '_<property-name>=<property-value>_', separated by a space, comma, where _<property-name>_ is the name of the property to configure with _<property-value>_. This argument is used only if the artifact is a component. It has no sense for other artifacts. This argument is exclusive with *<configuration-file>*.

{tip}Auto-completion is available on artifacts IDs and artifact file names.{tip}
To deploy and start several artifacts in one command, just put them in a local directory and execute the command '_deploy_':
{code}
deploy -d,--directory <directory>
{code}
{code}
> ./petals-cli.sh -y - << EOF
deploy -d /tmp
EOF
> ./petals-cli.sh -C
Type 'help' for help.
------------------------------------------------------------------------------
petals-cli> deploy -d /tmp
Are you sure you want to deploy all artifacts of directory '/tmp'? (Y/n)
{code}
* *<artifact-id>* is the JBI identifier of the artifact to show.

The '\-e' option displays extended information.

Displayed information includes: