root / docs / astakos-api-guide.rst @ 7a8df455
History | View | Annotate | Download (4.4 kB)
1 |
Astakos API |
---|---|
2 |
=========== |
3 |
|
4 |
This is Astakos API guide. |
5 |
|
6 |
Overview |
7 |
-------- |
8 |
|
9 |
|
10 |
Astakos service co-ordinates the access to resources (and the subsequent |
11 |
permission model) and acts as the single point of registry and entry to the |
12 |
GRNET cloud services. |
13 |
|
14 |
This document's goals is to describe the APIs to the outer world. |
15 |
Make sure you have read the :ref:`astakos` general architecture first. |
16 |
|
17 |
Document Revisions |
18 |
^^^^^^^^^^^^^^^^^^ |
19 |
|
20 |
========================= ================================ |
21 |
Revision Description |
22 |
========================= ================================ |
23 |
0.1 (Feb 10, 2012) Initial release. |
24 |
========================= ================================ |
25 |
|
26 |
API Operations |
27 |
-------------- |
28 |
|
29 |
.. _authenticate-api-label: |
30 |
|
31 |
Authenticate |
32 |
^^^^^^^^^^^^ |
33 |
|
34 |
Authenticate API requests require a token. An application that wishes to connect to Astakos, but does not have a token, should redirect the user to ``/login``. (see :ref:`authentication-label`) |
35 |
|
36 |
==================== ========= ================== |
37 |
Uri Method Description |
38 |
==================== ========= ================== |
39 |
``/im/authenticate`` GET Authenticate user using token |
40 |
==================== ========= ================== |
41 |
|
42 |
| |
43 |
|
44 |
==================== =========================== |
45 |
Request Header Name Value |
46 |
==================== =========================== |
47 |
X-Auth-Token Authentication token |
48 |
==================== =========================== |
49 |
|
50 |
Extended information on the user serialized in the json format will be returned: |
51 |
|
52 |
=========================== ============================ |
53 |
Name Description |
54 |
=========================== ============================ |
55 |
username User uniq identifier |
56 |
uniq User email (uniq identifier used by Astakos) |
57 |
auth_token Authentication token |
58 |
auth_token_expires Token expiration date |
59 |
auth_token_created Token creation date |
60 |
has_credits Whether user has credits |
61 |
has_signed_terms Whether user has aggred on terms |
62 |
=========================== ============================ |
63 |
|
64 |
Example reply: |
65 |
|
66 |
:: |
67 |
|
68 |
{"username": "4ad9f34d6e7a4992b34502d40f40cb", |
69 |
"uniq": "papagian@example.com" |
70 |
"auth_token": "0000", |
71 |
"auth_token_expires": "Tue, 11-Sep-2012 09:17:14 ", |
72 |
"auth_token_created": "Sun, 11-Sep-2011 09:17:14 ", |
73 |
"has_credits": false, |
74 |
"has_signed_terms": true} |
75 |
|
76 |
| |
77 |
|
78 |
=========================== ===================== |
79 |
Return Code Description |
80 |
=========================== ===================== |
81 |
204 (No Content) The request succeeded |
82 |
400 (Bad Request) The request is invalid |
83 |
401 (Unauthorized) Missing token or inactive user or penging approval terms |
84 |
500 (Internal Server Error) The request cannot be completed because of an internal error |
85 |
=========================== ===================== |
86 |
|
87 |
Get Services |
88 |
^^^^^^^^^^^^ |
89 |
|
90 |
Returns a json formatted list containing information about the supported cloud services. |
91 |
|
92 |
==================== ========= ================== |
93 |
Uri Method Description |
94 |
==================== ========= ================== |
95 |
``/im/get_services`` GET Get cloud services |
96 |
==================== ========= ================== |
97 |
|
98 |
Example reply: |
99 |
|
100 |
:: |
101 |
|
102 |
[{"url": "/", "icon": "home-icon.png", "name": "grnet cloud", "id": "cloud"}, |
103 |
{"url": "/okeanos.html", "name": "~okeanos", "id": "okeanos"}, |
104 |
{"url": "/ui/", "name": "pithos+", "id": "pithos"}] |
105 |
|
106 |
Get Menu |
107 |
^^^^^^^^ |
108 |
|
109 |
Returns a json formatted list containing the cloud bar links. |
110 |
|
111 |
==================== ========= ================== |
112 |
Uri Method Description |
113 |
==================== ========= ================== |
114 |
``/im/get_menu`` GET Get cloud bar menu |
115 |
==================== ========= ================== |
116 |
|
117 |
| |
118 |
|
119 |
====================== ========================= |
120 |
Request Parameter Name Value |
121 |
====================== ========================= |
122 |
location Location to pass in the next parameter |
123 |
====================== ========================= |
124 |
|
125 |
Example reply if request user is not authenticated: |
126 |
|
127 |
:: |
128 |
|
129 |
[{"url": "/im/login?next=", "name": "login..."}] |
130 |
|
131 |
Example reply if request user is authenticated:: |
132 |
|
133 |
[{"url": "/im/profile", "name": "user@grnet.gr"}, |
134 |
{"url": "/im/profile", "name": "view your profile..."}, |
135 |
{"url": "/im/password", "name": "change your password..."}, |
136 |
{"url": "/im/feedback", "name": "feedback..."}, |
137 |
{"url": "/im/logout", "name": "logout..."}] |
138 |
|
139 |
|
140 |
|
141 |
|