Skip to content

Instantly share code, notes, and snippets.

@mmb
Last active November 14, 2015 05:40
Show Gist options
  • Save mmb/54296f0a21b22bf2c880 to your computer and use it in GitHub Desktop.
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