Revision 29040fef
b/docs/commands.rst | ||
---|---|---|
10 | 10 |
.. code-block:: text |
11 | 11 |
|
12 | 12 |
authenticate: Authenticate a user |
13 |
admin userinfo: Get user info, (req. admin privileges) |
|
14 |
service userinfo: Get user info with service token |
|
15 |
service list: List cloud services associated with astakos |
|
16 | 13 |
|
17 | 14 |
Showcase: get user information |
18 | 15 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
... | ... | |
27 | 24 |
|
28 | 25 |
* Authenticate user * |
29 | 26 |
[astakos]:authenticate |
30 |
auth_token : s0m3t0k3nth@t1sr3m0v3d== |
|
31 | 27 |
auth_token_created: 2012-11-13T14:12:40.917034 |
32 | 28 |
auth_token_expires: 2012-12-13T14:12:40.917035 |
33 |
groups : |
|
34 |
default |
|
35 |
has_credits : False |
|
36 |
has_signed_terms : True |
|
37 |
uniq : myaccount@grnet.gr |
|
38 |
username : 4215th3b357num9323v32 |
|
39 |
|
|
40 |
Showcase: get available services |
|
41 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|
42 |
|
|
43 |
In the following, a user needs to know the urls he/she has access to. |
|
44 |
|
|
45 |
.. code-block:: console |
|
46 |
:emphasize-lines: 1,4 |
|
47 |
|
|
48 |
* Enter appropriate context * |
|
49 |
[kamaki]:astakos service |
|
50 |
|
|
51 |
* list services * |
|
52 |
[astakos service]:list |
|
53 |
1 grnet cloud |
|
54 |
icon: home-icon.png |
|
55 |
url : https://okeanos.grnet.gr/ |
|
56 |
2 cyclades |
|
57 |
icon: |
|
58 |
url : https://cyclades.okeanos.grnet.gr/ui/ |
|
59 |
3 pithos+ |
|
60 |
icon: |
|
61 |
url : https://pithos.okeanos.grnet.gr/ui/ |
|
62 |
|
|
29 |
email : |
|
30 |
myaccount@grnet.gr |
|
31 |
myotheraccount@grnet.gr |
|
32 |
name : My Real Name |
|
33 |
username : usually@an.email.org |
|
34 |
uuid : ab1cde23-45fg-6h7i-8j9k-10l1m11no2pq |
|
63 | 35 |
|
64 | 36 |
flavor (Compute/Cyclades) |
65 | 37 |
------------------------- |
b/docs/man/kamaki.rst | ||
---|---|---|
112 | 112 |
astakos commands |
113 | 113 |
**************** |
114 | 114 |
|
115 |
* admin userinfo Get user info, provided you have admin privileges |
|
116 | 115 |
* authenticate Authenticate a user, show user information |
117 |
* service list List cloud services associated with astakos |
|
118 |
* service userinfo Get user info with service token |
|
119 | 116 |
|
120 | 117 |
|
121 | 118 |
server commands |
b/docs/usage.rst | ||
---|---|---|
260 | 260 |
Example 3.4.1: Print username for token us3rt0k3n== using grep |
261 | 261 |
|
262 | 262 |
|
263 |
$ kamaki astakos authenticate -o token=us3rt0k3n== | grep uniq
|
|
264 |
uniq : user@synnefo.org
|
|
263 |
$ kamaki astakos authenticate -o token=us3rt0k3n== | grep userame
|
|
264 |
userame : user@synnefo.org
|
|
265 | 265 |
|
266 | 266 |
The -o argument can be used to override temporarily various (set or unset) options. In one command, all -o options are forgotten just after the command had been completed, and the previous settings are restored (the configuration file is not modified). |
267 | 267 |
|
b/kamaki/clients/astakos.py | ||
---|---|---|
53 | 53 |
return self._cache[token] |
54 | 54 |
|
55 | 55 |
def list(self): |
56 |
"""list cached user information""" |
|
56 | 57 |
return self._cache.values() |
57 | 58 |
|
58 | 59 |
def _user_info(self, token=None): |
b/kamaki/clients/tests/astakos.py | ||
---|---|---|
66 | 66 |
'username'): |
67 | 67 |
self.assertEqual(self.client.term(term), self['astakos', term]) |
68 | 68 |
self.assertTrue(self['astakos', 'email'] in self.client.term('email')) |
69 |
|
|
70 |
def test_list(self): |
|
71 |
self.client.authenticate() |
|
72 |
self._test_list() |
|
73 |
|
|
74 |
def _test_list(self): |
|
75 |
terms = set(['name', 'username', 'uuid', 'email']) |
|
76 |
uuid = 0 |
|
77 |
for r in self.client.list(): |
|
78 |
print('Hum?') |
|
79 |
self.assertTrue(terms.issubset(r.keys())) |
|
80 |
self.assertTrue(uuid != r['uuid'] if uuid else True) |
|
81 |
uuid = r['uuid'] |
Also available in: Unified diff