Add get_spaces_summary api call

Change-Id: Ide8c877d1d5f8a558ca0c192c4ad55054ac785e2
This commit is contained in:
Aaron Rosen 2015-02-24 13:05:42 -08:00
parent 1837b141e3
commit b67a4762fc
1 changed files with 11 additions and 0 deletions

View File

@ -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()