Configuring CLI Tool
The Command Line Interface (CLI) can be used by administrators to carry out a host of actions (e.g., create a tenant, deploy a partition, deploy a cartridge, and more.)
To configure the CLI tool
- Extract the CLI tool from the following ZIP file to the home directory or a place of your choice.
org.apache.stratos.cli-4.0.0-wso2v1.zip
Export the host and port of Stratos Manager (SM) as environment variables in your
bashrc
file before using the CLI tool.
For example:export STRATOS_URL=https://sample_stratos_manager.com:9443
Export the following environment variables by adding them into your
bashrc
file:export JAVA_HOME=/opt/jdk1.6.0_24/ export PATH=$JAVA_HOME/bin:$PATH
Navigate to theÂ
org.apache.stratos.cli-4.0.0-wso2v1
 folder.
cd org.apache.stratos.cli-4.0.0-wso2v1
Add execute permission to the script.
chmod +x ./stratos.sh
Optionally, you can export your username and password as environment variables.
If you only export your username, you will be prompted to enter your password.export STRATOS_USERNAME=<username> export STRATOS_PASSWORD=<password>
Log into the CLI tool using the following command:
Command Scenario ./stratos.sh -u admin -p admin
If you have not exported your username and password. ./stratos.sh -p admin
If you have only exported your username. ./stratos.sh
If you have exported your username and password or if you wish to be prompted for your username and password later. For more information on how to use the CLI tool, see the CLI Tool Guide.