Skip to content

Configuration Tools for Martini Runtime

The Martini Command Line Interface (CLI) tool is an essential component designed to empower developers and system administrators with robust capabilities for managing Martini instances remotely. This powerful tool facilitates a wide range of operations, enabling users to interact with Martini environments efficiently and effectively without the need for a graphical interface.

Introduction to Martini CLI

At the core of Martini's design philosophy is the principle of flexibility, and the Martini CLI tool exemplifies this by offering a comprehensive suite of commands that cater to the diverse needs of modern IT environments. Whether you are deploying new integrations, monitoring system health, or managing configurations, the Martini CLI tool provides a unified interface that streamlines these tasks, enhancing productivity and operational efficiency.

Key Features

  • Remote Management: The CLI tool is engineered to enable remote management of Martini instances, allowing system administrators and developers to execute commands, modify configurations, and monitor system performance from any location.
  • Automation and Scripting: With its command-line nature, the Martini CLI tool is an ideal candidate for automation scripts, making it simpler to automate routine tasks and deploy consistent configurations across multiple instances.
  • Direct Access: Bypass the need for a graphical user interface (GUI) and interact directly with Martini's core functionalities, ensuring faster execution of commands and reduced system overhead.
  • Comprehensive Command Set: From basic system checks to intricate configuration updates, the CLI tool offers an extensive set of commands that cover virtually every aspect of Martini's operational capabilities.

Getting Started

Under the bin/ directory, run the CLI with:

1
    java -jar toro-martini-cli.jar

This will launch a shell containing commands for managing Martini. To list available commands, type help.

Note: The sample text below shows the Martini splash screen which appears when the CLI first launches.

 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
      __  __               _    _         _
 |  \/  |             | |  (_)       (_)  | \  / |  __ _  _ __ | |_  _  _ __   _
 | |\/| | / _` || '__|| __|| || '_ \ | |
 | |  | || (_| || |   | |_ | || | | || |
 |_|  |_| \__,_||_|    \__||_||_| |_||_|

 :: CLI (v1.3.0) ::
 :: Type `help` to get started.
 > help
AVAILABLE COMMANDS

Authentication Commands
        connect: Connects to a Martini instance.

Built-In Commands
        clear: Clear the shell screen.
        exit, quit: Exit the shell.
        help: Display help about available commands.
        history: Display or save the history of previously run 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 to this machine.
        install-license: Installs a license to this machine.
        license: Prints the currently installed license in this machine.
        product-key: Prints the product key for the installation in this machine.
        sync-license: Syncs the currently installed license in this machine.

More commands are available when you're logged in

The above commands represent just a portion of the entire command set. Additional commands become accessible once you log in using the connect command.

Connecting to an instance

Once you have installed your license, you can login to a Martini Instance using your credentials from the TORO Marketplace.

1
2
3
> connect --uri http://localhost:8080 --username username --password password
Connected.
http://localhost:8080 > _

After connecting successfully, the prompt changes to the URL of the instance you're connected to. Type help again to see the added 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
64
65
66
67
68
69
70
71
http://localhost:8080 > help
AVAILABLE COMMANDS

Authentication Commands
        connect: Connects to a Martini instance.
        disconnect: Disconnects from the Martini 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.

License Commands
        export-license: Exports the currently installed license in this machine to a file.
        import-license: Imports a license from the provided file to this machine.
        install-license: Installs a license to this machine.
        license: Prints the currently installed license in this machine.
        product-key: Prints the product key for the installation in this machine.
        sync-license: Syncs the currently installed license in this machine.

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

Displaying help text

If you are lost on the commands and wondering whats the purpose or options included with the command, you can use the help command 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]

Command Autocompletion

The CLI tool supports autocompletion. For example, if you type list-, the CLI will display all the commands that start list:

1
2
3
4
5
6
7
8
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.)
list-servers                      (List registered remote servers.)

To choose from the given commands that start with list, you can press again to scroll through the available commands and press enter to choose.

1
2
3
4
5
6
7
8
9
http://localhost:8080 > list-endpoints --package core
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃Name              Type   ┃Status ┃Enabled┃Service                            ┃
┣━━━━━━━━━━━━━━━╋━━━━━━━━━━╋━━━━━━━╋━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃resource-sample┃scheduler ┃STARTED┃ true  ┃bean:resourceUsageService/public   ┃
┃r                                      ┃void                               ┃
┃                                       ┃io.toro.martini.vmstats.ResourceUsa┃
┃                                       ┃geService.takeSample()             ┃
┗━━━━━━━━━━━━━━━┻━━━━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

This is a feature in the CLI tool that allows users to find previously executed commands from the session. You can do this by pressing . For example, if you type li then pressing the CLI will suggest the previous command that we used to list the packages.

1
2
http://localhost:8080 > list-packages
bck-i-search: li_

Saved logs

All commands typed during the session are written to a log file named toro-martini-cli.log. This is reused by the tool to do reverse searches. Make sure that the log file is not accessible to the public.

Scripting with CLI tool

With the help of CLI, you can automate your commands by using a script to run in the CLI tool of Martini. For example, with this script named stop-packages, it stops a list of packages written inside the script. To run this script using the CLI tool, you can use the command:

1
java -jar toro-martini-cli.jar @stop-packages.esb

Designed for Professionals

Understanding the critical role that CLI tools play in system administration and development, the Martini CLI tool is tailored to meet the demands of professionals who value efficiency, precision, and reliability. The tool's intuitive syntax and structured command hierarchy make it accessible to newcomers while offering the depth and flexibility that seasoned users expect.

Seamless Integration

The CLI tool is seamlessly integrated with Martini, ensuring that users have consistent and up-to-date access to all features and functionalities of the platform. This integration fosters a cohesive ecosystem where changes made via the CLI are reflected across the platform, maintaining system integrity and synchronicity.