How to get route name from a route GUID in Tanzu Platform for Cloud Foundry (TPCF)
search cancel

How to get route name from a route GUID in Tanzu Platform for Cloud Foundry (TPCF)

book

Article ID: 298206

calendar_today

Updated On:

Products

VMware Tanzu Application Service for VMs VMware Tanzu Platform - Cloud Foundry

Issue/Introduction

How can I retrieve a route name given a route GUID in Tanzu Platform for Cloud Foundry (TPCF)?

Resolution

This can be accomplished using cf curl to retrieve the host and domain. The route name is a concatenation of the host and domain.

For example, given the route GUID "58a4c664-a718-4aa3-b51a-07b7b310dd55", you first query the routes to retrieve the URL

$ cf curl /v3/routes/58a4c664-a718-4aa3-b51a-07b7b310dd55 | jq '.url'

"my-app-courteous-panther-jx.apps.example.com"

This outputs the full route name "my-app-courteous-panther-jx.apps.example.com"

The hostname of the route is "my-app-courteous-panther-jx" and the domain is "apps.example.com"