Command Line Interface (CLI)
GigaSpaces provides a CLI tool for administering both XAP and InsightEdge. The CLI is based on the REST Manager API, enabling users to administer local, remote, and cloud-based application environments. In addition to the REST Manager API operations, the CLI supports certain administration tasks in the open source application editions.
Users that are administering a XAP environment should use the
xap script. Users that are administering InsightEdge should use the
insightedge CLI script, which contains all of the actions available with the
xap script, plus additional options where relevant for administering InsightEdge components.
The image below shows the screen that is displayed when you run the
--help command (or
-h) to see the syntax of a specified CLI command, or a list of all available commands. The list of commands may vary depending on whether you are running the XAP or the InsightEdge script. For example,
the list of commands for
insightedge host run-agent --help contains all the actions available under
xap host run-agent --help, plus additional options for administering the Spark master and worker components.
The CLI connects to the REST Manager API using the name or IP address of the Manager server. Configuration is applied from one of the following:
- The first server configured in the
- The server configured using
--servercommand line option.
localhostas the server to connect to (if none of the above was applied).
Enter ctrl-D to exit the interactive shell.
Bash completion in the CLI is available for Linux and MacOS X users. After activating the autocomplete feature (as explained below), navigate to
<XAP-HOME>/bin and type
xap [TAB][TAB] or
insightedge [TAB][TAB]. This will complete the command sequence, or list all the available completions if there are multiple options.
If you are using the CLI in a MacOS X environment, the autocomplete script will only work if bash version 4 is installed on your machine. After installing the required bash version, add the shell to the allowed shells and make it the default shell.
When using autocomplete, type
./xap [TAB][TAB] or
You can add xap as an alias to the
.bash_profile, in order to simplify using autocomplete.
The autocomplete script is located in
<XAP-HOME>/tools/cli. There are two ways to install autocomplete.
- Go to
<XAP-HOME>/tools/cliand source the completion script:
- Go to
When you leave the bash session, autocomplete stops working.
- Place the
insightedge-autocompletefile in a
bash_completion.dfolder. The folder may appear in the following locations:
~/bash_completion.d(create one if absent).
- (MacOS X users only) Edit the
~/.bash_profileand add the following code:
- (MacOS X users only) Reload the bash shell or open a new terminal
- After installing the script, open a new bash console.
- Go to
- If you export the xap or insightedge classpath, autocomplete will work from any directory. If you don't export the classpath, autocomplete works only from the bin directory.
- You can add a bash alias, for example:
alias xap = "cd <XAP-HOME>/bin && xap"
If you want to generate a new autocomplete script (for example, if you changed the name of the xap or insightedge script) do so as follows:
<XAP-HOME>/tools/cli and run the following command:
java -cp "../../lib/required/*:*" MAIN_COMMAND ALIAS
MAIN_COMMAND value is different for each product and edition. Use one of the following:
- XAP open source -
- XAP Enterprise -
- Insightedge open source -
- Insightedge Enterprise -
ALIAS is optional; use it if you changed the name of the command.
java -cp "../../lib/required/*:*" MAIN_COMMAND ALIAS, the autocomplete script will appear in
To run a local Manager server and a web browser client, type
xap host run-agent --auto or
insightedge host run-agent --auto.
To view a list of the running agents, type
xap host list or
insightedge host list.
If you've recently upgraded to version 12.3 or higher, note that this is a new version of the CLI tool and uses a different syntax and command set. We encourage using this new version, but if you need information about the old CLI commands, refer to the GigaSpaces CLI pages in the Legacy Tools section.