It supports the ``force`` argument.
+``/2/nodes/[node_name]/storage``
+++++++++++++++++++++++++++++++++
+
+Manages storage units on the node.
+
+``GET``
+~~~~~~~
+
+Requests a list of storage units on a node. Requires the parameters
+``storage_type`` (one of ``file``, ``lvm-pv`` or ``lvm-vg``) and
+``output_fields``. The result will be a job id, using which the result can be
+retrieved.
+
``/2/nodes/[node_name]/tags``
+++++++++++++++++++++++++++++
rlib2.R_2_nodes_name_evacuate,
re.compile(r'^/2/nodes/([\w\._-]+)/migrate$'):
rlib2.R_2_nodes_name_migrate,
+ re.compile(r'^/2/nodes/([\w\._-]+)/storage$'):
+ rlib2.R_2_nodes_name_storage,
"/2/instances": rlib2.R_2_instances,
re.compile(r'^/2/instances/([\w\._-]+)$'): rlib2.R_2_instances_name,
re.compile(r'^/2/instances/([\w\._-]+)/tags$'): rlib2.R_2_instances_name_tags,
class R_2_nodes_name_migrate(baserlib.R_Generic):
- """/2/nodes/[node_name]/evacuate migrate.
+ """/2/nodes/[node_name]/migrate resource.
"""
def POST(self):
return baserlib.SubmitJob([op])
+class R_2_nodes_name_storage(baserlib.R_Generic):
+ """/2/nodes/[node_name]/storage ressource.
+
+ """
+ # LUQueryNodeStorage acquires locks, hence restricting access to GET
+ GET_ACCESS = [rapi.RAPI_ACCESS_WRITE]
+
+ def GET(self):
+ node_name = self.items[0]
+
+ storage_type = self._checkStringVariable("storage_type", None)
+ if not storage_type:
+ raise http.HttpBadRequest("Missing the required 'storage_type'"
+ " parameter")
+
+ output_fields = self._checkStringVariable("output_fields", None)
+ if not output_fields:
+ raise http.HttpBadRequest("Missing the required 'output_fields'"
+ " parameter")
+
+ op = opcodes.OpQueryNodeStorage(nodes=[node_name],
+ storage_type=storage_type,
+ output_fields=output_fields.split(","))
+ return baserlib.SubmitJob([op])
+
+
class R_2_instances(baserlib.R_Generic):
"""/2/instances resource.