Cloud Foundry CLI

Installation

Install CLI (Command Line Interface) for SAP BTP Cloud Foundry https://tools.hana.ondemand.com/#cloudarrow-up-right

Add below plugins to support "cf deploy" for SAP BTP CF

cf install-plugin -r CF-Community "multiapps"

Cloud Foundry CLI Quick Reference Guide

Welcome to the Cloud Foundry Command Line Interface (CLI) Quick Reference Guide. This document provides an overview of essential commands and their usage to help you efficiently navigate Cloud Foundry and manage your applications and services. Whether you're deploying applications, checking logs, working with services, scaling resources, or performing administrative tasks, this guide has got you covered.

Table of Contents

  1. Login to Cloud Foundry

  2. Working with Services

  3. Administrative Commands

  4. Working with Applications

  5. Additional Commands


1. Login to Cloud Foundry

Use the cf login command to log in to Cloud Foundry.

  • -a: Cloud Foundry API URL

  • -u: Your username

  • -o: Target organization

  • -s: Target space

Alternatively, you can use SSO to login Cloud Foundry:


2. Working with Services

List Marketplace Services

Explore available services from the marketplace.

Manage Services


3. Administrative Commands

Make sure that you are in the Cloud Foundry organization you want to add a space to.

Set Organization Role

Specify the user name, organization name, and the role to add.

Remove Organization Role

To remove an org role from a user, specify the user name, organization name, and the role.

Set Space Role

Specify the user name, organization name, space name, and the role to add.

Remove Space Role

To remove a space role from a user, specify the user name, organization name, space name, and the role.

Create Space Quota

Create a space quota plan by specifying the name, memory limits, route limits, service instance limits, and service plan allowance.

  • -i: Maximum amount of memory an application instance can have (-1 represents an unlimited amount).

  • -m: Total amount of memory a space can have.

  • -r: Total number of routes.

  • -s: Total number of service instances.

  • --allow-paid-service-plans: Can provision instances of paid service plans.

  • --disallow-paid-service-plans: Cannot provision instances of paid service plans.

Assign Quota Plans to Spaces

Assign a space quota plan to a specific space.

Change Space Quota Plans

Update an existing space quota plan with new settings.

Delete Spaces

Delete a space in Cloud Foundry.


4. Working with Applications

List Apps

Use cf apps to list all applications in the target space.

Start, Stop, and Restart Apps

Control the state of an application using these commands:

  • Start an app:

  • Stop an app:

  • Restart an app:

View App Logs

Check recent logs for an application using the cf logs command.

Check App Health and Status

Determine the health and status of an application with the cf app command.

Scaling Apps

Scale the number of instances, memory, or disk for an application.

  • Scale the number of instances:

  • Scale memory limit:

  • Scale disk limit:

Delete Apps

Remove an application using the cf delete command.


5. Additional Commands

List Buildpacks

Discover available application buildpacks using the cf buildpacks command.

List MTAs and HTML5 Apps

List Installed Plugins

Explore installed Cloud Foundry CLI plugins.

Remember, the Cloud Foundry CLI provides powerful tools to manage applications and services within your Cloud Foundry environment. With this quick reference guide, you'll be well-equipped to perform common tasks and streamline your workflow.

Last updated