I am trying to detect the version of Bluemix/Cloud Foundry. Is there a command I can use to do this?
cf -version tells you the version of the commandline interface, but not the version of the server you are "push"ing to.
thanks
anthony
Use the cf curl command to determine version information. All Cloud Foundry targets expose an info endpoint, which prints the release name, build number, description, and various endpoints. Run cf curl /v2/info to see this information, and look for the "min_cli_version" .
Services. A service is a cloud extension that is hosted by Bluemix. The service provides functionality that is ready-for-use by the app's running code.
Log in. Use the ibmcloud login command to log in. If you log in with a federated ID, use the --sso option to authenticate with a one time passcode. Or use the --apikey option to authenticate with an API key.
Deploying apps by using the ibmcloud cf command When you deploy your apps to IBM Cloud from the command line interface, a buildpack provides the runtime environment that is appropriate for your app language and framework. You can also use the Delivery Pipeline service to deploy apps to IBM Cloud.
You can get the version of CloudFoundry that Bluemix is running on via the CloudFoundry info endpoint.
US South Datacenter - https://api.ng.bluemix.net/info (currently 226 as of this posting)
EU UK Datacenter - https://api.eu-gb.bluemix.net/info (currently 226 as of this posting)
AP Datacenter - https://api.au-syd.bluemix.net/info (currently 226 as of this posting)
AP Datacenter - https://api.eu-de.bluemix.net/info (currently 226 as of this posting)
The build is the bit of JSON you want.
{
"name": "Bluemix",
"build": "226004",
"support": "http://ibm.com",
"version": 2,
"description": "IBM Bluemix",
"authorization_endpoint": "https://login.ng.bluemix.net/UAALoginServerWAR",
"token_endpoint": "https://uaa.ng.bluemix.net",
"allow_debug": true
}
You can use the command cf curl /v2/info
to access Bluemix's Cloud Controller endpoint to get info about versions, etc. Here's the output I see at the moment:
$ cf curl /v2/info
{
"name": "Bluemix",
"build": "195008",
"support": "http://ibm.com",
"version": 2,
"description": "IBM Bluemix",
"authorization_endpoint": "https://login.ng.bluemix.net/UAALoginServerWAR",
"token_endpoint": "https://uaa.ng.bluemix.net",
"api_version": "2.19.0",
"logging_endpoint": "wss://loggregator.ng.bluemix.net:443",
"user": "<uuid>"
}
The build
property's first three characters map to the version of Cloud Foundry in use. In this case, version 195, which corresponds to the versioned API doc here: http://apidocs.cloudfoundry.org/195/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With