Skip to content

Instantly share code, notes, and snippets.

@boina-n
Last active September 1, 2017 23:10
Show Gist options
  • Save boina-n/08e24964d1c6ac73a0fd0b8fe7575fef to your computer and use it in GitHub Desktop.
Save boina-n/08e24964d1c6ac73a0fd0b8fe7575fef to your computer and use it in GitHub Desktop.
[CloudFoundry][API][ROUTES] - list all routes
for space_guid in `cf curl /v2/spaces | jq -r ".resources[].metadata.guid"`
do
routes_url=$(cf curl /v2/spaces/$space_guid | jq -r ".entity.routes_url")
for route in $(cf curl $routes_url | jq -r ".resources[].metadata.guid")
do
hostname=$(cf curl /v2/routes/$route | jq -r ".entity.host")
domain_guid=$(cf curl /v2/routes/$route | jq -r ".entity.domain_guid")
domaine_name=$(cf curl /v2/domains/$domain_guid | jq -r ".entity.name")
echo $hostname"."$domaine_name
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment