Revision a4398c8c
b/docs/quota-api-guide.rst | ||
---|---|---|
123 | 123 |
.. code-block:: javascript |
124 | 124 |
|
125 | 125 |
{ |
126 |
"client_key": "cyclades", |
|
127 | 126 |
"force": false, |
128 | 127 |
"auto_accept": false, |
129 | 128 |
"provisions": [ |
... | ... | |
182 | 181 |
X-Auth-Token Service authentication token |
183 | 182 |
==================== ============================ |
184 | 183 |
|
185 |
====================== ====================== |
|
186 |
Request Parameter Name Value |
|
187 |
====================== ====================== |
|
188 |
client_key Quotaholder client key |
|
189 |
====================== ====================== |
|
190 |
|
|
191 | 184 |
**Normal Response Code**: 200 |
192 | 185 |
|
193 | 186 |
**Error Response Codes**: |
... | ... | |
216 | 209 |
X-Auth-Token Service authentication token |
217 | 210 |
==================== ============================ |
218 | 211 |
|
219 |
====================== ====================== |
|
220 |
Request Parameter Name Value |
|
221 |
====================== ====================== |
|
222 |
client_key Quotaholder client key |
|
223 |
====================== ====================== |
|
224 |
|
|
225 | 212 |
**Normal Response Code**: 200 |
226 | 213 |
|
227 | 214 |
**Error Response Codes**: |
... | ... | |
285 | 272 |
.. code-block:: javascript |
286 | 273 |
|
287 | 274 |
{ |
288 |
"client_key": "cyclades", |
|
289 | 275 |
"accept": "" |
290 | 276 |
} |
291 | 277 |
|
292 | 278 |
{ |
293 |
"client_key": "cyclades", |
|
294 | 279 |
"reject": "" |
295 | 280 |
} |
296 | 281 |
|
... | ... | |
321 | 306 |
.. code-block:: javascript |
322 | 307 |
|
323 | 308 |
{ |
324 |
"client_key": "cyclades", |
|
325 | 309 |
"accept": [56, 57], |
326 | 310 |
"reject": [56, 58, 59] |
327 | 311 |
} |
... | ... | |
349 | 333 |
] |
350 | 334 |
] |
351 | 335 |
} |
352 |
|
b/snf-astakos-app/astakos/api/quotas.py | ||
---|---|---|
74 | 74 |
@service_api_method(http_method='GET', token_required=True) |
75 | 75 |
def get_pending_commissions(request): |
76 | 76 |
data = request.GET |
77 |
client_key = data['client_key']
|
|
77 |
client_key = str(request.service_instance)
|
|
78 | 78 |
|
79 | 79 |
result = qh.get_pending_commissions(clientkey=client_key) |
80 | 80 |
return json_response(result) |
... | ... | |
86 | 86 |
data = request.raw_post_data |
87 | 87 |
input_data = json.loads(data) |
88 | 88 |
|
89 |
client_key = input_data['client_key']
|
|
89 |
client_key = str(request.service_instance)
|
|
90 | 90 |
provisions = input_data['provisions'] |
91 | 91 |
force = input_data.get('force', False) |
92 | 92 |
auto_accept = input_data.get('auto_accept', False) |
... | ... | |
159 | 159 |
data = request.raw_post_data |
160 | 160 |
input_data = json.loads(data) |
161 | 161 |
|
162 |
client_key = input_data['client_key']
|
|
162 |
client_key = str(request.service_instance)
|
|
163 | 163 |
accept = input_data.get('accept', []) |
164 | 164 |
reject = input_data.get('reject', []) |
165 | 165 |
|
... | ... | |
179 | 179 |
@service_api_method(http_method='GET', token_required=True) |
180 | 180 |
def get_commission(request, serial): |
181 | 181 |
data = request.GET |
182 |
client_key = data['client_key']
|
|
182 |
client_key = str(request.service_instance)
|
|
183 | 183 |
serial = int(serial) |
184 | 184 |
|
185 | 185 |
try: |
... | ... | |
199 | 199 |
input_data = json.loads(data) |
200 | 200 |
serial = int(serial) |
201 | 201 |
|
202 |
client_key = input_data['client_key']
|
|
202 |
client_key = str(request.service_instance)
|
|
203 | 203 |
|
204 | 204 |
accept = 'accept' in input_data |
205 | 205 |
reject = 'reject' in input_data |
b/snf-astakos-app/astakos/im/api/service.py | ||
---|---|---|
67 | 67 |
if service.auth_token_expires: |
68 | 68 |
if (time() - mktime(service.auth_token_expires.timetuple())) > 0: |
69 | 69 |
raise Unauthorized('Authentication expired') |
70 |
request.service_instance = service |
|
70 | 71 |
except Service.DoesNotExist, e: |
71 | 72 |
raise Unauthorized('Invalid X-Auth-Token') |
72 | 73 |
response = func(request, *args, **kwargs) |
Also available in: Unified diff