Revision 567f49a2
b/astakosclient/astakosclient/__init__.py | ||
---|---|---|
402 | 402 |
request["name"] = name |
403 | 403 |
try: |
404 | 404 |
request["provisions"] = [] |
405 |
for p in provisions: |
|
406 |
resource = p[0] |
|
407 |
quantity = p[1] |
|
405 |
for resource, quantity in provisions.iteritems(): |
|
408 | 406 |
t = {"holder": holder, "source": source, |
409 | 407 |
"resource": resource, "quantity": quantity} |
410 | 408 |
request["provisions"].append(t) |
b/astakosclient/astakosclient/tests.py | ||
---|---|---|
954 | 954 |
client = AstakosClient("https://example.com") |
955 | 955 |
response = client.issue_one_commission( |
956 | 956 |
token_1, "c02f315b-7d84-45bc-a383-552a3f97d2ad", |
957 |
"system", [("cyclades.vm", 1), ("cyclades.ram", 30000)])
|
|
957 |
"system", {"cyclades.vm": 1, "cyclades.ram": 30000})
|
|
958 | 958 |
except Exception as err: |
959 | 959 |
self.fail("Shouldn't have raised Exception %s" % err) |
960 | 960 |
self.assertEqual(response, commission_successful_response['serial']) |
b/astakosclient/docs/index.rst | ||
---|---|---|
143 | 143 |
**issue_one_commission(**\ token, holder, source, provisions, name="", force=False, auto_accept=False\ **)** |
144 | 144 |
Given a service's authentication token issue a commission. |
145 | 145 |
In this case we specify the holder, the source and the provisions |
146 |
(a list of (string, int)) and astakosclient will create the
|
|
146 |
(a dict from string to int) and astakosclient will create the
|
|
147 | 147 |
corresponding commission. |
148 | 148 |
In case of success return commission's id (int). |
149 | 149 |
Otherwise raise an AstakosClientException exception. |
Also available in: Unified diff