Commit b4fcee5b authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

RAPI: Document all feature strings

- Use constants and an assertion
- Update documentation for node migration
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarIustin Pop <>
parent 21d70642
......@@ -330,10 +330,23 @@ Redistribute configuration to all nodes. The result will be a job id.
Returns a list of features supported by the RAPI server. Available
.. pyassert::
rlib2.ALL_FEATURES == set([rlib2._INST_CREATE_REQV1,
Instance creation request data version 1 supported.
Instance reinstall supports body parameters.
Whether migrating a node (``/2/nodes/[node_name]/migrate``) supports
request body parameters.
Whether evacuating a node (``/2/nodes/[node_name]/evacuate``) returns
a new-style result (see resource description)
......@@ -1192,13 +1205,14 @@ It supports the following commands: ``POST``.
If no mode is explicitly specified, each instances' hypervisor default
migration mode will be used. Query parameters:
migration mode will be used. Body parameters:
.. opcode_params:: OP_NODE_MIGRATE
:exclude: node_name
``live`` (bool)
If set, use live migration if available.
``mode`` (string)
Sets migration mode, ``live`` for live migration and ``non-live`` for
non-live migration. Supported by Ganeti 2.2 and above.
The query arguments used up to and including Ganeti 2.4 are deprecated
and should no longer be used. The new request format can be detected by
the presence of the :pyeval:`rlib2._NODE_MIGRATE_REQV1` feature string.
......@@ -39,12 +39,16 @@ from ganeti import errors
from ganeti import utils
from ganeti import opcodes
from ganeti import ht
from ganeti import rapi
import ganeti.rapi.rlib2
COMMON_PARAM_NAMES = map(operator.itemgetter(0), opcodes.OpCode.OP_PARAMS)
#: Namespace for evaluating expressions
EVAL_NS = dict(compat=compat, constants=constants, utils=utils, errors=errors)
EVAL_NS = dict(compat=compat, constants=constants, utils=utils, errors=errors,
class OpcodeError(sphinx.errors.SphinxError):
......@@ -110,6 +110,13 @@ _NODE_MIGRATE_REQV1 = "node-migrate-reqv1"
# Feature string for node evacuation with LU-generated jobs
_NODE_EVAC_RES1 = "node-evac-res1"
ALL_FEATURES = frozenset([
# Timeout for /2/jobs/[job_id]/wait. Gives job up to 10 seconds to change.
......@@ -151,8 +158,7 @@ class R_2_features(baserlib.R_Generic):
"""Returns list of optional RAPI features implemented.
return list(ALL_FEATURES)
class R_2_os(baserlib.R_Generic):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment