Zum Inhalt springen

Interact with Cloud Foundry

Diese Seite ist noch nicht in deiner Sprache verfügbar. Englische Seite aufrufen

In this document we want to show how you can interact with the STACKIT Cloud Foundry, after the creation of your organization. We look at the two main touchpoints and how to get access to your organization.

In this tab you will learn how to use the Cloud Foundry CLI to:

In the following part we are looking at the approach to interact with the STACKIT Cloud Foundry by using the Cloud Foundry command line interface. For now, this is the recommended approach to harness the full power of the Cloud Foundry API, being the central component of our STACKIT Cloud Foundry offering.

In order to follow this approach you need to have the Cloud Foundry CLI installed.

In order to login to the Cloud Foundry CLI, you need to get the API-Endpoint the cli should point to. You can find the API Endpoint in the Cloud Foundry Organisation Overview of your Project in the STACKIT Portal. For this you just need to click on any of your listed orgs and copy the login command with the right API Endpoint from the context menu on the right as seen in the image below.

Where you can find the cf login command with the api endpoint in the STACKIT Portal.

The API Endpoint and with that the login command is the same for every organization within your STACKIT project. But there are different API Endpoints depending on the type of your project: Web Projects have another Endpoint than the internal projects.

Open up your terminal or other command line input tool and use the cf login command in your clipboard, or type one of the following commands:

For organisations in a public STACKIT project:

Terminal window
cf login -a https://api.system.01.cf.eu01.stackit.cloud --sso

For organisations in an internal STACKIT project:

Terminal window
cf login -a https://api.system.02.cf.eu01.stackit.schwarz --sso

Afterwards the terminal will output the passcode-url you can use to login with your STACKIT Account. For example for an organization in a public STACKIT project the output looks like the following:

API-Endpoint: https://api.system.01.cf.eu01.stackit.cloud
Temporary Authentication Code ( Get one at https://login.system.01.cf.eu01.stackit.cloud/passcode ):

Enter the URL given in this output in an internet browser of your choice which should already redirect you to the login screen. Please login there. Alternatively, if you already have an open session with your single sign on credentials in your cookies you will automatically be logged in and can see the following page:

The temporary authentication code of the Cloud Foundry SSO.

Here you can see an example of the temporary authentication code you get assigned for the login. Copy the code and paste it into the command line interface which should still await your input. Press enter to trigger the authentification. Afterwards you should be authenticated successfully and can select the organization and space you want to work with.

After a successful authentication with the single sign on passcode, the command line output is asking you for the selection of an organisation. It will list all organisations your account has access-rights to in a dialoge that might look like the follwing:

Select an org:
1. Cloud Foundry Demo
2. MyFirstOrg
3. playground
Organization (enter to skip):

Input any of the listed number to select the organisation listed with that number or keep it empty to select no organisation at all and press enter to continue.

If you selected an organization the command line output will ask you to select a space within that organization to point to. For this it lists all for your account available spaces in a dialog that might look like the following:

Targeted org Cloud Foundry Demo.
Select a space:
1. dev
2. prod
3. qa
Space (enter to skip):

Input any of the listed number to select the space listed with that number or keep it empty to select no space at all and press enter to continue.

Afterwards, the command line output presents you with the information about the API-Endpoint you are working with, the account you are logged in with and the org and space your CLI is pointing to. Now you can begin to work.

If you later want to know to which org and space you are logged in, you can just use the command cf target with the following parameters:

Terminal window
cf target [-o ORG] [-s SPACE]
NAME:
target - show or define target org or target space
Usage:
cf target [-o ORG] [-s SPACE]
ALIAS:
t
Options:
-o Organization
-s Space

You can get the current connection information via:

Terminal window
cf target

You can select a new org and space as follows:

Terminal window
cf target -o MyFirstOrg -s mySpace

In order to get the list of org names your account can access, use the following command:

Terminal window
cf orgs

In order to get the list of space names your account can access within an org, just target the org you want this information for and use the following command:

Terminal window
cf spaces