4 Documents Ganeti version |version|
11 Ganeti supports a remote API for enable external tools to easily
12 retrieve information about a cluster's state. The remote API daemon,
13 *ganeti-rapi*, is automatically started on the master node. By default
14 it runs on TCP port 5080, but this can be changed either in
15 ``.../constants.py`` or via the command line parameter *-p*. SSL mode,
16 which is used by default, can also be disabled by passing command line
23 ``ganeti-rapi`` reads users and passwords from a file (usually
24 ``/var/lib/ganeti/rapi/users``) on startup. Changes to the file will be
27 Each line consists of two or three fields separated by whitespace. The
28 first two fields are for username and password. The third field is
29 optional and can be used to specify per-user options. Currently,
30 ``write`` is the only option supported and enables the user to execute
31 operations modifying the cluster. Lines starting with the hash sign
32 (``#``) are treated as comments.
34 Passwords can either be written in clear text or as a hash. Clear text
35 passwords may not start with an opening brace (``{``) or they must be
36 prefixed with ``{cleartext}``. To use the hashed form, get the MD5 hash
37 of the string ``$username:Ganeti Remote API:$password`` (e.g. ``echo -n
38 'jack:Ganeti Remote API:abc123' | openssl md5``) [#pwhash]_ and prefix
39 it with ``{ha1}``. Using the scheme prefix for all passwords is
40 recommended. Scheme prefixes are not case sensitive.
44 # Give Jack and Fred read-only access
46 fred {cleartext}foo555
48 # Give write access to an imaginary instance creation script
49 autocreator xyz789 write
51 # Hashed password for Jessica
52 jessica {HA1}7046452df2cbb530877058712cf17bd4 write
55 .. [#pwhash] Using the MD5 hash of username, realm and password is
56 described in :rfc:`2617` ("HTTP Authentication"), sections 3.2.2.2 and
57 3.3. The reason for using it over another algorithm is forward
58 compatibility. If ``ganeti-rapi`` were to implement HTTP Digest
59 authentication in the future, the same hash could be used.
60 In the current version ``ganeti-rapi``'s realm, ``Ganeti Remote
61 API``, can only be changed by modifying the source code.
67 The protocol used is JSON_ over HTTP designed after the REST_ principle.
68 HTTP Basic authentication as per :rfc:`2617` is supported.
70 .. _JSON: http://www.json.org/
71 .. _REST: http://en.wikipedia.org/wiki/Representational_State_Transfer
74 A note on JSON as used by RAPI
75 ++++++++++++++++++++++++++++++
77 JSON_ as used by Ganeti RAPI does not conform to the specification in
78 :rfc:`4627`. Section 2 defines a JSON text to be either an object
79 (``{"key": "value", …}``) or an array (``[1, 2, 3, …]``). In violation
80 of this RAPI uses plain strings (``"master-candidate"``, ``"1234"``) for
81 some requests or responses. Changing this now would likely break
82 existing clients and cause a lot of trouble.
86 Unlike Python's `JSON encoder and decoder
87 <http://docs.python.org/library/json.html>`_, other programming
88 languages or libraries may only provide a strict implementation, not
89 allowing plain values. For those, responses can usually be wrapped in an
90 array whose first element is then used, e.g. the response ``"1234"``
91 becomes ``["1234"]``. This works equally well for more complex values.
96 # Insert code to get response here
99 decoded = JSON.parse("[#{response}]").first
101 Short of modifying the encoder to allow encoding to a less strict
102 format, requests will have to be formatted by hand. Newer RAPI requests
103 already use a dictionary as their input data and shouldn't cause any
110 According to :rfc:`2616` the main difference between PUT and POST is
111 that POST can create new resources but PUT can only create the resource
112 the URI was pointing to on the PUT request.
114 Unfortunately, due to historic reasons, the Ganeti RAPI library is not
115 consistent with this usage, so just use the methods as documented below
118 For more details have a look in the source code at
119 ``lib/rapi/rlib2.py``.
122 Generic parameter types
123 -----------------------
125 A few generic refered parameter types and the values they allow.
130 A boolean option will accept ``1`` or ``0`` as numbers but not
131 i.e. ``True`` or ``False``.
136 A few parameter mean the same thing across all resources which implement
142 Bulk-mode means that for the resources which usually return just a list
143 of child resources (e.g. ``/2/instances`` which returns just instance
144 names), the output will instead contain detailed data for all these
145 subresources. This is more efficient than query-ing the sub-resources
151 The boolean *dry-run* argument, if provided and set, signals to Ganeti
152 that the job should not be executed, only the pre-execution checks will
155 This is useful in trying to determine (without guarantees though, as in
156 the meantime the cluster state could have changed) if the operation is
157 likely to succeed or at least start executing.
162 Force operation to continue even if it will cause the cluster to become
163 inconsistent (e.g. because there are not enough master candidates).
168 You can access the API using your favorite programming language as long
169 as it supports network connections.
174 Ganeti includes a standalone RAPI client, ``lib/rapi/client.py``.
183 wget -q -O - https://CLUSTERNAME:5080/2/info
187 curl https://CLUSTERNAME:5080/2/info
193 .. highlight:: python
198 f = urllib2.urlopen('https://CLUSTERNAME:5080/2/info')
205 .. warning:: While it's possible to use JavaScript, it poses several
206 potential problems, including browser blocking request due to
207 non-standard ports or different domain names. Fetching the data on
208 the webserver is easier.
210 .. highlight:: javascript
214 var url = 'https://CLUSTERNAME:5080/2/info';
216 var xmlreq = new XMLHttpRequest();
217 xmlreq.onreadystatechange = function () {
218 if (xmlreq.readyState != 4) return;
219 if (xmlreq.status == 200) {
220 info = eval("(" + xmlreq.responseText + ")");
223 alert('Error fetching cluster info');
227 xmlreq.open('GET', url, true);
233 .. highlight:: javascript
240 It supports the following commands: ``GET``.
245 Shows the list of mapped resources.
247 Returns: a dictionary with 'name' and 'uri' keys for each of them.
252 The ``/2`` resource, the root of the version 2 API.
254 It supports the following commands: ``GET``.
259 Show the list of mapped resources.
261 Returns: a dictionary with ``name`` and ``uri`` keys for each of them.
266 Cluster information resource.
268 It supports the following commands: ``GET``.
273 Returns cluster information.
278 "config_version": 2000000,
280 "software_version": "2.0.0~beta2",
281 "os_api_version": 10,
283 "candidate_pool_size": 10,
284 "enabled_hypervisors": [
290 "default_hypervisor": "fake",
291 "master": "node1.example.com",
296 "protocol_version": 20,
299 "auto_balance": true,
307 ``/2/redistribute-config``
308 ++++++++++++++++++++++++++
310 Redistribute configuration to all nodes.
312 It supports the following commands: ``PUT``.
317 Redistribute configuration to all nodes. The result will be a job id.
326 Returns a list of features supported by the RAPI server. Available
329 ``instance-create-reqv1``
330 Instance creation request data version 1 supported.
331 ``instance-reinstall-reqv1``
332 Instance reinstall supports body parameters.
336 ++++++++++++++++++++++++++++++++++++++++
338 Modifies cluster parameters.
340 Supports the following commands: ``PUT``.
351 ``enabled_hypervisors`` (list)
352 List of enabled hypervisors.
354 Cluster-wide hypervisor parameter defaults, hypervisor-dependent.
356 Cluster-wide backend parameter defaults.
358 Cluster-wide per-OS hypervisor parameter defaults.
360 Dictionary with OS parameters.
361 ``candidate_pool_size`` (int)
362 Master candidate pool size.
364 Set UID pool. Must be list of lists describing UID ranges (two items,
365 start and end inclusive).
367 Extend UID pool. Must be list of lists describing UID ranges (two
368 items, start and end inclusive) to be added.
370 Shrink UID pool. Must be list of lists describing UID ranges (two
371 items, start and end inclusive) to be removed.
372 ``maintain_node_health`` (bool)
373 Whether to automatically maintain node health.
374 ``prealloc_wipe_disks`` (bool)
375 Whether to wipe disks before allocating them to instances.
377 Cluster-wide NIC parameter defaults.
379 Cluster-wide node parameter defaults.
380 ``drbd_helper`` (string)
382 ``default_iallocator`` (string)
383 Default iallocator for cluster.
384 ``master_netdev`` (string)
385 Master network device.
386 ``reserved_lvs`` (list)
387 List of reserved LVs (strings).
389 List of modifications as lists. Each modification must have two items,
390 the operation and the OS name. The operation can be ``add`` or
392 ``blacklisted_os`` (list)
393 List of modifications as lists. Each modification must have two items,
394 the operation and the OS name. The operation can be ``add`` or
403 It supports the following commands: ``GET``, ``POST``.
408 Returns a list of all existing node groups.
415 "uri": "\/2\/groups\/group1"
419 "uri": "\/2\/groups\/group2"
423 If the optional bool *bulk* argument is provided and set to a true value
424 (i.e ``?bulk=1``), the output contains detailed information about node
437 "uuid": "0d7d407c-262e-49af-881a-6a430034bf43"
445 "uuid": "f5a277e7-68f9-44d3-a378-4b25ecb5df5c"
452 Creates a node group.
454 If the optional bool *dry-run* argument is provided, the job will not be
455 actually executed, only the pre-execution checks will be done.
457 Returns: a job ID that can be used later for polling.
461 ``name`` (string, required)
465 ``/2/groups/[group_name]``
466 ++++++++++++++++++++++++++
468 Returns information about a node group.
470 It supports the following commands: ``GET``, ``DELETE``.
475 Returns information about a node group, similar to the bulk output from
481 Deletes a node group.
483 It supports the ``dry-run`` argument.
486 ``/2/groups/[group_name]/modify``
487 +++++++++++++++++++++++++++++++++
489 Modifies the parameters of a node group.
491 Supports the following commands: ``PUT``.
500 ``alloc_policy`` (string)
501 If present, the new allocation policy for the node group.
504 ``/2/groups/[group_name]/rename``
505 +++++++++++++++++++++++++++++++++
507 Renames a node group.
509 Supports the following commands: ``PUT``.
518 ``new_name`` (string, required)
522 ``/2/groups/[group_name]/assign-nodes``
523 +++++++++++++++++++++++++++++++++++++++
525 Assigns nodes to a group.
527 Supports the following commands: ``PUT``.
532 Returns a job ID. It supports the ``dry-run`` and ``force`` arguments.
536 ``nodes`` (list, required)
537 One or more nodes to assign to the group.
543 The instances resource.
545 It supports the following commands: ``GET``, ``POST``.
550 Returns a list of all available instances.
556 "name": "web.example.com",
557 "uri": "\/instances\/web.example.com"
560 "name": "mail.example.com",
561 "uri": "\/instances\/mail.example.com"
565 If the optional bool *bulk* argument is provided and set to a true value
566 (i.e ``?bulk=1``), the output contains detailed information about
578 "name": "web.example.com",
579 "tags": ["tag1", "tag2"],
587 "pnode": "node1.example.com",
588 "nic.macs": ["01:23:45:67:89:01"],
589 "snodes": ["node2.example.com"],
590 "disk_template": "drbd",
604 If the optional bool *dry-run* argument is provided, the job will not be
605 actually executed, only the pre-execution checks will be done. Query-ing
606 the job result will return, in both dry-run and normal case, the list of
607 nodes selected for the instance.
609 Returns: a job ID that can be used later for polling.
613 ``__version__`` (int, required)
614 Must be ``1`` (older Ganeti versions used a different format for
615 instance creation requests, version ``0``, but that format is not
617 ``mode`` (string, required)
618 Instance creation mode.
619 ``name`` (string, required)
621 ``disk_template`` (string, required)
622 Disk template for instance.
623 ``disks`` (list, required)
624 List of disk definitions. Example: ``[{"size": 100}, {"size": 5}]``.
625 Each disk definition must contain a ``size`` value and can contain an
626 optional ``mode`` value denoting the disk access mode (``ro`` or
628 ``nics`` (list, required)
629 List of NIC (network interface) definitions. Example: ``[{}, {},
630 {"ip": "198.51.100.4"}]``. Each NIC definition can contain the
631 optional values ``ip``, ``mode``, ``link`` and ``bridge``.
632 ``os`` (string, required)
633 Instance operating system.
634 ``osparams`` (dictionary)
635 Dictionary with OS parameters. If not valid for the given OS, the job
637 ``force_variant`` (bool)
638 Whether to force an unknown variant.
639 ``no_install`` (bool)
640 Do not install the OS (will enable no-start)
645 ``src_node`` (string)
646 Source node for import.
647 ``src_path`` (string)
648 Source directory for import.
650 Whether to start instance after creation.
652 Whether to ensure instance's IP address is inactive.
653 ``name_check`` (bool)
654 Whether to ensure instance's name is resolvable.
655 ``file_storage_dir`` (string)
656 File storage directory.
657 ``file_driver`` (string)
659 ``iallocator`` (string)
660 Instance allocator name.
661 ``source_handshake`` (list)
662 Signed handshake from source (remote import only).
663 ``source_x509_ca`` (string)
664 Source X509 CA in PEM format (remote import only).
665 ``source_instance_name`` (string)
666 Source instance name (remote import only).
667 ``hypervisor`` (string)
670 Hypervisor parameters, hypervisor-dependent.
675 ``/2/instances/[instance_name]``
676 ++++++++++++++++++++++++++++++++
678 Instance-specific resource.
680 It supports the following commands: ``GET``, ``DELETE``.
685 Returns information about an instance, similar to the bulk output from
693 It supports the ``dry-run`` argument.
696 ``/2/instances/[instance_name]/info``
697 +++++++++++++++++++++++++++++++++++++++
699 It supports the following commands: ``GET``.
704 Requests detailed information about the instance. An optional parameter,
705 ``static`` (bool), can be set to return only static information from the
706 configuration without querying the instance's nodes. The result will be
710 ``/2/instances/[instance_name]/reboot``
711 +++++++++++++++++++++++++++++++++++++++
713 Reboots URI for an instance.
715 It supports the following commands: ``POST``.
720 Reboots the instance.
722 The URI takes optional ``type=soft|hard|full`` and
723 ``ignore_secondaries=0|1`` parameters.
725 ``type`` defines the reboot type. ``soft`` is just a normal reboot,
726 without terminating the hypervisor. ``hard`` means full shutdown
727 (including terminating the hypervisor process) and startup again.
728 ``full`` is like ``hard`` but also recreates the configuration from
729 ground up as if you would have done a ``gnt-instance shutdown`` and
730 ``gnt-instance start`` on it.
732 ``ignore_secondaries`` is a bool argument indicating if we start the
733 instance even if secondary disks are failing.
735 It supports the ``dry-run`` argument.
738 ``/2/instances/[instance_name]/shutdown``
739 +++++++++++++++++++++++++++++++++++++++++
741 Instance shutdown URI.
743 It supports the following commands: ``PUT``.
748 Shutdowns an instance.
750 It supports the ``dry-run`` argument.
753 ``/2/instances/[instance_name]/startup``
754 ++++++++++++++++++++++++++++++++++++++++
756 Instance startup URI.
758 It supports the following commands: ``PUT``.
765 The URI takes an optional ``force=1|0`` parameter to start the
766 instance even if secondary disks are failing.
768 It supports the ``dry-run`` argument.
770 ``/2/instances/[instance_name]/reinstall``
771 ++++++++++++++++++++++++++++++++++++++++++++++
773 Installs the operating system again.
775 It supports the following commands: ``POST``.
784 ``os`` (string, required)
785 Instance operating system.
786 ``start`` (bool, defaults to true)
787 Whether to start instance after reinstallation.
789 Dictionary with (temporary) OS parameters.
791 For backwards compatbility, this resource also takes the query
792 parameters ``os`` (OS template name) and ``nostartup`` (bool). New
793 clients should use the body parameters.
796 ``/2/instances/[instance_name]/replace-disks``
797 ++++++++++++++++++++++++++++++++++++++++++++++
799 Replaces disks on an instance.
801 It supports the following commands: ``POST``.
806 Takes the parameters ``mode`` (one of ``replace_on_primary``,
807 ``replace_on_secondary``, ``replace_new_secondary`` or
808 ``replace_auto``), ``disks`` (comma separated list of disk indexes),
809 ``remote_node`` and ``iallocator``.
811 Either ``remote_node`` or ``iallocator`` needs to be defined when using
812 ``mode=replace_new_secondary``.
814 ``mode`` is a mandatory parameter. ``replace_auto`` tries to determine
815 the broken disk(s) on its own and replacing it.
818 ``/2/instances/[instance_name]/activate-disks``
819 +++++++++++++++++++++++++++++++++++++++++++++++
821 Activate disks on an instance.
823 It supports the following commands: ``PUT``.
828 Takes the bool parameter ``ignore_size``. When set ignore the recorded
829 size (useful for forcing activation when recorded size is wrong).
832 ``/2/instances/[instance_name]/deactivate-disks``
833 +++++++++++++++++++++++++++++++++++++++++++++++++
835 Deactivate disks on an instance.
837 It supports the following commands: ``PUT``.
845 ``/2/instances/[instance_name]/disk/[disk_index]/grow``
846 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
848 Grows one disk of an instance.
850 Supports the following commands: ``POST``.
859 ``amount`` (int, required)
860 Amount of disk space to add.
861 ``wait_for_sync`` (bool)
862 Whether to wait for the disk to synchronize.
865 ``/2/instances/[instance_name]/prepare-export``
866 +++++++++++++++++++++++++++++++++++++++++++++++++
868 Prepares an export of an instance.
870 It supports the following commands: ``PUT``.
875 Takes one parameter, ``mode``, for the export mode. Returns a job ID.
878 ``/2/instances/[instance_name]/export``
879 +++++++++++++++++++++++++++++++++++++++++++++++++
883 It supports the following commands: ``PUT``.
894 ``destination`` (required)
895 Destination information, depends on export mode.
896 ``shutdown`` (bool, required)
897 Whether to shutdown instance before export.
898 ``remove_instance`` (bool)
899 Whether to remove instance after export.
901 Name of X509 key (remote export only).
902 ``destination_x509_ca``
903 Destination X509 CA (remote export only).
906 ``/2/instances/[instance_name]/migrate``
907 ++++++++++++++++++++++++++++++++++++++++
909 Migrates an instance.
911 Supports the following commands: ``PUT``.
923 Whether a previously failed migration should be cleaned up.
926 ``/2/instances/[instance_name]/rename``
927 ++++++++++++++++++++++++++++++++++++++++
931 Supports the following commands: ``PUT``.
940 ``new_name`` (string, required)
943 Whether to ensure instance's IP address is inactive.
944 ``name_check`` (bool)
945 Whether to ensure instance's name is resolvable.
948 ``/2/instances/[instance_name]/modify``
949 ++++++++++++++++++++++++++++++++++++++++
951 Modifies an instance.
953 Supports the following commands: ``PUT``.
963 Dictionary with OS parameters.
965 Hypervisor parameters, hypervisor-dependent.
969 Whether to force the operation.
971 List of NIC changes. Each item is of the form ``(op, settings)``.
972 ``op`` can be ``add`` to add a new NIC with the specified settings,
973 ``remove`` to remove the last NIC or a number to modify the settings
974 of the NIC with that index.
976 List of disk changes. See ``nics``.
977 ``disk_template`` (string)
978 Disk template for instance.
979 ``remote_node`` (string)
980 Secondary node (used when changing disk template).
982 Change instance's OS name. Does not reinstall the instance.
983 ``force_variant`` (bool)
984 Whether to force an unknown variant.
987 ``/2/instances/[instance_name]/tags``
988 +++++++++++++++++++++++++++++++++++++
990 Manages per-instance tags.
992 It supports the following commands: ``GET``, ``PUT``, ``DELETE``.
997 Returns a list of tags.
1001 ["tag1", "tag2", "tag3"]
1008 The request as a list of strings should be ``PUT`` to this URI. The
1009 result will be a job id.
1011 It supports the ``dry-run`` argument.
1019 In order to delete a set of tags, the DELETE request should be addressed
1022 /tags?tag=[tag]&tag=[tag]
1024 It supports the ``dry-run`` argument.
1030 The ``/2/jobs`` resource.
1032 It supports the following commands: ``GET``.
1037 Returns a dictionary of jobs.
1039 Returns: a dictionary with jobs id and uri.
1041 ``/2/jobs/[job_id]``
1042 ++++++++++++++++++++
1047 It supports the following commands: ``GET``, ``DELETE``.
1052 Returns a job status.
1054 Returns: a dictionary with job parameters.
1056 The result includes:
1058 - id: job ID as a number
1059 - status: current job status as a string
1060 - ops: involved OpCodes as a list of dictionaries for each opcodes in
1062 - opstatus: OpCodes status as a list
1063 - opresult: OpCodes results as a list
1065 For a successful opcode, the ``opresult`` field corresponding to it will
1066 contain the raw result from its :term:`LogicalUnit`. In case an opcode
1067 has failed, its element in the opresult list will be a list of two
1070 - first element the error type (the Ganeti internal error name)
1071 - second element a list of either one or two elements:
1073 - the first element is the textual error description
1074 - the second element, if any, will hold an error classification
1076 The error classification is most useful for the ``OpPrereqError``
1077 error type - these errors happen before the OpCode has started
1078 executing, so it's possible to retry the OpCode without side
1079 effects. But whether it make sense to retry depends on the error
1083 Resolver errors. This usually means that a name doesn't exist in DNS,
1084 so if it's a case of slow DNS propagation the operation can be retried
1087 ``insufficient_resources``
1088 Not enough resources (iallocator failure, disk space, memory,
1089 etc.). If the resources on the cluster increase, the operation might
1093 Wrong arguments (at syntax level). The operation will not ever be
1094 accepted unless the arguments change.
1097 Wrong entity state. For example, live migration has been requested for
1098 a down instance, or instance creation on an offline node. The
1099 operation can be retried once the resource has changed state.
1102 Entity not found. For example, information has been requested for an
1106 Entity already exists. For example, instance creation has been
1107 requested for an already-existing instance.
1109 ``resource_not_unique``
1110 Resource not unique (e.g. MAC or IP duplication).
1113 Internal cluster error. For example, a node is unreachable but not set
1114 offline, or the ganeti node daemons are not working, etc. A
1115 ``gnt-cluster verify`` should be run.
1117 ``environment_error``
1118 Environment error (e.g. node disk error). A ``gnt-cluster verify``
1121 Note that in the above list, by entity we refer to a node or instance,
1122 while by a resource we refer to an instance's disk, or NIC, etc.
1128 Cancel a not-yet-started job.
1131 ``/2/jobs/[job_id]/wait``
1132 +++++++++++++++++++++++++
1137 Waits for changes on a job. Takes the following body parameters in a
1141 The job fields on which to watch for changes.
1143 ``previous_job_info``
1144 Previously received field values or None if not yet available.
1146 ``previous_log_serial``
1147 Highest log serial number received so far or None if not yet
1150 Returns None if no changes have been detected and a dict with two keys,
1151 ``job_info`` and ``log_entries`` otherwise.
1159 It supports the following commands: ``GET``.
1164 Returns a list of all nodes.
1170 "id": "node1.example.com",
1171 "uri": "\/nodes\/node1.example.com"
1174 "id": "node2.example.com",
1175 "uri": "\/nodes\/node2.example.com"
1179 If the optional 'bulk' argument is provided and set to 'true' value (i.e
1180 '?bulk=1'), the output contains detailed information about nodes as a
1190 "name": "www.example.com",
1201 ``/2/nodes/[node_name]``
1202 +++++++++++++++++++++++++++++++++
1204 Returns information about a node.
1206 It supports the following commands: ``GET``.
1208 ``/2/nodes/[node_name]/evacuate``
1209 +++++++++++++++++++++++++++++++++
1211 Evacuates all secondary instances off a node.
1213 It supports the following commands: ``POST``.
1218 To evacuate a node, either one of the ``iallocator`` or ``remote_node``
1219 parameters must be passed::
1221 evacuate?iallocator=[iallocator]
1222 evacuate?remote_node=[nodeX.example.com]
1224 The result value will be a list, each element being a triple of the job
1225 id (for this specific evacuation), the instance which is being evacuated
1226 by this job, and the node to which it is being relocated. In case the
1227 node is already empty, the result will be an empty list (without any
1228 jobs being submitted).
1230 And additional parameter ``early_release`` signifies whether to try to
1231 parallelize the evacuations, at the risk of increasing I/O contention
1232 and increasing the chances of data loss, if the primary node of any of
1233 the instances being evacuated is not fully healthy.
1235 If the dry-run parameter was specified, then the evacuation jobs were
1236 not actually submitted, and the job IDs will be null.
1239 ``/2/nodes/[node_name]/migrate``
1240 +++++++++++++++++++++++++++++++++
1242 Migrates all primary instances from a node.
1244 It supports the following commands: ``POST``.
1249 If no mode is explicitly specified, each instances' hypervisor default
1250 migration mode will be used. Query parameters:
1253 If set, use live migration if available.
1255 Sets migration mode, ``live`` for live migration and ``non-live`` for
1256 non-live migration. Supported by Ganeti 2.2 and above.
1259 ``/2/nodes/[node_name]/role``
1260 +++++++++++++++++++++++++++++
1264 It supports the following commands: ``GET``, ``PUT``.
1266 The role is always one of the following:
1277 Returns the current node role.
1286 Change the node role.
1288 The request is a string which should be PUT to this URI. The result will
1291 It supports the bool ``force`` argument.
1293 ``/2/nodes/[node_name]/storage``
1294 ++++++++++++++++++++++++++++++++
1296 Manages storage units on the node.
1301 Requests a list of storage units on a node. Requires the parameters
1302 ``storage_type`` (one of ``file``, ``lvm-pv`` or ``lvm-vg``) and
1303 ``output_fields``. The result will be a job id, using which the result
1306 ``/2/nodes/[node_name]/storage/modify``
1307 +++++++++++++++++++++++++++++++++++++++
1309 Modifies storage units on the node.
1314 Modifies parameters of storage units on the node. Requires the
1315 parameters ``storage_type`` (one of ``file``, ``lvm-pv`` or ``lvm-vg``)
1316 and ``name`` (name of the storage unit). Parameters can be passed
1317 additionally. Currently only ``allocatable`` (bool) is supported. The
1318 result will be a job id.
1320 ``/2/nodes/[node_name]/storage/repair``
1321 +++++++++++++++++++++++++++++++++++++++
1323 Repairs a storage unit on the node.
1328 Repairs a storage unit on the node. Requires the parameters
1329 ``storage_type`` (currently only ``lvm-vg`` can be repaired) and
1330 ``name`` (name of the storage unit). The result will be a job id.
1332 ``/2/nodes/[node_name]/tags``
1333 +++++++++++++++++++++++++++++
1335 Manages per-node tags.
1337 It supports the following commands: ``GET``, ``PUT``, ``DELETE``.
1342 Returns a list of tags.
1346 ["tag1", "tag2", "tag3"]
1353 The request as a list of strings should be PUT to this URI. The result
1356 It supports the ``dry-run`` argument.
1363 In order to delete a set of tags, the DELETE request should be addressed
1366 /tags?tag=[tag]&tag=[tag]
1368 It supports the ``dry-run`` argument.
1376 It supports the following commands: ``GET``.
1381 Return a list of all OSes.
1383 Can return error 500 in case of a problem. Since this is a costly
1384 operation for Ganeti 2.0, it is not recommended to execute it too often.
1393 Manages cluster tags.
1395 It supports the following commands: ``GET``, ``PUT``, ``DELETE``.
1400 Returns the cluster tags.
1404 ["tag1", "tag2", "tag3"]
1411 The request as a list of strings should be PUT to this URI. The result
1414 It supports the ``dry-run`` argument.
1422 In order to delete a set of tags, the DELETE request should be addressed
1425 /tags?tag=[tag]&tag=[tag]
1427 It supports the ``dry-run`` argument.
1433 The version resource.
1435 This resource should be used to determine the remote API version and to
1436 adapt clients accordingly.
1438 It supports the following commands: ``GET``.
1443 Returns the remote API version. Ganeti 1.2 returned ``1`` and Ganeti 2.0
1446 .. vim: set textwidth=72 :