Skip to content

Instantly share code, notes, and snippets.

@mmb
Last active November 14, 2015 05:40
Embed
What would you like to do?
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