Using the command line interface
To allow remote management of TORO Integrate instances via the terminal, all editions but the Desktop Edition ship with a command-line interface (CLI) tool.
bin/ directory, run the CLI with:
1 2 3 4 5 6 7 8 9
$ java -jar toro-integrate-cli-client.jar _____ ___ ___ ___ ___ _ _ |_ _/ _ \| _ \/ _ \ |_ _|_ _| |_ ___ __ _ _ _ __ _| |_ ___ | || (_) | / (_) | | || ' \ _/ -_) _` | '_/ _` | _/ -_) |_| \___/|_|_\\___/ |___|_||_\__\___\__, |_| \__,_|\__\___| |___/ :: CLI (v3.2.3) :: :: Type `help` to get started. > _
This launches a shell containing commands for managing TORO Integrate. To list available commands, type
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
> help AVAILABLE COMMANDS Authentication Commands connect: Connects to an integrate instance. Built-In Commands clear: Clear the shell screen. exit, quit: Exit the shell. help: Display help about available commands. script: Read and execute commands from a file. stacktrace: Display the full stacktrace of the last error. License Commands export-license: Exports the currently installed license in this machine to a file. import-license: Imports a license from the provided file. install-license: Installs a license to this machine. license: Prints the currently installed license. product-key: Prints the product key for the installation. sync-license: Syncs the currently installed license on this machine.
More commands available when you're logged in
The commands above are only a subset of all available commands. More commands can be executed after logging in via
Connecting to an instance
1 2 3
> connect --uri http://localhost:8080 --username firstname.lastname@example.org --password password Connected. http://localhost:8080 > _
When successful, the prompt changes to the URL of the instance you're currently connected to. You might also notice an increase in the number of executable commands:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
http://localhost:8080 > help AVAILABLE COMMANDS Authentication Commands connect: Connects to an integrate instance. disconnect: Disconnects from the integrate instance. whoami: Prints the current active user. Broker Commands list-destinations: Lists the available destinations in the broker. publish-file: Publishes the file to the given destination. publish-string: Publishes the value to the given destination. Built-In Commands clear: Clear the shell screen. exit, quit: Exit the shell. help: Display help about available commands. script: Read and execute commands from a file. stacktrace: Display the full stacktrace of the last error. Database Commands delete-database: Deletes a database list-databases: Lists the available databases. start-database: Starts a database. stop-database: Stops a database. Endpoint Commands delete-endpoint: Deletes an endpoint. disable-endpoint: Disables an endpoint. enable-endpoint: Enables an endpoint. list-endpoints: Lists the endpoints for a given package. start-endpoint: Starts an endpoint. stop-endpoint: Stops an endpoint. Package Commands create-package: Creates an empty package. delete-package: Deletes a package. deploy-package: Deploys a package to a target server. download-package: Downloads a package. list-packages: Lists the installed packages. start-package: Starts a package. stop-package: Stops a package. upload-packages: Uploads packages. Properties Commands delete-properties: Deletes properties that match the provided keys. export-properties: Exports the properties from the application into a file import-properties: Imports the properties from the provided file. list-properties: Lists the application properties. save-properties: Saves the provided properties to the application. Remote Server Commands find-server: Find a registered remote server by name. list-servers: List registered remote servers. register-server: Register a remote server for the current instance to take note of. unregister-server: Unregister a remote server. System Commands head: Prints the head of a log on a specified date logs: Download logs on a specified date, up to the present restart: Restarts the application. shutdown: Shuts down the application. tail: Prints the tail of a log on a specified date
Managing an instance
As of this writing, the CLI supports commands for managing the following features (type
Using the CLI tool to deploy packages
Integrate packages can be deployed between instances over different servers. This can be done via the CLI tool using
http://localhost:8080 > deploy-packages remote-server.site:8080 package-to-deploy --username email@example.com --password password --auto-start Deploying [package-to-deploy] to [remote-server.site:8080]... Deployed.
Displaying help text
To get hints on any command, just type
help followed by the intended command.
1 2 3 4 5 6 7 8 9 10 11 12 13
http://localhost:8080 > help start-package NAME start-package - Starts a package. SYNOPSYS start-package [--name] string OPTIONS --name string Name of the package to start. [Mandatory]
The CLI supports autocompletion. By typing
list- for example, the CLI will display matching commands
that start with
1 2 3 4 5 6 7
http://localhost:8080 > list- Available commands list-databases (Lists the available databases.) list-destinations (Lists the available destinations in the broker.) list-endpoints (Lists the endpoints for a given package.) list-packages (Lists the installed packages.) list-properties (Lists the application properties.)
You may press again to choose a command from the selection.
1 2 3 4 5 6 7
http://localhost:8080 > list-packages ┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━┓ ┃Name ┃Context Path ┃Status ┃Enabled┃Version ┃ ┣━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━╋━━━━━━━╋━━━━━━━╋━━━━━━━━━┫ ┃core ┃ ┃STARTED┃true ┃3.0-ALPHA┃ ┃examples ┃/examples-features ┃STARTED┃true ┃1 ┃ ┗━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━━━┛
When in doubt, press
The CLI aims to be as ergonomic as possible. For example, typing
http://localhost:8080 > stop-package --name core examples
Reverse search is a terminal feature that allows users to easily find and execute previously typed commands. You can do this with the CLI as well by pressing .
For example, by typing
co then pressing the CLI will suggest the previous command we
used to connect:
> connect --uri http://localhost:8080 --username firstname.lastname@example.org --password password bck-i-search: co_
You can press repeatedly to cycle through multiple matching commands.
All commands typed during the shell session are written to a log file named
under the same directory where the CLI was ran. This is reused by the tool for reverse searches. Make sure that the log file is not publicly accessible.
Automation is king! You can write scripts that contain a series of commands that need to be executed sequentially by the CLI.
For example, consider this script file named
stop-packages.esb, that stops a list of packages:
1 2 3 4 5 6
connect --uri http://localhost:8080 --username email@example.com --password password stop-package --name examples-messaging stop-package --name examples-reports stop-package --name examples-services list-packages exit
Passing that as arguments to the CLI in the form of:
$ java -jar toro-integrate-cli-client.jar @stop-packages.esb