CLI-Suite (root360)

Component description

The CLI-Suite facilitates daily work with Platform via the command line and helps with individual automations. Examples of CLI commands are the overview of currently running EC2 instances, backup of MySQL databases or clearing the Varnish cache and AWS Cloudfront. A special add-on to the CLI-Suite is dedicated to containers. Thus, the tools simplify the handling of cloud environments by simple CLI commands.

Scope of the cloud management CLI-suite

The cloud management CLI-suite “r3” is only available on the Bastion Host/Jump-Server of your environment. It is not available on other instances like Web-Servers. Other independently provided tools may be available on other kinds of systems, but are out of scope.

CLI-suite's purpose is:

  • to ease manual tasks for developers or other representatives of our customers with command line access

  • to allow integration with customer CI/CD tools for process automation

General usage information

As shown in the code blocks below, you can invoke the tool suite by just typing the command r3 in console. From there you can get the information, which capabilities it provides. The list of available services can differ between environments!

From the example you can see, that for the example environment operations for only 2 services are available (instance and db).

How to invoke the cli tool? 

USER@JUMPSERVER:~$ r3 the following arguments are required: subcommand usage: r3 [-h] [--version] [-d] [-q] {container,db,debug,instance,deploy,env,memcache,net,varnish,secret} ... positional arguments: {container,db,debug,instance,deploy,env,memcache,net,varnish,secret} optional arguments: -h, --help show this help message and exit --version show program's version number and exit -d, --debug Run in debug mode. -q, --quiet Run in quiet mode (only errors are shown).

You can obtain more detailed information for each specific service like shown in the following.

How to show help on specific service? 

USER@JUMPSERVER:~$ r3 db -h   #Response Manage Databases on root360 Cloud Platform   optional arguments:   -h, --help            show this help message and exit   Command Overview:   {snapshot,list,restore,show,destroy}     snapshot            Initiate Snapshot Creation for a Database Servers     list                List Database Servers and Snapshots for this                         Environment.     restore             Create a Restore Database Server from a Snapshot.     show                Show Details for Snapshots/Database Servers of this                         Environment.     destroy             Destroy Restore-Snapshots/Database Servers of this                         Environment.

Furthermore specific information for available operations of each service can be obtained like shown below.

How to show details on available operations on a service? 

USER@JUMPSERVER:~$ r3 db restore -h   #Response Create a Restore Database Server from a Snapshot.   optional arguments:   -h, --help            show this help message and exit   --loglevel {INFO,DEBUG,ERROR}                         Define Loglevel for Execution (default: INFO)     --env ENVIRONMENT, --environment ENVIRONMENT                         The Short Name of the desired Environment, e.g test,                         prod (default: this environment).   snapshot_id           SnapshotIdentifier of a Snapshot to restore a Database                         Server from.   --db-instance-class INSTANCE_CLASS                         DB instance class of restore database

Shortcuts/Aliases

In order to have fast access to the most important functions the command line suite supports some shortcuts, called Aliases.

For example r3 discover is a shortcut for r3 env discover. The former takes the same arguments as the later. To get used to the shortcuts you can use the described help-functions shown above.

The aliases can be differentiated from the services easily. all Aliases are verbs, whilst all services are named by nouns.

Related tutorials

 

root360 Knowledge Base - This portal is hosted by Atlassian (atlassian.com | Privacy Policy)