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 Cloud Foundry environment 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 Environment

The CF CLI enables you to work with the Cloud Foundry environment to deploy and manage your applications. To manage the Cloud Foundry environment 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 environment 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

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 https://api.cf.eu10.hana.ondemand.com
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