Using a BTP Management Tool: CF CLI

Objectives
After completing this lesson, you will be able to:

After completing this lesson, you will be able to:

  • Use the Cloud Foundry Command Line Interface (CF CLI)

The Cloud Foundry Command Line Interface

Usage Scenario

You have an account in the SAP Business Technology Platform and you enabled the runtime in your subaccount. To manage the environment using a command line interface, you need to get familiar with the Cloud Foundry Command Line Interface (CF CLI).

Manage the Cloud Foundry Runtime

The CF CLI enables you to work with the Cloud Foundry runtime to deploy and manage your applications. To manage the Cloud Foundry runtime, you can use both the BTP cockpit and the CF CLI. Many actions can only be performed via the CF CLI, for example, renaming a Cloud Foundry org.

To install the CLI, you can either grab the latest release on the official release page or use https://tools.hana.ondemand.com/#cloud.

In order to manage the SAP Cloud Foundry runtime, you need to provide the CF CLI with an API endpoint. The API endpoint depends on the region you chose for your account:

  • For EU: https://api.cf.eu10.hana.ondemand.com
  • For US EAST: https://api.cf.us10.hana.ondemand.com
  • For US CENTRAL: https://api.cf.us20.hana.ondemand.com
Note
The mentioned endpoints above are examples. Please always use the endpoint which you can find in the SAP BTP cockpit.

You can find your specific API endpoint of your Cloud Foundry organization on your SAP BTP subaccount overview page.

SAP BTP Cockpit Overview Page

To try this out, you can open a command prompt and enter the following commands (in this case for the EU region):

Code snippet
cf api <your-api-endpoint>
cf login
Copy code

Enter your credentials and try it out.

If you want to have an overview of all commands, enter the following command:

cf help -a

If you want to know the use of a special command, for example rename-org to rename an org, enter the following command:

cf help rename-org

CF CLI: Plug-ins

CF CLI: Plug-ins offers a list of additional commands that have been implemented as plug-ins to extend the base CF CLI client.

You can find examples of a CF CLI plug-in for performing operations on multi-target applications (MTAs) in Cloud Foundry, such as deploying, removing, viewing, and so on:

Summary

You now have a more profound understanding of the CF CLI to manage the Cloud Foundry environment.

Save progress to your learning plan by logging in or creating an account

Login or Register