Working with routes from the IBM Bluemix CLI

Today I played with routes on IBM Bluemix. Routes are how you access the app on IBM Bluemix so basically they are hostnames mapped to apps. By default apps are assigned a hostname under mybluemix.net but once you’ve proved a domain belongs to you you may also may custom domain names to your apps. Of course you still need to create a CNAME record in DNS to make it map correctly but you get the point. Working with routes is possible from the GUI but the command line interface (CLI) is more efficient. Below are the commands I use to work with routes. All of the commands assumes you’re already logged in… Actual commands in bold.

Listing the routes (as you can see some routes are not bound to apps): cf routes

Getting routes as lekkim ...

space   host                                                domain            apps
dev     ontime-ibm-connected-2015-verse-demo-contribution   mybluemix.net     IBM ConnectED 2015 Verse Demo Contribution
dev     otgc-verse                                          mybluemix.net     IBM ConnectED 2015 Verse Demo Contribution
dev     mikkel-otgcms-test                                  mybluemix.net     Mikkel OTGCMS Test
dev     mikkel-otgcms-test                                  ontimesuite.com   Mikkel OTGCMS Test
dev     neodashboard-oauth                                  mybluemix.net     neodashboard-oauth
dev     spring-boot-demo-mikkel                             mybluemix.net     Spring-Boot-Demo-Mikkel
dev     engageugdemo                                        mybluemix.net     engageugdemo
dev     engagedemoapp1                                      mybluemix.net
dev     engagementdemo1                                     mybluemix.net
dev     engageugdemoapp                                     mybluemix.net

Map a route called myapp.ontimesuite.com to the engageugdemo app: cf map-route engageugdemo ontimesuite.com -n myapp

Creating route myapp.ontimesuite.com for org lekkim / space dev as lekkim...
OK

Unmap a route called myapp.ontimesuite.com from the engageugdemo app: cf unmap-route engageugdemo ontimesuite.com -n myapp

Removing route myapp.ontimesuite.com from app engageugdemo in org lekkim / space dev as lekkim...
OK

Permently delete the myapp.ontimesuite.com route from your account: cf delete-route ontimesuite.com -n myapp

Deleting route engageugdemo.ontimesuite.com...
OK