Statistics
| Branch: | Tag: | Revision:

root / docs / astakos-api-guide.rst @ 2c85833e

History | View | Annotate | Download (4.4 kB)

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