Revision 7a95a954
b/doc/rapi.rst | ||
---|---|---|
528 | 528 |
|
529 | 529 |
It supports the ``force`` argument. |
530 | 530 |
|
531 |
``/2/nodes/[node_name]/storage`` |
|
532 |
++++++++++++++++++++++++++++++++ |
|
533 |
|
|
534 |
Manages storage units on the node. |
|
535 |
|
|
536 |
``GET`` |
|
537 |
~~~~~~~ |
|
538 |
|
|
539 |
Requests a list of storage units on a node. Requires the parameters |
|
540 |
``storage_type`` (one of ``file``, ``lvm-pv`` or ``lvm-vg``) and |
|
541 |
``output_fields``. The result will be a job id, using which the result can be |
|
542 |
retrieved. |
|
543 |
|
|
531 | 544 |
``/2/nodes/[node_name]/tags`` |
532 | 545 |
+++++++++++++++++++++++++++++ |
533 | 546 |
|
b/lib/rapi/connector.py | ||
---|---|---|
159 | 159 |
rlib2.R_2_nodes_name_evacuate, |
160 | 160 |
re.compile(r'^/2/nodes/([\w\._-]+)/migrate$'): |
161 | 161 |
rlib2.R_2_nodes_name_migrate, |
162 |
re.compile(r'^/2/nodes/([\w\._-]+)/storage$'): |
|
163 |
rlib2.R_2_nodes_name_storage, |
|
162 | 164 |
"/2/instances": rlib2.R_2_instances, |
163 | 165 |
re.compile(r'^/2/instances/([\w\._-]+)$'): rlib2.R_2_instances_name, |
164 | 166 |
re.compile(r'^/2/instances/([\w\._-]+)/tags$'): rlib2.R_2_instances_name_tags, |
b/lib/rapi/rlib2.py | ||
---|---|---|
281 | 281 |
|
282 | 282 |
|
283 | 283 |
class R_2_nodes_name_migrate(baserlib.R_Generic): |
284 |
"""/2/nodes/[node_name]/evacuate migrate.
|
|
284 |
"""/2/nodes/[node_name]/migrate resource.
|
|
285 | 285 |
|
286 | 286 |
""" |
287 | 287 |
def POST(self): |
... | ... | |
296 | 296 |
return baserlib.SubmitJob([op]) |
297 | 297 |
|
298 | 298 |
|
299 |
class R_2_nodes_name_storage(baserlib.R_Generic): |
|
300 |
"""/2/nodes/[node_name]/storage ressource. |
|
301 |
|
|
302 |
""" |
|
303 |
# LUQueryNodeStorage acquires locks, hence restricting access to GET |
|
304 |
GET_ACCESS = [rapi.RAPI_ACCESS_WRITE] |
|
305 |
|
|
306 |
def GET(self): |
|
307 |
node_name = self.items[0] |
|
308 |
|
|
309 |
storage_type = self._checkStringVariable("storage_type", None) |
|
310 |
if not storage_type: |
|
311 |
raise http.HttpBadRequest("Missing the required 'storage_type'" |
|
312 |
" parameter") |
|
313 |
|
|
314 |
output_fields = self._checkStringVariable("output_fields", None) |
|
315 |
if not output_fields: |
|
316 |
raise http.HttpBadRequest("Missing the required 'output_fields'" |
|
317 |
" parameter") |
|
318 |
|
|
319 |
op = opcodes.OpQueryNodeStorage(nodes=[node_name], |
|
320 |
storage_type=storage_type, |
|
321 |
output_fields=output_fields.split(",")) |
|
322 |
return baserlib.SubmitJob([op]) |
|
323 |
|
|
324 |
|
|
299 | 325 |
class R_2_instances(baserlib.R_Generic): |
300 | 326 |
"""/2/instances resource. |
301 | 327 |
|
Also available in: Unified diff