Commit 84b0517f authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Expose commission issue commands

Refs: #4115
parent 0155548b
......@@ -33,5 +33,5 @@ Features:
- Implement user_list/set/whoami to switch between session users [#3632, #3660]
- Expose more astakosclient methods in a 1to1 fashion [#4115]:
resources, feedback, endpoints,
......@@ -31,6 +31,8 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.command
from json import loads
from astakosclient import AstakosClient, AstakosClientException
from kamaki.cli import command
......@@ -428,12 +430,49 @@ class astakos_commission_resolve(_astakos_init, _optional_json):
super(self.__class__, self)._run()
# commission pending
# commission info
# commission action
# commission accept
# commission reject
# commission resolve
class astakos_commission_issue(_astakos_init, _optional_json):
"""Issue commissions as a json string (special privileges required)
holder -- user's id (string)
source -- commission's source (ex system) (string)
provisions -- resources with their quantity (json-dict from string to int)
name -- description of the commission (string)
arguments = dict(
force=FlagArgument('Force commission', '--force'),
accept=FlagArgument('Do not wait for verification', '--accept')
def _run(
self, holder, source, provisions, name=''):
provisions = loads(provisions)
self.token, holder, source, provisions, name,
self['force'], self['accept']))
def main(self, holder, source, provisions, name=''):
super(self.__class__, self)._run()
self._run(holder, source, provisions, name)
class astakos_commission_issuejson(_astakos_init, _optional_json):
"""Issue commissions as a json string (special privileges required)"""
def _run(self, info_json):
infodict = loads(info_json)
self._print(self.client.issue_commission(self.token, infodict))
def main(self, info_json):
super(self.__class__, self)._run()
# XXX issue_commission, issue_one_commission
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