2. Command Line Interface (CLI)

The CLI has commands to:

  • create a new node inside the cluster

  • export and import job definitions (deployment descriptors)

  • import queues

  • import cluster configuration

  • create a new execution request

  • get the status of an execution request

  • create or reset user accounts, including root

  • apply a configuration template to a node

  • enable or disable web APIs, using TLS or not

  • update the database

To get all details, use java -jar jqm.jar -h (or --help).

The most useful options are exposed in a more user friendly way with the script jqm.sh (or jqm.ps1 under Windows).

Warning

a few options exist which are not listed here. They are internal and are not part the API (may change without notice, etc).

Note

Common options available for all commands:

  • -s, --settings: Path (inside JQM_ROOT/conf/) to JQM properties file. Default is resources.xml.

  • -h, --help, /?, -?: Display command help.

2.1. Common usage examples

2.1.1. Node management

# Create a new node with custom port and interface
java -jar jqm.jar New-Node -n node01 -p 1789 -i 0.0.0.0

# Get how many nodes are declared inside the central configuration
java -jar jqm.jar Get-NodeCount

# Start a node
java -jar jqm.jar Start-Node -n node01

# Copy configuration from one node to another
java -jar jqm.jar Install-NodeTemplate -t template-node -n node02

2.1.2. Job definitions

# Import a single job definition
java -jar jqm.jar Import-JobDef -f job-definitions.xml

# Import multiple files
java -jar jqm.jar Import-JobDef -f job1.xml -f job2.xml -f job3.xml

# Import all XML files from a directory
java -jar jqm.jar Import-JobDef -f /path/to/job-definitions/

# Export all job definitions for backup
java -jar jqm.jar Export-JobDef -f backup-$(date +%Y%m%d).xml

2.1.3. Queue management

# Import queue mappings
java -jar jqm.jar Import-Queue -f queue-mappings.xml

# Export queues for backup
java -jar jqm.jar Export-Queue -f queues-backup.xml

2.1.4. Cluster configuration

# Import cluster infrastructure configuration
java -jar jqm.jar Import-ClusterConfiguration -f cluster-config.xml

2.1.5. Job execution

# Create a new job execution request
java -jar jqm.jar New-Ji -a DemoEcho

# Check job status
java -jar jqm.jar Get-JiStatus -i 12345

2.1.6. User management

# Reset root password
java -jar jqm.jar Reset-Root -p SuperPassword

# Create a user with a single role
java -jar jqm.jar Reset-User -l root -p test -r administrator

# Create a user with multiple roles
java -jar jqm.jar Reset-User -l root -p test -r administrator -r client

# Fetch all roles defined in central configuration
java -jar jqm.jar Get-Role

2.1.7. Web configuration

# Enable HTTP web GUI
java -jar jqm.jar Set-WebConfiguration -c ENABLE_HTTP_GUI

# Enable TLS/HTTPS
java -jar jqm.jar Set-WebConfiguration -c ENABLE_TLS

# Disable all web services
java -jar jqm.jar Set-WebConfiguration -c DISABLE_ALL

2.1.8. Database management

# Updates the database schema
java -jar jqm.jar Update-Schema

# Test if the database schema is up to date
java -jar jqm.jar Test-Schema

# Displays the database schema SQL commands needed to make it up to date
java -jar jqm.jar Get-SchemaSql

2.1.9. General commands

# Fetch the version of the command line tool
java -jar jqm.jar Get-Version