This is a draft document that was built and uploaded automatically. It may document beta software and be incomplete or even incorrect. Use this document at your own risk.
The Cloud Foundry command line interface (cf CLI) is for deploying and managing your applications. You may use it for all the orgs and spaces that you are a member of. Install the client on a workstation for remote administration of your SUSE Cloud Foundry instances.
The complete guide is at Using the Cloud Foundry Command Line Interface, and source code with a demo video is on GitHub at Cloud Foundry CLI.
The following examples demonstrate some of the commonly-used commands. The
first task is to log into your new Cloud Application Platform instance.
You need to provide the API endpoint of your SUSE Cloud Application Platform instance to log
in. The API endpoint is the system_domain value you provided in
kubecf-config-values.yaml, plus the
api. prefix, as it shows in the above welcome screen. Set
your endpoint, and use --skip-ssl-validation when you
have self-signed SSL certificates. It asks for an e-mail address, but you
must enter admin instead (you cannot change this to a
different username, though you may create additional users), and the
password is the one you created in
kubecf-config-values.yaml:
tux > cf login --skip-ssl-validation -a https://api.example.com
API endpoint: https://api.example.com
Email> admin
Password>
Authenticating...
OK
Targeted org system
API endpoint: https://api.example.com (API version: 2.134.0)
User: admin
Org: system
Space: No space targeted, use 'cf target -s SPACE'
cf help displays a list of commands and options.
cf help [command] provides information on specific
commands.
You may pass in your credentials and set the API endpoint in a single command:
tux > cf login -u admin -p PASSWORD --skip-ssl-validation -a https://api.example.com
Log out with cf logout.
Change the admin password:
tux > cf passwd
Current Password>
New Password>
Verify Password>
Changing password...
OK
Please log in againView your current API endpoint, user, org, and space:
tux > cf targetSwitch to a different org or space:
tux >cf target -o MY_ORGtux >cf target -s MY_SPACE
List all apps in the current space:
tux > cf appsQuery the health and status of a particular app:
tux > cf app MY_APP
View app logs. The first example tails the log of a running app. The
--recent option dumps recent logs instead of tailing,
which is useful for stopped and crashed apps:
tux >cf logs MY_APPtux >cf logs --recent MY_APP
Restart all instances of an app:
tux > cf restart MY_APPRestart a single instance of an app, identified by its index number, and restart it with the same index number:
tux > cf restart-app-instance MY_APP APP_INSTANCEAfter you have set up a service broker (see Chapter 22, Service Brokers), create new services:
tux > cf create-service SERVICE_NAME default MY_DBThen you may bind a service instance to an app:
tux > cf bind-service MY_APP SERVICE_INSTANCE
The most-used command is cf push, for pushing new apps
and changes to existing apps.
tux > cf push NEW_APP -b buildpackIf you need to debug your application or run one-off tasks, start an SSH session into your application container.
tux > cf ssh MY_APPWhen the SSH connection is established, run the following to have the environment match that of the application and its associated buildpack.
tux > /tmp/lifecycle/shell