Using the right tool for the job
SAP HANA Cloud provides powerful graphical tools to perform the database system administration tasks, but sometimes it can be useful to use a command line tool. The Cloud Foundry CLI provided the command line interface to SAP HANA cloud.
The Cloud Foundry CLI can be used for:
- Create an SAP HANA Database Instance Using the CLI
- Create an SAP HANA Cloud, Data Lake Instance Using the CLI
- Create a Connection Between an SAP HANA Database Instance and a Data Lake Instance Using the CLI
- Recover an SAP HANA Database Using the CLI
- Recreate Instance from Backup Using the CLI
- Start and Stop an Instance Using the CLI
- Delete an Instance Using the CLI
- Delete a Connection Between an SAP HANA Database Instance and a Data Lake Instance Using the CLI
- Change the Size of an SAP HANA Database Instance Using the CLI
- Change the Size of a Data Lake Instance Using the CLI
- Change Allowed Connections Using the CLI
- Enable and Disable Additional Capabilities Using the CLI
- Enable and Disable the Connectivity Proxy Using the CLI
- List the Parameters of an Instance Using the CLI
The details on how to use the Cloud Foundry CLI commands will be explained the respective lessons.
Download the Cloud Foundry CLI
The Cloud Foundry CLI will be installed on your desktop. The installation media files for your operating system (Linux, Mac OS and Windows) are available on github. On github the installation packages for the most commonly used package managers are provided. Choose the newest version available for your operating system.
Download link: Cloud Foundry CLI downloadsPlease only download from trusted sources.
Install the Cloud Foundry CLI
There are many ways to install the Cloud Foundry CLI. In this SAP Learning I will explain the Linux installation method, as my laptop is Debian/Ubuntu Linux based. The methods for Windows and Mac OS are explained on the page found here: Cloud Foundry CLI Installation Guide
Install instructions for a Debian/Ubuntu distribution
- Open a Terminal window on your Linux system.
- Use the following command to download and add the Cloud Foundry Foundation public key to your system:Code snippetCopy code
wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key addNoteIn this step you will be asked to provide your OS password
- Use the following command to add the package repository to your system:Code snippetCopy code
echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
- Use the following command to update your local package manager information:Code snippetCopy code
sudo apt-get update
- Use the following command to install the Cloud Foundry CLI:Code snippetCopy code
sudo apt-get install cf8-cli
You now have installed the Cloud Foundry CLI on your local desktop computer.
Getting started with the Cloud Foundry CLI
Now that the Cloud Foundry CLI is installed, we can use it to perform many database administration tasks using this command line tool. In this section you will learn the basics of using Cloud Foundry CLI, in later units the detail SAP HANA Cloud database administration commands will be shown.
Log on to SAP HANA Cloud
You need to login on SAP BTP before you can perform any of the SAP HANA Cloud database system administration tasks. To log on to SAP HANA Cloud use the following steps:
- Open a Terminal window on your Linux system.
- Log on to the SAP BTP Cloud Foundry environment with the command:Code snippetCopy code
cf login -a <API Endpoint URL> Example for SAP HANA Cloud Trial: cf login -a https://api.cf.eu10.hana.ondemand.com/
A list with the available API Endpoint URLs can be found here: Available API Endpoints
- Enter your credentials (e-mail and password)
Show Cloud Foundry CLI version
To check the version of the installed Cloud Foundry CLI use the command:
Show the help documentation
To get an overview of the available commands use the command:
To get a detailed overview of how to use a specific command use the command:
cf help [command]
cf help services NAME: services - List all service instances in the target space USAGE: cf services ALIAS: s OPTIONS: --no-apps Do not retrieve bound apps information. SEE ALSO: create-service, marketplace
Find the service name of your SAP HANA Cloud
Find the Service Offerings and Service Plans
Services enable, facilitate, or accelerate the development of business applications and other platform services on SAP BTP. You find all services, solutions, and use cases in the SAP Discovery Center. Services are grouped into the following service types:
- Business services: Services that enable, facilitate, or accelerate the development of business process components or provide industry-specific functionalities or content within a business application.
- Technical services: Services that enable, facilitate, or accelerate the development of general or domain independent content within a business application, independent of the application's business process or task.
When using the Cloud Foundry CLI you often need to specify the technical name of the service offering and the service plan. The entitled service offering in your account can be found in the SAP BTP Service Marketplace as shown the above figure.
It's also possible to retrieve the technical names of the service offerings and service plans using the Cloud Foundry CLI. Use the
cf marketplace command to list the service offering and Service plans as shown in the above figure.
A service plan describes a particular service (for example, a database configuration) that is available for use. Service brokers advertise their service plans onto a catalog. You can use these advertised service plans to configure a particular service you want to create.