Skip to content

Instantly share code, notes, and snippets.

@pauldougan
Last active June 14, 2018 05:56
Show Gist options
  • Save pauldougan/7e1ff28ce98e0e735baf878574802906 to your computer and use it in GitHub Desktop.
Save pauldougan/7e1ff28ce98e0e735baf878574802906 to your computer and use it in GitHub Desktop.
Getting details of your applications from the Cloud Foundry API

Access details of your applications from the Cloud Foundry API

Problem

You need access to application level information to help manage and plan your estate and cannot get what you need through the command line interface (CLI).

Solution

  • Login with the CF CLI as usual
  • Use the CF API to access the /V3/apps endpoint to return the detailed information in JSON format.
  • Filter the data using the jq command (http://github/stedolan/jq)
cf login
cf curl /v2/apps | jq '.'
cf curl /v2/apps | jq '.resources[4]'
cf curl /v2/apps | jq '.resources[4].entity.memory'

Discussion

The advantage of using the cf curl command is that is that it handles authentication for you.

Also see

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment