Revision 1c482bab
b/doc/rapi.rst | ||
---|---|---|
480 | 480 |
evacuate?iallocator=[iallocator] |
481 | 481 |
evacuate?remote_node=[nodeX.example.com] |
482 | 482 |
|
483 |
``/2/nodes/[node_name]/migrate`` |
|
484 |
+++++++++++++++++++++++++++++++++ |
|
485 |
|
|
486 |
Migrates all primary instances from a node. |
|
487 |
|
|
488 |
It supports the following commands: ``POST``. |
|
489 |
|
|
490 |
``POST`` |
|
491 |
~~~~~~~~ |
|
492 |
|
|
493 |
No parameters are required, but ``live`` can be set to a boolean value. |
|
494 |
|
|
495 |
migrate?live=[0|1] |
|
496 |
|
|
483 | 497 |
``/2/nodes/[node_name]/role`` |
484 | 498 |
+++++++++++++++++++++++++++++ |
485 | 499 |
|
b/lib/rapi/connector.py | ||
---|---|---|
157 | 157 |
re.compile(r'^/2/nodes/([\w\._-]+)/role$'): rlib2.R_2_nodes_name_role, |
158 | 158 |
re.compile(r'^/2/nodes/([\w\._-]+)/evacuate$'): |
159 | 159 |
rlib2.R_2_nodes_name_evacuate, |
160 |
re.compile(r'^/2/nodes/([\w\._-]+)/migrate$'): |
|
161 |
rlib2.R_2_nodes_name_migrate, |
|
160 | 162 |
"/2/instances": rlib2.R_2_instances, |
161 | 163 |
re.compile(r'^/2/instances/([\w\._-]+)$'): rlib2.R_2_instances_name, |
162 | 164 |
re.compile(r'^/2/instances/([\w\._-]+)/tags$'): rlib2.R_2_instances_name_tags, |
b/lib/rapi/rlib2.py | ||
---|---|---|
280 | 280 |
return baserlib.SubmitJob([op]) |
281 | 281 |
|
282 | 282 |
|
283 |
class R_2_nodes_name_migrate(baserlib.R_Generic): |
|
284 |
"""/2/nodes/[node_name]/evacuate migrate. |
|
285 |
|
|
286 |
""" |
|
287 |
def POST(self): |
|
288 |
"""Migrate all primary instances from a node. |
|
289 |
|
|
290 |
""" |
|
291 |
node_name = self.items[0] |
|
292 |
live = bool(self._checkIntVariable("live", default=1)) |
|
293 |
|
|
294 |
op = opcodes.OpMigrateNode(node_name=node_name, live=live) |
|
295 |
|
|
296 |
return baserlib.SubmitJob([op]) |
|
297 |
|
|
298 |
|
|
283 | 299 |
class R_2_instances(baserlib.R_Generic): |
284 | 300 |
"""/2/instances resource. |
285 | 301 |
|
Also available in: Unified diff