Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Note

This page is under construction.

You need an interactive client CLI tool to start using the demo setup. Follow the steps mentioned below to be able to use the CLI tool:

...

export STRATOS_SC_HOST=192.168.92.10

export STRATOS_SC_PORT=9445

...

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
<<<Is the following code part of this point?>>>

Code Block
$ cd wso2s2cli-1.0.0

Add execute permission to the script.

...

Table of Contents

Getting started with CLI

Setup the CLI tool before attempting to use it. For more information please see Configuring the CLI Tool.

 

CLI modes

The CLI tool will be able to use in two different modes, which are namely the interactive mode and the single command line mode. In both modes the user must login to be able to execute commands successfully.


Interactive mode

  • Call stratos.sh to log-in to Stratos Controller using this mode:
    As mentioned previously, providing the password as an argument is optional. The CLI tool will prompt for the password.

    Code Block
    $ stratos.sh  -u <username> -p <password>

    Image Added
    Example:
    $ stratos.sh  -u admin@wso2.org   -p admin123

    The log-in help will be shown, if you have provided wrong parameters to log-in.
    As mentioned previously, the password is prompted only if the password argument is not passed.

  • Once you have successfully logged in, you can use the help command to get an idea of the various actions that can be carried out via the interactive command line shell interface named Stratos .

    Code Block
    stratos> help

    The output will appear as follows:

    Image Added

     

The interactive mode supports auto complete. By pressing the "Tab" key in the CLI tool it will list all the available command options.
Image Added

Single command line mode

  •  In this mode the user can execute commands in one line. 

    Code Block
    $ stratos.sh  -u admin@wso2.org  -p admin123 [action]

    You can call the command directly with action. It will not show the stratos> prompt and fulfill the request of command immediately for particular action command. This mode is useful for automating your interaction with Stratos2. 

  • In this mode the user can call the command as follows:

    Code Block
    $ stratos.sh -u [username] -p [password] [action commands]

    The user can export the username and password to the environment and execute commands.

    Image Added


  • The CLI Tool also returns exit codes, which will be useful for automation.
    The following screen displays an error; therefore, it does not return zero (0).
    Image Added
    The exit code will be 0 for successful commands.
    Image Added

     

CLI commands

To learn about all the available CLI commands, please see CLI Commands.