1. Home
  2. FlexRule Server
  3. Utilities
  4. CLI Commands for FlexRule Server Configuration

CLI Commands for FlexRule Server Configuration

◷ Reading Time: 8 minutes

This page is under construction ?

Running the CLI commands requires FlexRule Server installation. Once you have installed the server,

  1. Run Command Prompt as administrator and navigate to the Master/ Agent folder.
    cd <Master/ Agent folder location>
  2. Run the configuration commands.

To run any configuration command requires a config file in the server installation location.

Therefore, you must first run the new config file command to create a file if there is no config file and then run the other configuration commands.

New config file

Create a new configuration file for FlexRule Server.

 FRS.exe config --new [master | agent] 
  • –new: The node that you want to update (master/ agent)

Examples

Master:

FRS.exe config --new master

Agent:

FRS.exe config --new agent

Runtime license and Runtime folder

Set the Runtime license file path and Runtime folder path.

FRS.exe config --execute --runtime [master|agent] --license [license path] --folder [runtime folder] 
  • –runtime: The node that you want to update (master/ agent)
  • –license: Runtime license path. This is the flexrule.license.lic file that needs to be downloaded from FlexRule user profile.
  • –folder: Runtime folder path

Examples

Master:

FRS.exe config --execute --runtime master --license "C:\Users\Subhashi\Documents.flexrule\flexrule.license.lic" --folder "C:\Users\Subhashi\Documents.flexrule\9.0.107"

Agent:

FRS.exe config --execute --runtime agent --license "C:\Users\Subhashi\Documents.flexrule\flexrule.license.lic" --folder "C:\Users\Subhashi\Documents.flexrule\9.0.107"

API Address

Set the address to call the Master/ Agent node.

 FRS.exe config [--agent | --master] --host IP:PORT
  • –agent | –master: The node that you want to update (master/ agent)
  • host: The IP and the port of the address you want to set as the node address. This address must specify the protocol (http:// or https://)

Example

Master:

FRS.exe config --master --host http://localhost:9000

Agent:

FRS.exe config --agent --host http://localhost:9500

Master node address in the agent configuration

When there is an agent node, set the master node address in the agent configuration. Therefore, this command is not applicable to the Master node.

FRS.exe config --agent --masterAddress IP:PORT
  • –agent: This is a mandatory command.
  • –masterAddress: The IP and the port of the master node address. This address must specify the protocol (http:// or https://).
    You can find this value from the Master configuration file (FlexRule.Server.Master.dll.config), under the tag MasterAddress.

Example

Master: N/A

Agent:

 FRS.exe config --agent --masterAddress "http://localhost:9000"

Workbench

Set the workbench address. This command is applicable to the Master node only.

FRS.exe config --workbench [true|false] --host IP:PORT
  • –workbench: State whether you want to set a workbench (true/ false)
  • –host: The IP and the port of the address you want to set as the node address. This address must specify the protocol (http:// or https://)

Examples

Master:

FRS.exe config --workbench true --host "http://localhost:9010"

Agent: N/A

Error log file

Set error log file path.

FRS.exe config --error --file [log file path] --eventLog
  • –error: This is a mandatory command.
  • –file: Define the path including the file you want to write logs. You can define any file for this.
  • –eventLog: Write to the windows system event log.

Examples

Master:

FRS.exe config --error --file "D:\Program Files (x86)\master.log" --eventLog

Agent:

FRS.exe config --error --file "D:\Program Files (x86)\agent.txt" --eventLog 

Security keys

Set the security keys. All the keys should be 32 characters long.

masterEncryption is required only for the Master node.

sharedSecret and authSignKey of the Master and Agent nodes should be the same allowing them to communicate with each other.

FRS.exe config --security [--masterEncryption [encryptionValue]] [--sharedSecret [secretValue]] [--authSignKey [authValue]]
  • –security: This is a mandatory command.
  • –masterEncryption: Master encryption key
  • –sharedSecret: Shareed secret
  • –authSignKey: Authentication key

Examples

Master:

FRS.exe config --security --masterEncryption "rtfeWvGee4t3UR3CE@km3RE8ey7rq87N" --sharedSecret "abcdWvGee4t3UR3CE@km3RE8ey7rq87N" --authSignKey "1234WvGee4t3UR3CE@km3RE8ey7rq87N"

Agent:

FRS.exe config --security  --sharedSecret "abcdWvGee4t3UR3CE@km3RE8ey7rq87N" --authSignKey "1234WvGee4t3UR3CE@km3RE8ey7rq87N"

Database

Database configuration

Set the database settings of the FlexRule Server. There should be only one database for both Master and Agent.

FRS.exe config --database --dbtype [ pgsql | mssql ] --server [serverValue] --name [dbName]  --user [userValue] --password [passwordValue] --integrated --azure --encrypt --trustCert --timeout [timeoutValue] --port [portValue]
  • –database: This is a mandatory command
  • –server: Database server address
  • –name: Database name
  • –user: Username to connect to the database
  • –password: Password to connect to the database
  • –integrated: Option to use Windows Authentication (Integrated Security)
  • –azure: Option to use MS SQL Azure database
  • –encrypt: Option to state encryption
  • –trustCert: State whether you have Trust Server Certificate
  • –timeout: State timeout period
  • –port: State the port

Example

Master/ Agent:

FRS.exe config --database --dbtype mssql --server "FLEXRULE-02\SQLEXPRESS02" --name "frdb9096" --user "testUser" --password "testPw" --encrypt --trustCert --timeout 30 --integrated --azure "test" --port 2500

Database migration

When there is an existing database, you can migrate the database.

FRS.exe database --migrate [refresh|new]
  • –migrate: State whether you want to refresh or create new. Refresh deletes the data in the database while new creates a new version of the database

Example

Master/ Agent:

FRS.exe database --migrate new

Create database

Create or update the database for Master and Agent. This command does not have any user-defined arguments. It will use the database configuration you configured and create the database accordingly.

This will create the following default user and application accounts along with the roles.

  • Roles: Administrator and Application
  • User: Admin
  • Application: App1
  • Default password: FlexRuleServer

The same command is used for both master and agent.

FRS.exe database --create default

Example

Master/ Agent:

FRS.exe database --create default

Application or User Accounts

Create user or application accounts.

FRS.exe account --type [app|user] --name [name of account] --pw [VALUE]
  • –type: The type of the account (user/ app)
  • –name: Name of the account. This is the username or app name of the account
  • –pw: password of the account

Example

FRS.exe account --type user --name TestUser --pw O45&kd@d

Updated on May 6, 2022

Was this article helpful?

Related Articles