Revision 259a5f9a
b/astakosclient/astakosclient/__init__.py | ||
---|---|---|
511 | 511 |
|
512 | 512 |
# -------------------------------------- |
513 | 513 |
# do a GET to ``API_TOKENS`` with a token |
514 |
def validate_token(self, token_id, belongsTo=None):
|
|
514 |
def validate_token(self, token_id, belongs_to=None):
|
|
515 | 515 |
""" Validate a temporary access token (oath2) |
516 | 516 |
|
517 | 517 |
Keyword arguments: |
... | ... | |
520 | 520 |
It returns back the token as well as information about the token |
521 | 521 |
holder. |
522 | 522 |
|
523 |
The belongsTo is optional and if it is given it must be inside the
|
|
523 |
The belongs_to is optional and if it is given it must be inside the
|
|
524 | 524 |
token's scope. |
525 | 525 |
|
526 | 526 |
In case of error raise an AstakosClientException. |
527 | 527 |
|
528 | 528 |
""" |
529 | 529 |
path = join_urls(self.api_tokens, str(token_id)) |
530 |
if belongsTo is not None:
|
|
531 |
params = {'belongsTo': belongsTo}
|
|
530 |
if belongs_to is not None:
|
|
531 |
params = {'belongsTo': belongs_to}
|
|
532 | 532 |
path = '%s?%s' % (path, urllib.urlencode(params)) |
533 | 533 |
return self._call_astakos(path, method="GET", log_body=False) |
534 | 534 |
|
... | ... | |
996 | 996 |
else: |
997 | 997 |
return catalog |
998 | 998 |
except KeyError: |
999 |
raise NoEndpoints() |
|
999 |
raise NoEndpoints(ep_name, ep_type, ep_region, ep_version_id)
|
|
1000 | 1000 |
|
1001 | 1001 |
|
1002 | 1002 |
# -------------------------------------------------------------------- |
Also available in: Unified diff