The Cloud Management Tools Feature Set B provides the SAP BTP CLI (Command Line Interface) that allows you a convenient account management on the command line. [1] This blog post describes how you get the btp CLI running on Ubuntu 20.04 (Linux).
![SAP BTP CLI: Account Management on the command line](https://i0.wp.com/blog.surges.eu/wp-content/uploads/2021/09/sap_btp_cli_ubuntu_linux.png?resize=740%2C461&ssl=1)
SAP says that you are not only able to use the btp CLI for account management tasks on the command line but also to automate these procedures, e.g.:
- Manage global accounts, directories, and sub-accounts
- Set entitlements
- Work with environments
- Work with multi-tenant applications
- Manage users and their authorisations
The difference between the btp CLI and the Cloud Foundry CLI (cf CLI) [2] is that you can execute all tasks on global account, directory, and sub account level on btp CLI. That means that the creation of a Cloud Foundry environment instance is the last step with the btp CLI. After that, you have to use the cf CLI for managing org members, spaces, quota and so on. [3]
Get started with BTP CLI on Ubuntu
- Download the the btp CLI client for Linux on https://tools.hana.ondemand.com/#cloud-cpcli [4]
- Extract the tar.gz archive with the following terminal command:
# Replace <name.tar.gz> with the file name tar -vxzf <name.tar.gz> # -v: Displays Verbose Information # -x: Extract the archive # -z: zip, tells tar command that creates tar file using gzip # -f: creates archive with given filename
- Create for example a bin folder in the home directory if this does not exist.
# Folder in home directory mkdir ~/bin
- Copy the extracted and executable btp file into the bin folder.
# Copy the btp file in the bin folder cp ~/Downloads/linux-amd64/btp ~/bin/btp
- Add ~/bin to the PATH variable so that btp is always available:
# ~/bin is added to PATH export PATH="/home/$USER/bin:$PATH" # With this command you can check whether the path has been added echo $PATH # You should see something like this: "/home/<user>/bin:/home/<user>/.nvm/versions/node/v16.7.0/bin:[...]"
- Try to log in via btp CLI.
btp login
- Frist, confirm the CLI server URL (https://cpcli.cf.eu10.hana.ondemand.com ) for all regions (eu10, us10 etc.).
- Then, enter the global account subdomain (*-ga, “Log in to your global account“).
- After that, enter your user (e-mail or P-/S-User of your trial account) and the password.
The above entered connection details are stored in the config.json (/home/<user>/.cache/.btp/config.json).
![SAP BTP CLI: config.json](https://i0.wp.com/blog.surges.eu/wp-content/uploads/2021/09/sap_btp_cli_config_json.png?resize=740%2C201&ssl=1)
Updates and btp CLI commands
You will find updates of the btp CLI on SAP Development Tools [4] and can repeat the steps 1, 2, 4, and 6.
Finally, you find information of the command syntax of the btp CLI on help.sap.com. [5]
Further information
[1] Cloud Management Tools — Feature Set Overview
[2] Tutorial “Install the Cloud Foundry Command Line Interface (CLI)“
[3] Tutorial “Get Started with the SAP BTP Command Line Interface (btp CLI)”
[4] SAP Development Tools (e.g. CLI)
[5] Command Syntax of the btp CLI
[6] Setting Up a Trial Account via the Command Line [Feature Set B]
[7] Commands in the btp CLI