Search code examples
apiibm-cloudcloud-foundry

Which fields of service plan provide high level information about services?


I'm trying to list service plans usinf the cf api:

from cloudfoundry_client.client import CloudFoundryClient
target_endpoint = 'https://api.ng.bluemix.net'

client = CloudFoundryClient(target_endpoint, skip_verification=False)
client.init_with_user_credentials(
   ibm_id,
   ibm_id_password
)

import json
for sp in client.service_plans.list():
    print(sp['entity']['name'],
          sp['entity']['description'])

I was hoping to see a list of services with meaningful names and description as are listed in the bluemix web console, however, some of the responses I'm receiving don't really have much meaning, e.g.

(("100mb", "Basic"), ...)

Which minimal set of fields do I need to extract to list the services?


Solution

  • The API endpoints are listed in the docs, and the ones of interest to you are List Service Plans and Service Plan Details.

    You can also get information about everything offered by a Service Broker by hitting its Catalog endpoint.