batchManager command-line client utility
The batchManager command-line client utility provides a command-line interface for managing your batch jobs that run on Liberty.
The batchManager command-line client utility interacts with the batch manager over the batch manager's REST API. To use the batchManager command-line client utility, the batch manager must be running on your Liberty server. Use the batch management feature to install and enable the Liberty batch manager.
SSL configuration
The batchManager command-line client utility communicates with the batch manager over an SSL connection. To facilitate SSL communication with a batch manager that is running on a Liberty server, the utility must be able to verify the SSL certificate of the Liberty server.
If the SSL certificate is signed by a well-known certificate authority (CA), the utility can verify the certificate by the CA. No further configuration is necessary.
- Specify the option --trustSslCertificates, which configures the utility to trust all SSL certificates.
- Include the server's SSL certificate in the utility's truststore.
If you choose to specify the option --trustSslCertificates, the utility trusts all SSL certificates that it receives and no further configuration is necessary.
If you choose the option to include the server's SSL certificate in the utility's truststore, then you must also configure the utility so that it can find its truststore. The utility is a stand-alone Java main. You configure SSL by using system properties such as javax.net.ssl.truststore.
$ export JVM_ARGS="-Djavax.net.ssl.trustStore=/path/to/server/keystore.jks"
$ batchManager submit ...
$ keytool -export -alias default -file server.crt -keystore [server-dir]/resources/security/key.jks -storepass Liberty
$ keytool -import -alias server_crt -file server.crt -keystore /path/to/truststore.jks -storepass passw0rd
$ export JVM_ARGS="-Djavax.net.ssl.trustStore=/path/to/truststore.jks"
$ batchManager submit ...
Commands and usage
The batchManager command-line client utility provides commands for submitting, stopping, restarting, and checking the status of jobs.
To generally use the utility:
$ batchManager [command] [options]
To see a list of available commands:
$ batchManager help
To see the description and options for a specific command:
$ batchManager help [command]
The following example illustrates how to submit a job and wait for its completion:
$ batchManager submit \
--batchManager=<host>:<port>
--user=[credentials for logging into the batch manager]
--password=[credentials for logging into the batch manager]
--applicationName=[application name used when packaging the batch app]
--jobXMLName=[job XML file basename in the app's batch-jobs dir]
--wait
jobParametersFile and jobPropertiesFile
jobParametersFile=filePath1,filePath2,filePath3
jobPropertiesFile=filePath1,filePath2,filePath3
As an example, --jobParametersFile=<filepath1> would override
--jobParametersFile=<filepath1>,<filepath2> in the control properties file.
The resulting parameter is --jobParametersFile=<filepath1>. Return codes
Code | Description |
---|---|
0 | The task completed normally. |
20 | A required argument was not specified. |
21 | An unrecognized argument was specified. |
22 | An invalid argument value was specified. |
255 | An unknown error occurred. |
Code | Description |
---|---|
33 | The job stopped. |
34 | The job did not complete successfully. |
35 | The job completed successfully. |
36 | The job was abandoned. |