diff --git a/cloudfoundryclient/v2/client.py b/cloudfoundryclient/v2/client.py index 4dd1308..d7e6581 100644 --- a/cloudfoundryclient/v2/client.py +++ b/cloudfoundryclient/v2/client.py @@ -41,6 +41,7 @@ class Client(object): organization_space_quota_definitions_url = ( '/v2/organizations/%s/space_quota_definitions') apps_space_url = '/v2/spaces/%s/apps' + spaces_summary_url = '/v2/spaces/%s/summary' def __init__(self, username="", password="", base_url="https://api.run.pivotal.io/"): @@ -157,3 +158,13 @@ class Client(object): self.apps_space_url % guid) r = requests.get(url, headers=headers) return r.json() + + def get_spaces_summary(self, guid): + """Return list summary of each space + + param - guid: the guid of the space. + """ + headers = self._generic_request_headers() + url = self._base_url + (self.spaces_summary_url % guid) + r = requests.get(url, headers=headers) + return r.json()