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

View Page History
Which evolution would you like on Petals? Share it! http://www.petalslink.com/feedback
{code}

{column}
{column:width=40%}
If an error occurs during the execution of a flow of commands:
- the command that has thrown the error is interrupted,
- the return code of the command can be check using the commands *{{isParsingErrorReturned}}*, *{{isExecutionErrorReturned}}*, *{{isNoErrorReturned}}*, {{{*}isParsingErrorReturned{*}}}, {{{*}isExecutionErrorReturned{*}}}, {{{*}isNoErrorReturned{*}}}, the ternary conditional operator, and the attribute *{{lastErrorCode}}*: {{{*}lastErrorCode{*}}}:
{code}
> ./petals-cli.sh - << EOF
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}}*' '{{{*}close{*}}}' and '*{{open}}*'. '{{{*}open{*}}}'. If no arguments are set on command 'open', default values (localhost:7700, login=petals, pwd=petals) are used:
{code}
> ./petals-cli.sh -C

By default (if no argument or option is set):
- In mode 'console', the connexion is establish on command '*{{open}}*' '{{{*}open{*}}}' to localhost:7700 with credentials 'petals/petals',
{code}
> ./petals-cli.sh -C
{code}
where:
- {{<maven-artifact>}} is the Maven identifiers of the artifact to install: {{group-id:artifact-id:version{}}}{{[:classifier]}}. If needed, the Maven repository is to define in the Maven configuration file ($HOME/.m2/settings.xml)
- {{<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>}}.
h4. Installation/Deployment and start in mass

To deploy several artifact in one command, just put them in a local directory and execute the command '*{{deploy}}*': '{{{*}deploy{*}}}':
{code}
> ./petals-cli.sh -y - << EOF
h4. Starting an artifact

An artifact can be started using the command '*{{start}}*' '{{{*}start{*}}}' with the argument '*{{artifact}}*': '{{{*}artifact{*}}}':
{code}
> ./petals-cli.sh -c start artifact [ <artifact-file> | [<artifact-type> <artifact-id>] ]
h4. Stopping an artifact

An artifact can be stopped using the command '*{{stop}}*' '{{{*}stop{*}}}' with the argument '*{{artifact}}*': '{{{*}artifact{*}}}':
{code}
> ./petals-cli.sh -c stop artifact [ <artifact-file> | [<artifact-type> <artifact-id>] ]
- {{<artifact-type>}} is the nature (SL, component, SA) of the artifact to undeploy
- {{<artifact-id>}} is the JBI identifier of the artifact to undeploy
{note}Add feature to remove artefact by name{note}

h4. Uninstallation/Undeployment and stop in mass

To undeploy several artifact in one command, just put them in a local directory and execute the command '*{{undeploy}}*': '{{{*}undeploy{*}}}':
{code}
> ./petals-cli.sh -y - << EOF
h4. Showing installed JBI artefacts

All installed JBI artefacts can be listed using the command '*{{list '{{{*}list \[<artifact-pattern> \[artifact-type\]\]}}*': \[artifact-type\]\]*}}':
{code}
> ./petals-cli.sh -c list
h4. Getting information on an artifact

Information can be get about a JBI artifact using the command '*{{show}}*': '{{{*}show{*}}}':
{code}
> ./petals-cli.sh -c show [-e] [ <artifact-file> | [<artifact-type> <artifact-id>] ]
- {{<artifact-type>}} is the nature (SL, component, SA) of the artifact to show
- {{<artifact-id>}} is the JBI identifier of the artifact to show
The option '{{\-e}}' displays extended information.

Information displayed are:
h4. Exit the mode 'console'

To exit the mode 'console', use the command '*{{exit}}*'. '{{{*}exit{*}}}'. If a number is set as argument, it is used as return code otherwise, the return code 0 is used:
{code}
> ./petals-cli.sh -C
h4. Interrupt a flow of commands

A flow of commands can be interrupted using the command '*{{exit}}*'. '{{{*}exit{*}}}'. If a number is set as argument, it is used as return code. The argument '{{lastErrorCode}}' is used as return code value of the last executed command. Otherwise the return code 0 is returned to the shell:
{code}
> ./petals-cli.sh -y - << EOF
h4. Getting the versions of the Petals node

To get the version of Petals node, the version of the JVM running Petals node, and its operating system, use the command '*{{version}}*': '{{{*}version{*}}}':
{code}
> ./petals-cli.sh -c version
h4. Stopping the container

The container can be stopped using the command '*{{stop}}*' '{{{*}stop{*}}}' with the argument '*{{container}}*': '{{{*}container{*}}}':
{code}
> ./petals-cli.sh -c stop container
h4. Shutdowning the container

The container can be shutdowned using the command '*{{stop}}*' '{{{*}stop{*}}}' with the argument '*{{container}}*' '{{{*}container{*}}}' and the parameter '*{{--shutdown}}*': '{{*\--shutdown{*}}}':
{code}
> ./petals-cli.sh -c stop container --shutdown
h4. Synchronizing the registry

A synchronization of the registry on all nodes of the Petals topology can be done using the command '*{{registry-sync}}*': '{{{*}registry-sync{*}}}':
{code}
> ./petals-cli.sh -c registry-sync
h4. Showing the registry full content

The full content of the registry can be dump using the command '*{{registry-list}}*': '{{{*}registry-list{*}}}':
{code}
./petals-cli.sh -c registry-list
h4. Filtering the registry full content by endpoint

The content of the registry relative to an endpoint can be dump using the command '*{{registry-list}}*': '{{{*}registry-list{*}}}':
{code}
./petals-cli.sh -c registry-list endpoint <endpoint-name>
h4. Filtering the registry full content by service

The content of the registry relative to a service can be dump using the command '*{{registry-list}}*': '{{{*}registry-list{*}}}':
{code}
./petals-cli.sh -c registry-list service <service-name>
h4. Filtering the registry full content by interface

The content of the registry relative to an interface can be dump using the command '*{{registry-list}}*': '{{{*}registry-list{*}}}':
{code}
./petals-cli.sh -c registry-list interface <interface-name>