Stratos comes with a Command Line Interface (CLI) tool that provides you an interface to manage your applications in Stratos. You can run each command to carryout a range of actions in Stratos. To learn about all the available CLI commands, see the CLI Guide.

The CLI tool can be operated in two modes:

  • Interactive mode
    This CLI mode allows a human to execute commands against the Stratos Manager. For more information, see Interactive mode
     
  • Single command line mode
    This CLI mode allows a computer to execute a command script. For more information, see Single command line mode.

You need to configure the CLI tool and log into the Stratos Manager via the CLI to be able to use the CLI tool.

Interactive mode

  • Log in
    To log in by entering the following command. (In the interactive mode if you do not enter the username and password, the CLI tool will prompt you for it.)

    ./stratos.sh

    For example:

    James:bin jameswest$ ./stratos.sh
    Username: admin
    Password: *****
    Successfully authenticated

     

    For example:

     

    Username: admin
    Password: admin

     If you have provided any wrong login parameters, the login help will appear.
     

  • Help
    To get help, enter the following command:
    stratos> help
    The CLI usage appears:
     usage: stratos [-debug] [-h] [-p <password>] [-trace] [-u <username>]
     -debug                     Enable debug logging
     -h,--help                  Display this help
     -p,--password <password>   Password
     -trace                     Enable trace logging
     -u,--username <username>   Username
    
    Available Commands: 
    activate-tenant                     Activate tenant
    add-application                     Add application sign up
    add-autoscaling-policy              Add autoscaling policy deployment
    add-cartridge                       Add cartridge deployment
    add-cartridge-group                 Add cartridge group
    add-deployment-policy               Add deployment policy deployment
    add-domain-mappings                 Add domain mappings
    add-kubernetes-cluster              Add kubernetes cluster
    add-kubernetes-host                 Add kubernetes host
    add-network-partition               Add network partition deployment
    add-tenant                          Add new tenant
    add-user                            Add new user
    create-application                  Create an application using cartridge groups/cartridges.
    deactivate-tenant                   Deactivate tenant
    deploy-application                  deploy application
    describe-application                Describe application
    describe-application-runtime        Describe application runtime
    describe-application-signup         Describe application sign up
    describe-autoscaling-policy         Describing the autoscaling policy
    describe-cartridge                  Describing the cartridge
    describe-cartridge-group            Describe cartridge groups
    describe-deployment-policy          Describing the deployment Policy
    describe-kubernetes-cluster         Describing a kubernetes cluster
    describe-kubernetes-master          Describing the Kubernetes master
    describe-network-partition          Describing the network partition
    describe-tenant                     Describing the tenant
    exit                                Exit from stratos client tool
    help                                Help for commands
    list-applications                   List available applications
    list-autoscaling-policies           List available autoscaling policies
    list-cartridge-groups               List available cartridge groups
    list-cartridges                     List available cartridges
    list-cartridges-by-filter           List cartridges by a filter
    list-deployment-policies            List available deployment policies
    list-domain-mappings                List domain mappings
    list-kubernetes-clusters            List kubernetes clusters
    list-kubernetes-hosts               List kubernetes hosts
    list-network-partitions             List available network partitions
    list-tenants                        List available tenants
    list-tenants-by-partial-domain      List cartridges by partial domain search
    list-users                          List available users
    remove-application                  Remove Application
    remove-application-signup           Remove Application Signup
    remove-autoscaling-policy           Remove Auto-Scaling policy
    remove-cartridge                    Remove cartridge definition
    remove-cartridge-group              Remove cartridge group
    remove-deployment-policy            Remove Deployment policy
    remove-domain-mappings              Remove domain mappings
    remove-kubernetes-cluster           Remove kubernetes cluster
    remove-kubernetes-host              Remove kubernetes host
    remove-network-partition            Remove network partition definition
    remove-user                         Remove User
    synchronize-artifacts               Synchronize artifacts with Git repository for cartridge subscriptions
    undeploy-application                Undeploy application
    update-autoscaling-policy           Update autoscaling policy
    update-cartridge                    Update cartridge deployment
    update-deployment-policy            Update deployment policy
    update-kubernetes-host              Update kubernetes host
    update-kubernetes-master            Update kubernetes master
    update-network-partition            Update network partition deployment
    update-tenant                       Update an existing tenant
    update-user                         Update an existing user
    
    
    For help on a specific command type:
    help [command]
    
    
     
     
  • Auto complete
    The interactive CLI mode supports auto complete. Press the Tab key in the CLI tool to list all the available command options.

    activate-tenant                  add-application                  add-autoscaling-policy           add-cartridge                    add-cartridge-group              
    add-deployment-policy            add-domain-mappings              add-kubernetes-cluster           add-kubernetes-host              add-network-partition            
    add-tenant                       add-user                         create-application               deactivate-tenant                deploy-application               
    describe-application             describe-application-runtime     describe-application-signup      describe-autoscaling-policy      describe-cartridge               
    describe-cartridge-group         describe-deployment-policy       describe-kubernetes-cluster      describe-kubernetes-master       describe-network-partition       
    describe-tenant                  exit                             help                             list-applications                list-autoscaling-policies        
    list-cartridge-groups            list-cartridges                  list-cartridges-by-filter        list-deployment-policies         list-domain-mappings             
    list-kubernetes-clusters         list-kubernetes-hosts            list-network-partitions          list-tenants                     list-tenants-by-partial-domain   
    list-users                       remove-application               remove-application-signup        remove-autoscaling-policy        remove-cartridge                 
    remove-cartridge-group           remove-deployment-policy         remove-domain-mappings           remove-kubernetes-cluster        remove-kubernetes-host           
    remove-network-partition         remove-user                      synchronize-artifacts            undeploy-application             update-autoscaling-policy        
    update-cartridge                 update-deployment-policy         update-kubernetes-host           update-kubernetes-master         update-network-partition         
    update-tenant                    update-user 

Single command line mode

You can use the single command line mode in CLI to execute commands in one line and directly call the required action as follows. If required, you can export your username and password to the environment, and execute commands.

./stratos.sh -u [username] -p [password] [action commands]

For example:

James:bin jameswest$ ./stratos.sh -u admin -p admin list-cartridges
Cartridges found:
+------+----------+------+---------------+---------+--------------+
| Type | Category | Name | Description   | Version | Multi-Tenant |
+------+----------+------+---------------+---------+--------------+
| php  | data     | php  | php Cartridge | 7       | false        |
+------+----------+------+---------------+---------+--------------+

  • No labels