Add get_spaces_summary api call
Change-Id: Ide8c877d1d5f8a558ca0c192c4ad55054ac785e2
This commit is contained in:
parent
1837b141e3
commit
b67a4762fc
|
@ -41,6 +41,7 @@ class Client(object):
|
||||||
organization_space_quota_definitions_url = (
|
organization_space_quota_definitions_url = (
|
||||||
'/v2/organizations/%s/space_quota_definitions')
|
'/v2/organizations/%s/space_quota_definitions')
|
||||||
apps_space_url = '/v2/spaces/%s/apps'
|
apps_space_url = '/v2/spaces/%s/apps'
|
||||||
|
spaces_summary_url = '/v2/spaces/%s/summary'
|
||||||
|
|
||||||
def __init__(self, username="", password="",
|
def __init__(self, username="", password="",
|
||||||
base_url="https://api.run.pivotal.io/"):
|
base_url="https://api.run.pivotal.io/"):
|
||||||
|
@ -157,3 +158,13 @@ class Client(object):
|
||||||
self.apps_space_url % guid)
|
self.apps_space_url % guid)
|
||||||
r = requests.get(url, headers=headers)
|
r = requests.get(url, headers=headers)
|
||||||
return r.json()
|
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()
|
||||||
|
|
Loading…
Reference in New Issue