Flux provides a robust interface accessible through the command line, but it is an often overlooked feature. This article will break down the various command and abilities available to the user using a command line. The command line has five different subsections that will be discussed here: agent-client, agent-server, server, agent, and encryptedpassword.
Basic Syntax
Nearly all tasks accomplished from the command line using Flux begin with the same root syntax as noted below.
java –cp .;flux.jar{additional jars} flux.Main {sub section} {options} {method}
Each subsection contains its own help listing by appending
"--help" to the command. For example, to view the help information for servers, use the command
java –cp .;flux.jar flux.Main server --help
Agent-Server
The agent-server subsection on the command line deals with the creation of a new agent. With no options specified, the command will use all the defaults.
The following configuration options are available for use with the agent-server:
- -registryport {port number} - The port number the agent should be bound to in the RMI directory. This defaults to 1099.
- -registrybindname {name} - The name the agent should be stored in the RMI directory. This defaults to FluxAgent.
- -engineregistryport {port number} - The RMI port number for the engine you are attempt to create an agent for. This defaults to 1099
- -enginehostname {IP/hostname} - The hostname or IP address for the engine that you are trying to establish an agent for. This defaults to localhost.
- -pool {pool name} - The name of the agent pool you want to add the agent to. There is no default
- -configurationfile {path to file} - The filepath to the configuration file you want to use when creating this agent. With a properly constructed configuration file, no other options need to be specified. Information about configuration options can beThere is no default.
- -engineusername {username} - Username to log in to the Flux engine with. This is required if you are attempting to add an agent a secure Flux server. This has no default
- -enginepassword {password} - The password used to log in to a secured Flux engine. If security is enabled, either this or encryptedenginepassword is required. This has no default
- -encryptedenginepassword {encrypted password} - The password, that was encrypted by Flux’s password encrypting program, used for logging in to a Flux engine. If security is enables, either this or enginepassword is required. There is no default // Only one method is available for use, the start method is available for use.
Example usage:
java -cp .;flux.jar flux.Main agent-server -configurationfile /flux-7-x-y/config/agent-config.fec start
Agent-Client
The agent-client subsection allows the user to send commands to an already created agent. It requires the user provide only a method to invoke on the agent, but the following configuration options are available. If no options are specified, the defaults will be used.
- -registryport {port number} - The port number the agent should be bound to in the RMI directory. This defaults to 1099.
- -registrybindname {name} - The name the agent should be stored in the RMI directory. This defaults to FluxAgent.
- -engineregistryport {port number} - The RMI port number for the engine you are attempt to create an agent for. This defaults to 1099
- -enginehostname {IP/hostname} - The hostname or IP address for the engine that you are trying to establish an agent for. This defaults to localhost.
- -pool {pool name} - The name of the agent pool you want to add the agent to. There is no default
- -configurationfile {path to file} - The filepath to the configuration file you want to use when creating this agent. With a properly constructed configuration file, no other options need to be specified. There is no default.
- -engineusername {username} - Username to log in to the Flux engine with. This is required if you are attempting to add an agent a secure Flux server. This has no default
- -enginepassword {password} - The password used to log in to a secured Flux engine. If security is enabled, either this or encryptedenginepassword is required. This has no default
- -encryptedenginepassword {encrypted password} - The password, that was encrypted by Flux's password encrypting program, used for logging in to a Flux engine. If security is enables, either this or enginepassword is required. There is no default
The agent-client subsection has the following methods available for use:
- start - Starts an Agent instance. Ex: java -cp .;flux.jar flux.Main agent-client -enginehostname comp1 -engineusername myUser -enginepassword myPassword start This starts an agent instance for the secured engine running on comp1.
- stop - Stops the specified agent instance. Ex: java -cp .;flux.jar flux.Main agent-client -configuration c:/flux-7-4-1/agentconfig.fec stop This stops an agent based on the information stored in the c:/flux-7-4-1/agentconfig.fec file.
- interrupt - This sends the interrupt signal to whatever work is currently running on the agent. Ex: java -cp .;flux.jar flux.Main agent-client -encryptedenginepassword 6vQZjh4KhTw= -engineusername admin interrupt This interrupts the engine running on localhost host will all the default settings.
The engine is secured with the username admin and userpassword encrypted. Mastering creating agents from the command line will allow Flux to be deployed within your system with much more versatility.
Client
The client sub-section of the command line deals with directly manipulating a running Flux engine. It is able to perform many tasks that are normally available only through the web application or designer; such as adding jobs, expediting tasks (firing a manual trigger), as well as receiving general information on the state of flow charts running on your engine.
The following optional configuration options are available when invoking a client command:
- -host {IP/hostname} - The host which is currently running the Flux engine you are trying to establish a connection to. Defaults to localhost
- -registrypost {port} - The port which the Flux engine is registered to in the RMI directory. Defaults to 1099.
- -serverhost {host} - The hostname that the Flux engine is bound is in the RMI registry. Defaults to Flux.
- -cp {path to file} - The path to the configuration file for your fluxEngine. This can replace any other configuration option.
- -username {username} - The username of a user within the system that has proper permissions to perform operations on flowcharts. Required when dealing with a secured engine.
- -password {password} - Password for the user. Required when attempting to negotiate with a secured engine.
- -encryptedpassword {password} - If your password was encrypted using the Flux password encrypted (see the "encrypt-password" section of this article).
Being that this subsection deals directly with managing jobs and an engine, there a many methods available to invoke.
- start - Permits the engine to begin firing jobs. Ex. java -cp .;flux.jar flux.Main client -host localhost -username admin -password admin start
- stop - Stops the engine from proceeding with any work. The engine will still remain in the rmi port until disposed of. Ex. java -cp .;flux.jar flux.Main client -cp c:\flux-x-y-z\config\engine_conf.fec stop
- isrunning - Reports whether or not an engine is running given the information specified. Ex. java -cp .;flux.jar flux.Main client -host indigo isrunning
- size {namespace} - Reports how many jobs are in the specified namespace Ex. java -cp .;flux.jar flux.Main client -username administrator -encryptedpassword 6vQZjh4KhTw= size /
- expedite {namespace} - Expedites (fires all manual triggers currently pending) all flowcharts in the given namespace. Ex. java -cp .;flux.jar flux.Main client -host comp2 -registryport 1098 expedite /unix/
- resume {namespace} - Resumes all flowcharts in the given namespace Ex. java -cp .;flux.jar flux.Main client -host myhost -servername myflux -registryport 1111 resume /
- pause {namespace} - Pauses all flowcharts in the given namespace Ex. java -cp .;flux.jar flux.Main client pause /heavy/
- remove {namespace} - Removes all flowcharts in the given namespace. Ex. java -cp .;flux.jar flux.Main client -encryptedpassword 9vPZjh4KhTw=
- interrupt {namespace} - Sends the interrupt signal to all flowcharts currently running in the given namespace Ex. java -cp.;flux.jar flux.Main client interrupt /
- export {job file} - Exports the given job to the engine specified in the configuration options. Ex. java -cp .;flux.jar flux.main client export thisflowchart.fcch4. Server
The server subsection of the command line interface deals directly with the creation of a Flux engine, and is therefore contains many of the most frequently invoked commands. Most of the configuration options for an engine are provided in a configuration file, so the options specified at the command line are fairly limited. Refer below for a comprehensive list.
- -registryport {port} - Specifies the port the engine is bound to in the RMI registry.
- -servername {server} - Name that the engine will bind to in the RMI registry.
- -cp {path to file} - The configuration file for the engine. Inside the file the bulk of the engine’s configuration options will be set. This includes, but is not limited to, database settings, security settings, and rmi settings.
- -cx {path to file} - This specifies a configuration file for the engine that is written in XML format.
- -username {username} - The username used to log in to the engine. This is required if security is enabled.
- -password {password} - The password used in conjunction with the username to log in to the engine. This is required is security is enabled.
- -encryptedpassword {password} - If you encrypted your password using the encryptpassword subsection of the command line interface, you will need to use this configuration option to pass it in. This is required if you are using security and want to obscure your password.
Only the start method is available when using the server subsection. An example follows:
java -cp .;flux.jar;jdbc_driver.jar;lib/otherjars.jar flux.Main server -cp config/my-config.fec -username admin -password -admin start
EncryptedPassword
Flux provides a command line tool to encrypt your passwords so anyone with access to the machine will not easily be able to discover the Flux admin's password. It is simple to use, as it requires only one piece of information, your password, on the command line and outputs an encrypted password suitable to be passed into the -encryptedpassword argument for any of the other command line subsections. Use the example below as a blueprint for how to make your own.
java -cp .;flux.jar flux.Main encryptpassword password
And after some number crunching, the following should be output for your use:
Encrypted password is e71iWuZK0qBPn8TowvLYfg==