Skip to content

Instantly share code, notes, and snippets.

@mmb
Last active November 14, 2015 05:40
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mmb/54296f0a21b22bf2c880 to your computer and use it in GitHub Desktop.
get instance hosts and ports for a Cloud Foundry app
#!/bin/bash
set -eu
APP_NAME=$1
METADATA_URL=$(
cf curl /v2/apps?q=name:$APP_NAME |
jq -r .resources[0].metadata.url
)
cf curl $METADATA_URL/stats | \
jq 'map([.stats.host, .stats.port])'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment