Revision a1ff970b astakosclient/astakosclient/__init__.py
b/astakosclient/astakosclient/__init__.py | ||
---|---|---|
825 | 825 |
filters["owner"] = owner |
826 | 826 |
if mode is not None: |
827 | 827 |
filters["mode"] = mode |
828 |
path = self.api_projects |
|
829 |
if filters: |
|
830 |
path += "?" + urllib.urlencode(filters) |
|
828 | 831 |
req_headers = {'content-type': 'application/json'} |
829 |
req_body = (parse_request({"filter": filters}, self.logger) |
|
830 |
if filters else None) |
|
831 |
return self._call_astakos(self.api_projects, |
|
832 |
headers=req_headers, body=req_body) |
|
832 |
return self._call_astakos(path, headers=req_headers) |
|
833 | 833 |
|
834 | 834 |
# ----------------------------------------- |
835 | 835 |
# do a GET to ``API_PROJECTS``/<project_id> |
... | ... | |
931 | 931 |
In case of success, return a list of membership descriptions. |
932 | 932 |
""" |
933 | 933 |
req_headers = {'content-type': 'application/json'} |
934 |
body = {"project": project} if project is not None else None |
|
935 |
req_body = parse_request(body, self.logger) if body else None |
|
936 |
return self._call_astakos(self.api_memberships, |
|
937 |
headers=req_headers, body=req_body) |
|
934 |
filters = {} |
|
935 |
if project is not None: |
|
936 |
filters["project"] = project |
|
937 |
path = self.api_memberships |
|
938 |
if filters: |
|
939 |
path += '?' + urllib.urlencode(filters) |
|
940 |
return self._call_astakos(path, headers=req_headers) |
|
938 | 941 |
|
939 | 942 |
# ----------------------------------------- |
940 | 943 |
# do a GET to ``API_MEMBERSHIPS``/<memb_id> |
Also available in: Unified diff