diff --git a/astakosclient/astakosclient/__init__.py b/astakosclient/astakosclient/__init__.py index 4c6b199dffbf9c0198cd0c176873796d38e191fd..839701aa8823769a363aab16f14a1396c56a7c8f 100644 --- a/astakosclient/astakosclient/__init__.py +++ b/astakosclient/astakosclient/__init__.py @@ -323,6 +323,21 @@ class AstakosClient(): """ return self._call_astakos(token, "/astakos/api/quotas") + # ---------------------------------- + # GET "/astakos/api/service_quotas" + def get_service_quotas(self, token): + """Get all quotas for resources associated with the service + + Keyword arguments: + token -- service's token (string) + + In case of success return a dict of dicts of dicts with current quotas + for all users. + Otherwise raise an AstakosClientException + + """ + return self._call_astakos(token, "/astakos/api/service_quotas") + # ---------------------------------- # POST "/astakos/api/commisions" def issue_commission(self, token, request): diff --git a/astakosclient/docs/index.rst b/astakosclient/docs/index.rst index f0cfcd9adda20e9f5e92731d68515c9e0d4377d7..3a4a64cd9d94ea3d655b655007d432e1382b87f2 100644 --- a/astakosclient/docs/index.rst +++ b/astakosclient/docs/index.rst @@ -19,6 +19,7 @@ authentication token for: * Usernames for given UUIDs * UUIDs for given usernames + * Quotas for all related resources * Issue commissions * Get pending commissions * Accept or reject commissions @@ -126,6 +127,12 @@ retry=0, use_pool=False, pool_size=8, logger=None\ **)** current quotas (as dict of dicts). In case of error raise an AstakosClientException exception. + **get_service_quotas(**\ token\ **)** + Given a service's authentication token return all users' + current quotas for the resources associated with the service + (as dict of dicts 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).