Commit ff0b2de4 authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis

astakosclient: Add documentation for quotas functionality

parent df319066
......@@ -417,7 +417,7 @@ class AstakosClient():
serial -- commission's id (int)
In case of success return a dict of dicts containing
informations (details) about the requests commission
informations (details) about the requested commission
"""
check_input("get_commission_info", self.logger, serial=serial)
......
......@@ -12,12 +12,16 @@ It uses the user's authentication token to query Astakos for:
* User's info
* Usernames for given UUIDs
* UUIDs for given usernames
* User's quotas
It can also query Astakos with another service's (Cyclades or Pithos)
authentication token for:
* Usernames for given UUIDs
* UUIDs for given usernames
* Issue commissions
* Get pending commissions
* Accept or reject commissions
Additionally, there are options for using the `objpool
<https://github.com/grnet/objpool>`_ library to pool the http connections.
......@@ -68,20 +72,20 @@ retry=0, use_pool=False, pool_size=8, logger=None\ **)**
This class provides the following methods:
**get_user_info(**\ token, usage=False\ **)**
Given a valid authentication token it returns a dict with the
Given a user's authentication token it returns a dict with the
correspoinding user's info. If usage is set to True more
information about user's resources will be returned.
In case of error raise an AstakosClientException exception.
**get_usernames(**\ token, uuids\ **)**
Given a valid authentication token and a list of UUIDs
Given a user's authentication token and a list of UUIDs
return a uuid_catalog, that is a dictionary with the given
UUIDs as keys and the corresponding user names as values.
Invalid UUIDs will not be in the dictionary.
In case of error raise an AstakosClientException exception.
**get_username(**\ token, uuid\ **)**
Given a valid authentication token and a UUID (as string)
Given a user's authentication token and a UUID (as string)
return the corresponding user name (as string).
In case of invalid UUID raise NoUserName exception.
In case of error raise an AstakosClientException exception.
......@@ -93,14 +97,14 @@ retry=0, use_pool=False, pool_size=8, logger=None\ **)**
Same as get_username but called with a service's token.
**get_uuids(**\ token, display_names\ **)**
Given a valid authentication token and a list of usernames
Given a user's authentication token and a list of usernames
return a displayname_catalog, that is a dictionary with the given
usernames as keys and the corresponding UUIDs as values.
Invalid usernames will not be in the dictionary.
In case of error raise an AstakosClientException exception.
**get_uuid(**\ token, display_name\ **)**
Given a valid authentication token and a username (as string)
Given a user's authentication token and a username (as string)
return the corresponding UUID (as string).
In case of invalid user name raise NoUUID exception.
In case of error raise an AstakosClientException exception.
......@@ -114,6 +118,58 @@ retry=0, use_pool=False, pool_size=8, logger=None\ **)**
**get_services()**
Return a list of dicts with the registered services.
**get_resources()**
Return a list of dicts with the available resources
**get_quotas(**\ token\ **)**
Given a user's authentication token return user's
current quotas (as dict of dicts).
In case of error raise an AstakosClientException exception.
**issue_commission(**\ token, request\ **)**
Given a service's authentication token issue a commission.
In case of success return commission's id (int).
Otherwise raise an AstakosClientException exception.
**issue_one_commission(**\ token, holder, source, provisions, force=False, auto_accept=False\ **)**
Given a service's authentication token issue a commission.
In this case we specify the holder, the source and the provisions
(a list of (string, int)) and astakosclient will create the
corresponding commission.
In case of success return commission's id (int).
Otherwise raise an AstakosClientException exception.
**get_pending_commissions(**\ token\ **)**
Given a service's authentication token return the pending
commissions (list of integers).
In case of error raise an AstakosClientException exception.
**get_commission_info(**\ token, serial\ **)**
Given a service's authentication token and the id of a
pending commission return a dict of dicts containting
informations (details) about the requested commission.
In case of error raise an AstakosClientException exception.
**commission_action(**\ token, serial, action\ **)**
Given a service's authentication token and the id of a
pending commission, request the specified action (currently
one of accept, reject).
In case of success returns nothing.
Otherwise raise an AstakosClientException exception.
**accept_commission(**\ token, serial\ **)**
Accept a pending commission (see commission_action).
**reject_commission(**\ token, serial\ **)**
Reject a pending commission (see commission_action).
**resolve_commissions(**\ token, accept_serials, reject_serials\ **)**
Accept or Reject many pending commissions at once.
In case of success return a dict of dicts describing which
commissions accepted, which rejected and which failed to
resolved.
Otherwise raise an AstakosClientException exception.
Public Functions
----------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment