Revision 79b5d61b astakosclient/astakosclient/__init__.py
b/astakosclient/astakosclient/__init__.py | ||
---|---|---|
173 | 173 |
raise InvalidResponse(str(err), data) |
174 | 174 |
|
175 | 175 |
# ------------------------ |
176 |
# GET /im/authenticate
|
|
176 |
# GET /astakos/api/authenticate
|
|
177 | 177 |
def get_user_info(self, token, usage=False): |
178 | 178 |
"""Authenticate user and get user's info as a dictionary |
179 | 179 |
|
... | ... | |
186 | 186 |
|
187 | 187 |
""" |
188 | 188 |
# Send request |
189 |
auth_path = "/im/authenticate"
|
|
189 |
auth_path = "/astakos/api/authenticate"
|
|
190 | 190 |
if usage: |
191 | 191 |
auth_path += "?usage=1" |
192 | 192 |
return self._call_astakos(token, auth_path) |
193 | 193 |
|
194 | 194 |
# ---------------------------------- |
195 |
# POST /user_catalogs (or /service/api/user_catalogs)
|
|
195 |
# POST /astakos/api/user_catalogs (or /astakos/api/service/user_catalogs)
|
|
196 | 196 |
# with {'uuids': uuids} |
197 | 197 |
def _uuid_catalog(self, token, uuids, req_path): |
198 | 198 |
req_headers = {'content-type': 'application/json'} |
... | ... | |
218 | 218 |
keys and the corresponding user names as values |
219 | 219 |
|
220 | 220 |
""" |
221 |
req_path = "/user_catalogs" |
|
221 |
req_path = "/astakos/api/user_catalogs"
|
|
222 | 222 |
return self._uuid_catalog(token, uuids, req_path) |
223 | 223 |
|
224 | 224 |
def get_username(self, token, uuid): |
... | ... | |
232 | 232 |
|
233 | 233 |
def service_get_usernames(self, token, uuids): |
234 | 234 |
"""Return a uuid_catalog dict using a service's token""" |
235 |
req_path = "/service/api/user_catalogs"
|
|
235 |
req_path = "/astakos/api/service/user_catalogs"
|
|
236 | 236 |
return self._uuid_catalog(token, uuids, req_path) |
237 | 237 |
|
238 | 238 |
def service_get_username(self, token, uuid): |
... | ... | |
245 | 245 |
raise NoUserName(uuid) |
246 | 246 |
|
247 | 247 |
# ---------------------------------- |
248 |
# POST /user_catalogs (or /service/api/user_catalogs)
|
|
248 |
# POST /astakos/api/user_catalogs (or /astakos/api/service/user_catalogs)
|
|
249 | 249 |
# with {'displaynames': display_names} |
250 | 250 |
def _displayname_catalog(self, token, display_names, req_path): |
251 | 251 |
req_headers = {'content-type': 'application/json'} |
... | ... | |
271 | 271 |
the names as keys and the corresponding uuids as values |
272 | 272 |
|
273 | 273 |
""" |
274 |
req_path = "/user_catalogs" |
|
274 |
req_path = "/astakos/api/user_catalogs"
|
|
275 | 275 |
return self._displayname_catalog(token, display_names, req_path) |
276 | 276 |
|
277 | 277 |
def get_uuid(self, token, display_name): |
... | ... | |
285 | 285 |
|
286 | 286 |
def service_get_uuids(self, token, display_names): |
287 | 287 |
"""Return a display_name catalog using a service's token""" |
288 |
req_path = "/service/api/user_catalogs"
|
|
288 |
req_path = "/astakos/api/service/user_catalogs"
|
|
289 | 289 |
return self._displayname_catalog(token, display_names, req_path) |
290 | 290 |
|
291 | 291 |
def service_get_uuid(self, token, display_name): |
... | ... | |
298 | 298 |
raise NoUUID(display_name) |
299 | 299 |
|
300 | 300 |
# ---------------------------------- |
301 |
# GET "/im/get_services"
|
|
301 |
# GET "/astakos/api/get_services"
|
|
302 | 302 |
def get_services(self): |
303 | 303 |
"""Return a list of dicts with the registered services""" |
304 |
return self._call_astakos(None, "/im/get_services")
|
|
304 |
return self._call_astakos(None, "/astakos/api/get_services")
|
|
305 | 305 |
|
306 | 306 |
# ---------------------------------- |
307 | 307 |
# GET "/astakos/api/resources" |
Also available in: Unified diff