{section}
{column}
h1. Use cases
Petals CLI realizes the following use-cases.
h2. Petals CLI capabilities about script and shell usages
h3. Interactive console
Launching the Petals CLI with the following command line starts an interactive console with a prompt where the user can enter commands:
{code}
> ./petals-cli.sh -C
Type 'help' for help.
------------------------------------------------------------------------------
petals-cli>
{code}
This command is wrapped by another shell: petals-cli-console.sh
h3. Execution of a Petals CLI command directly on the command line
Launching the Petals CLI with the following command line executes the command specified on the command line:
{code}
> ./petals-cli.sh -c <command> <command-args>
{code}
h3. Execution of a Petals script file
Launching the Petals CLI with the following command line executes commands of a Petals script:
{code}
> ./petals-cli.sh -f <filename>
{code}
{info}A Petals script is text file containing command supported by Petals CLI.{info}
h3. Execution of an inlined Petals script
Launching the Petals CLI with the following command line executes commands provided through the 'stdin':
{code}
> cat <filename> | ./petals-cli.sh -f -
> ./petals-cli.sh -f - << EOF
<command1> <command1-args>
<command2> <command2-args>
EOF
{code}
h2. Connection to a Petals node
h3. Connection options from the command line
All parameters needed to a JMX connection to a remote Petals node must be configurable on the command line as options:
{code}
> ./petals-cli.sh -h <host> -n <port> -u <user> -p <password> -c <command>
> ./petals-cli.sh -h <host> -n <port> -u <user> -p <password> -C
Conected on <host1>:<port1> with <user1>
petals-cli>
{code}
h3. Interacting with several Petals node without exiting Petals CLI
In interactive mode or script mode, we should be able to close a connection and open another one without leaving Petals CLI. This is done by commands 'close' and 'open':
{code}
> ./petals-cli.sh -C
Type 'help' for help.
------------------------------------------------------------------------------
petals-cli> open <user1>:<password1>@<host1>:<port1>
Conected on <host1>:<port1> with <user1>
petals-cli> close
petals-cli> open <user2>:<password2>@<host2>:<port2>
Conected on <host2>:<port2> with <user2>
h2. Petals CLI commands
h3. Installation/Deployment of an artifact
Petals CLI is able to install/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>]
{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 component is a component. It has no sens for other artifacts. This argument is exclusive with {{<configuration-properties>}}.
- {{<configuration-properties>}} is a list of '{{<property-name>=<property-value>}}', separated by space, where {{<property-name>}} is the name of the property to configure with {{<property-value>}}. This argument is used only if the component is a component. It has no sens for other artifacts. This argument is exclusive with {{<configuration-file>}}.
h1. List of all available commands to run with petals-cli.sh or petals-cli.bat
Usage: \[-d\] \[-H \| \-v \| \[\[-h <host>\] \[-n <port>\] \[-u <user>\] \[-p <password>\] \[-f <file> \| \-c <command> <command-args> \| \-C\]\]\]
- *\-d,--debug*: Print stack trace and debugging informations
- *\-H,--help*: Print this help message and exit
- *\-V,--version*: Print the version of Petals CLI and exit
- *\-h,--host <arg>*: remote petals ESB host name
- *\-n,--port <arg>*: port number
- *\-p,--password <arg>*: password
- *\-u,--user <arg>*: username
- *\-f,--file <filename>*: Executes commands contained in the file, if <filename> is '\-', commands are read from the 'stdin'
- *\-c,--command <command> <command-args>*: Execute the command provided on the command line
- *\-C,--console*: Enable the mode 'console'
h1. List of all available interactive commands in petals-cli console\\
When launched petals-cli, it offers the following commands :
- *deploy*: Deploy and start a JBI artifact in petals container.
- *exit*: Exit this shell.
- *help*: Display this help message or help for a specific command.
- *listartefacts*: List JBI artifacts name and current status.
- *listregistry*: List the entries of the registry.
- *load*: Load properties from files.
- *print*: Print a message.
- *pwd*: Print the working directory.
- *set*: Assign a value to the system property named key.
- *show*: Print informations about a JBI artifact.
- *shutdown*: Shutdown the container.
- *stop*: Stop the container.
- *undeploy*: Stop and uninstall or undeploy JBI artifacts.
- *version*: Print version informations about petals container.
{column}
h1. Use cases
Petals CLI realizes the following use-cases.
h2. Petals CLI capabilities about script and shell usages
h3. Interactive console
Launching the Petals CLI with the following command line starts an interactive console with a prompt where the user can enter commands:
{code}
> ./petals-cli.sh -C
Type 'help' for help.
------------------------------------------------------------------------------
petals-cli>
{code}
This command is wrapped by another shell: petals-cli-console.sh
h3. Execution of a Petals CLI command directly on the command line
Launching the Petals CLI with the following command line executes the command specified on the command line:
{code}
> ./petals-cli.sh -c <command> <command-args>
{code}
h3. Execution of a Petals script file
Launching the Petals CLI with the following command line executes commands of a Petals script:
{code}
> ./petals-cli.sh -f <filename>
{code}
{info}A Petals script is text file containing command supported by Petals CLI.{info}
h3. Execution of an inlined Petals script
Launching the Petals CLI with the following command line executes commands provided through the 'stdin':
{code}
> cat <filename> | ./petals-cli.sh -f -
> ./petals-cli.sh -f - << EOF
<command1> <command1-args>
<command2> <command2-args>
EOF
{code}
h2. Connection to a Petals node
h3. Connection options from the command line
All parameters needed to a JMX connection to a remote Petals node must be configurable on the command line as options:
{code}
> ./petals-cli.sh -h <host> -n <port> -u <user> -p <password> -c <command>
> ./petals-cli.sh -h <host> -n <port> -u <user> -p <password> -C
Conected on <host1>:<port1> with <user1>
petals-cli>
{code}
h3. Interacting with several Petals node without exiting Petals CLI
In interactive mode or script mode, we should be able to close a connection and open another one without leaving Petals CLI. This is done by commands 'close' and 'open':
{code}
> ./petals-cli.sh -C
Type 'help' for help.
------------------------------------------------------------------------------
petals-cli> open <user1>:<password1>@<host1>:<port1>
Conected on <host1>:<port1> with <user1>
petals-cli> close
petals-cli> open <user2>:<password2>@<host2>:<port2>
Conected on <host2>:<port2> with <user2>
h2. Petals CLI commands
h3. Installation/Deployment of an artifact
Petals CLI is able to install/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>]
{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 component is a component. It has no sens for other artifacts. This argument is exclusive with {{<configuration-properties>}}.
- {{<configuration-properties>}} is a list of '{{<property-name>=<property-value>}}', separated by space, where {{<property-name>}} is the name of the property to configure with {{<property-value>}}. This argument is used only if the component is a component. It has no sens for other artifacts. This argument is exclusive with {{<configuration-file>}}.
h1. List of all available commands to run with petals-cli.sh or petals-cli.bat
Usage: \[-d\] \[-H \| \-v \| \[\[-h <host>\] \[-n <port>\] \[-u <user>\] \[-p <password>\] \[-f <file> \| \-c <command> <command-args> \| \-C\]\]\]
- *\-d,--debug*: Print stack trace and debugging informations
- *\-H,--help*: Print this help message and exit
- *\-V,--version*: Print the version of Petals CLI and exit
- *\-h,--host <arg>*: remote petals ESB host name
- *\-n,--port <arg>*: port number
- *\-p,--password <arg>*: password
- *\-u,--user <arg>*: username
- *\-f,--file <filename>*: Executes commands contained in the file, if <filename> is '\-', commands are read from the 'stdin'
- *\-c,--command <command> <command-args>*: Execute the command provided on the command line
- *\-C,--console*: Enable the mode 'console'
h1. List of all available interactive commands in petals-cli console\\
When launched petals-cli, it offers the following commands :
- *deploy*: Deploy and start a JBI artifact in petals container.
- *exit*: Exit this shell.
- *help*: Display this help message or help for a specific command.
- *listartefacts*: List JBI artifacts name and current status.
- *listregistry*: List the entries of the registry.
- *load*: Load properties from files.
- *print*: Print a message.
- *pwd*: Print the working directory.
- *set*: Assign a value to the system property named key.
- *show*: Print informations about a JBI artifact.
- *shutdown*: Shutdown the container.
- *stop*: Stop the container.
- *undeploy*: Stop and uninstall or undeploy JBI artifacts.
- *version*: Print version informations about petals container.