Skip to content
Thiago da Rosa de Bustamante edited this page Mar 27, 2018 · 16 revisions

The command line tool uses the Node.js SDK to allow gateway management through command line scripts.

First of all, ensure that you have already installed the gateway and have an instance running:

$ npm install -g tree-gateway
$ treeGateway

The CLI tool will connect to that instance to execute all configuration commands. To do it, you need to inform tha path to the tree-gateway.yaml configuration file. You can do this by passing the paramenter -c (or --config) to the CLI:

$ treeGatewayConfig -c ./tree-gateway.yaml

If you don't provide this parameter, the CLI will try to find the file tree-gateway.yaml under the folder where you are executing the command.

Whe can use the CLI to create an user to be used to access the REST API. Here's a sample:

$ treeGatewayConfig users add -l sampleuserlogin -p sampleuserpassword -n sampleusername -r admin config

In the previous case, we created the user named "sampleusername" with two roles: "admin" and "config".

You also can configure other the gateway functionalities using the CLI tool. To see all the available options check the program help:

$ treeGatewayConfig -h

Note that you can provide for all commands available the following option:

  • -c (or --config): the gateway config file.

The program allow you to configure:

  • the gateway;
  • middlewares;
  • apis;
  • users for the REST Apis
  • import / export gateway configurations

If you need help for a specific command, just type:

$ treeGatewayConfig <command> -h

Example:

$ treeGatewayConfig apis -h

This will show the list with descriptions of all operations supported by apis command.

Another helpfull command is to reload the Gateway properties. You can do this by the following command:

$ treeGatewayConfig gateway --update ./myGateway.config.json
Clone this wiki locally