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
24 ``ganeti-rapi`` reads users and passwords from a file (usually
25 ``/var/lib/ganeti/rapi/users``) on startup. Changes to the file will be
28 Lines starting with the hash sign (``#``) are treated as comments. Each
29 line consists of two or three fields separated by whitespace. The first
30 two fields are for username and password. The third field is optional
31 and can be used to specify per-user options (separated by comma without
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 case insensitive.
42 Options control a user's access permissions. The section
43 :ref:`rapi-access-permissions` lists the permissions required for each
44 resource. If the ``--require-authentication`` command line option is
45 given to the ``ganeti-rapi`` daemon, all requests require
46 authentication. Available options:
50 rapi.RAPI_ACCESS_ALL == set([
51 rapi.RAPI_ACCESS_WRITE,
52 rapi.RAPI_ACCESS_READ,
57 rlib2.R_2_nodes_name_storage.GET_ACCESS == [rapi.RAPI_ACCESS_WRITE]
61 rlib2.R_2_jobs_id_wait.GET_ACCESS == [rapi.RAPI_ACCESS_WRITE]
63 :pyeval:`rapi.RAPI_ACCESS_WRITE`
64 Enables the user to execute operations modifying the cluster. Implies
65 :pyeval:`rapi.RAPI_ACCESS_READ` access. Resources blocking other
66 operations for read-only access, such as
67 :ref:`/2/nodes/[node_name]/storage <rapi-res-nodes-node_name-storage+get>`
68 or blocking server-side processes, such as
69 :ref:`/2/jobs/[job_id]/wait <rapi-res-jobs-job_id-wait+get>`, use
70 :pyeval:`rapi.RAPI_ACCESS_WRITE` to control access to their
71 :pyeval:`http.HTTP_GET` method.
72 :pyeval:`rapi.RAPI_ACCESS_READ`
73 Allow access to operations querying for information.
77 # Give Jack and Fred read-only access
79 fred {cleartext}foo555
81 # Give write access to an imaginary instance creation script
82 autocreator xyz789 write
84 # Hashed password for Jessica
85 jessica {HA1}7046452df2cbb530877058712cf17bd4 write
87 # Monitoring can query for values
88 monitoring {HA1}ec018ffe72b8e75bb4d508ed5b6d079c read
90 # A user who can read and write (the former is implied by granting
92 superuser {HA1}ec018ffe72b8e75bb4d508ed5b6d079c read,write
95 .. [#pwhash] Using the MD5 hash of username, realm and password is
96 described in :rfc:`2617` ("HTTP Authentication"), sections 3.2.2.2
97 and 3.3. The reason for using it over another algorithm is forward
98 compatibility. If ``ganeti-rapi`` were to implement HTTP Digest
99 authentication in the future, the same hash could be used.
100 In the current version ``ganeti-rapi``'s realm, ``Ganeti Remote
101 API``, can only be changed by modifying the source code.
107 The protocol used is JSON_ over HTTP designed after the REST_ principle.
108 HTTP Basic authentication as per :rfc:`2617` is supported.
110 .. _JSON: http://www.json.org/
111 .. _REST: http://en.wikipedia.org/wiki/Representational_State_Transfer
113 HTTP requests with a body (e.g. ``PUT`` or ``POST``) require the request
114 header ``Content-type`` be set to ``application/json`` (see :rfc:`2616`
115 (HTTP/1.1), section 7.2.1).
118 A note on JSON as used by RAPI
119 ++++++++++++++++++++++++++++++
121 JSON_ as used by Ganeti RAPI does not conform to the specification in
122 :rfc:`4627`. Section 2 defines a JSON text to be either an object
123 (``{"key": "value", …}``) or an array (``[1, 2, 3, …]``). In violation
124 of this RAPI uses plain strings (``"master-candidate"``, ``"1234"``) for
125 some requests or responses. Changing this now would likely break
126 existing clients and cause a lot of trouble.
130 Unlike Python's `JSON encoder and decoder
131 <http://docs.python.org/library/json.html>`_, other programming
132 languages or libraries may only provide a strict implementation, not
133 allowing plain values. For those, responses can usually be wrapped in an
134 array whose first element is then used, e.g. the response ``"1234"``
135 becomes ``["1234"]``. This works equally well for more complex values.
140 # Insert code to get response here
141 response = "\"1234\""
143 decoded = JSON.parse("[#{response}]").first
145 Short of modifying the encoder to allow encoding to a less strict
146 format, requests will have to be formatted by hand. Newer RAPI requests
147 already use a dictionary as their input data and shouldn't cause any
154 According to :rfc:`2616` the main difference between PUT and POST is
155 that POST can create new resources but PUT can only create the resource
156 the URI was pointing to on the PUT request.
158 Unfortunately, due to historic reasons, the Ganeti RAPI library is not
159 consistent with this usage, so just use the methods as documented below
162 For more details have a look in the source code at
163 ``lib/rapi/rlib2.py``.
166 Generic parameter types
167 -----------------------
169 A few generic refered parameter types and the values they allow.
174 A boolean option will accept ``1`` or ``0`` as numbers but not
175 i.e. ``True`` or ``False``.
180 A few parameter mean the same thing across all resources which implement
186 Bulk-mode means that for the resources which usually return just a list
187 of child resources (e.g. ``/2/instances`` which returns just instance
188 names), the output will instead contain detailed data for all these
189 subresources. This is more efficient than query-ing the sub-resources
195 The boolean *dry-run* argument, if provided and set, signals to Ganeti
196 that the job should not be executed, only the pre-execution checks will
199 This is useful in trying to determine (without guarantees though, as in
200 the meantime the cluster state could have changed) if the operation is
201 likely to succeed or at least start executing.
206 Force operation to continue even if it will cause the cluster to become
207 inconsistent (e.g. because there are not enough master candidates).
212 Some parameters are not straight forward, so we describe them in details
220 The instance policy specification is a dict with the following fields:
224 constants.IPOLICY_ALL_KEYS == set([constants.ISPECS_MIN,
225 constants.ISPECS_MAX,
226 constants.ISPECS_STD,
227 constants.IPOLICY_DTS,
228 constants.IPOLICY_VCPU_RATIO,
229 constants.IPOLICY_SPINDLE_RATIO])
234 (set(constants.ISPECS_PARAMETER_TYPES.keys()) ==
235 set([constants.ISPEC_MEM_SIZE,
236 constants.ISPEC_DISK_SIZE,
237 constants.ISPEC_DISK_COUNT,
238 constants.ISPEC_CPU_COUNT,
239 constants.ISPEC_NIC_COUNT,
240 constants.ISPEC_SPINDLE_USE]))
242 .. |ispec-min| replace:: :pyeval:`constants.ISPECS_MIN`
243 .. |ispec-max| replace:: :pyeval:`constants.ISPECS_MAX`
244 .. |ispec-std| replace:: :pyeval:`constants.ISPECS_STD`
247 |ispec-min|, |ispec-max|, |ispec-std|
248 A sub- `dict` with the following fields, which sets the limit and standard
249 values of the instances:
251 :pyeval:`constants.ISPEC_MEM_SIZE`
252 The size in MiB of the memory used
253 :pyeval:`constants.ISPEC_DISK_SIZE`
254 The size in MiB of the disk used
255 :pyeval:`constants.ISPEC_DISK_COUNT`
256 The numbers of disks used
257 :pyeval:`constants.ISPEC_CPU_COUNT`
258 The numbers of cpus used
259 :pyeval:`constants.ISPEC_NIC_COUNT`
260 The numbers of nics used
261 :pyeval:`constants.ISPEC_SPINDLE_USE`
262 The numbers of virtual disk spindles used by this instance. They are
263 not real in the sense of actual HDD spindles, but useful for
264 accounting the spindle usage on the residing node
265 :pyeval:`constants.IPOLICY_DTS`
266 A `list` of disk templates allowed for instances using this policy
267 :pyeval:`constants.IPOLICY_VCPU_RATIO`
268 Maximum ratio of virtual to physical CPUs (`float`)
269 :pyeval:`constants.IPOLICY_SPINDLE_RATIO`
270 Maximum ratio of instances to their node's ``spindle_count`` (`float`)
275 You can access the API using your favorite programming language as long
276 as it supports network connections.
281 Ganeti includes a standalone RAPI client, ``lib/rapi/client.py``.
286 .. highlight:: shell-example
290 $ wget -q -O - https://%CLUSTERNAME%:5080/2/info
294 $ curl https://%CLUSTERNAME%:5080/2/info
300 .. highlight:: python
305 f = urllib2.urlopen('https://CLUSTERNAME:5080/2/info')
312 .. warning:: While it's possible to use JavaScript, it poses several
313 potential problems, including browser blocking request due to
314 non-standard ports or different domain names. Fetching the data on
315 the webserver is easier.
317 .. highlight:: javascript
321 var url = 'https://CLUSTERNAME:5080/2/info';
323 var xmlreq = new XMLHttpRequest();
324 xmlreq.onreadystatechange = function () {
325 if (xmlreq.readyState != 4) return;
326 if (xmlreq.status == 200) {
327 info = eval("(" + xmlreq.responseText + ")");
330 alert('Error fetching cluster info');
334 xmlreq.open('GET', url, true);
340 .. highlight:: javascript
345 The root resource. Has no function, but for legacy reasons the ``GET``
351 Has no function, but for legacy reasons the ``GET`` method is supported.
358 Cluster information resource.
360 .. rapi_resource_details:: /2/info
363 .. _rapi-res-info+get:
368 Returns cluster information.
373 "config_version": 2000000,
375 "software_version": "2.0.0~beta2",
376 "os_api_version": 10,
378 "candidate_pool_size": 10,
379 "enabled_hypervisors": [
385 "default_hypervisor": "fake",
386 "master": "node1.example.com",
391 "protocol_version": 20,
394 "auto_balance": true,
403 .. _rapi-res-redistribute-config:
405 ``/2/redistribute-config``
406 ++++++++++++++++++++++++++
408 Redistribute configuration to all nodes.
410 .. rapi_resource_details:: /2/redistribute-config
413 .. _rapi-res-redistribute-config+put:
418 Redistribute configuration to all nodes. The result will be a job id.
422 .. opcode_result:: OP_CLUSTER_REDIST_CONF
425 .. _rapi-res-features:
430 .. rapi_resource_details:: /2/features
433 .. _rapi-res-features+get:
438 Returns a list of features supported by the RAPI server. Available
443 rlib2.ALL_FEATURES == set([rlib2._INST_CREATE_REQV1,
444 rlib2._INST_REINSTALL_REQV1,
445 rlib2._NODE_MIGRATE_REQV1,
446 rlib2._NODE_EVAC_RES1])
448 :pyeval:`rlib2._INST_CREATE_REQV1`
449 Instance creation request data version 1 supported
450 :pyeval:`rlib2._INST_REINSTALL_REQV1`
451 Instance reinstall supports body parameters
452 :pyeval:`rlib2._NODE_MIGRATE_REQV1`
453 Whether migrating a node (``/2/nodes/[node_name]/migrate``) supports
454 request body parameters
455 :pyeval:`rlib2._NODE_EVAC_RES1`
456 Whether evacuating a node (``/2/nodes/[node_name]/evacuate``) returns
457 a new-style result (see resource description)
463 ++++++++++++++++++++++++++++++++++++++++
465 Modifies cluster parameters.
467 .. rapi_resource_details:: /2/modify
470 .. _rapi-res-modify+put:
479 .. opcode_params:: OP_CLUSTER_SET_PARAMS
483 .. opcode_result:: OP_CLUSTER_SET_PARAMS
493 .. rapi_resource_details:: /2/groups
496 .. _rapi-res-groups+get:
501 Returns a list of all existing node groups.
508 "uri": "\/2\/groups\/group1"
512 "uri": "\/2\/groups\/group2"
516 If the optional bool *bulk* argument is provided and set to a true value
517 (i.e ``?bulk=1``), the output contains detailed information about node
520 Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.G_FIELDS))`.
532 "uuid": "0d7d407c-262e-49af-881a-6a430034bf43",
541 "uuid": "f5a277e7-68f9-44d3-a378-4b25ecb5df5c",
548 .. _rapi-res-groups+post:
553 Creates a node group.
555 If the optional bool *dry-run* argument is provided, the job will not be
556 actually executed, only the pre-execution checks will be done.
558 Returns: a job ID that can be used later for polling.
562 .. opcode_params:: OP_GROUP_ADD
564 Earlier versions used a parameter named ``name`` which, while still
565 supported, has been renamed to ``group_name``.
569 .. opcode_result:: OP_GROUP_ADD
572 .. _rapi-res-groups-group_name:
574 ``/2/groups/[group_name]``
575 ++++++++++++++++++++++++++
577 Returns information about a node group.
579 .. rapi_resource_details:: /2/groups/[group_name]
582 .. _rapi-res-groups-group_name+get:
587 Returns information about a node group, similar to the bulk output from
590 Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.G_FIELDS))`.
592 .. _rapi-res-groups-group_name+delete:
597 Deletes a node group.
599 It supports the ``dry-run`` argument.
603 .. opcode_result:: OP_GROUP_REMOVE
606 .. _rapi-res-groups-group_name-modify:
608 ``/2/groups/[group_name]/modify``
609 +++++++++++++++++++++++++++++++++
611 Modifies the parameters of a node group.
613 .. rapi_resource_details:: /2/groups/[group_name]/modify
616 .. _rapi-res-groups-group_name-modify+put:
625 .. opcode_params:: OP_GROUP_SET_PARAMS
630 .. opcode_result:: OP_GROUP_SET_PARAMS
633 .. _rapi-res-groups-group_name-rename:
635 ``/2/groups/[group_name]/rename``
636 +++++++++++++++++++++++++++++++++
638 Renames a node group.
640 .. rapi_resource_details:: /2/groups/[group_name]/rename
643 .. _rapi-res-groups-group_name-rename+put:
652 .. opcode_params:: OP_GROUP_RENAME
657 .. opcode_result:: OP_GROUP_RENAME
660 .. _rapi-res-groups-group_name-assign-nodes:
662 ``/2/groups/[group_name]/assign-nodes``
663 +++++++++++++++++++++++++++++++++++++++
665 Assigns nodes to a group.
667 .. rapi_resource_details:: /2/groups/[group_name]/assign-nodes
669 .. _rapi-res-groups-group_name-assign-nodes+put:
674 Returns a job ID. It supports the ``dry-run`` and ``force`` arguments.
678 .. opcode_params:: OP_GROUP_ASSIGN_NODES
679 :exclude: group_name, force, dry_run
683 .. opcode_result:: OP_GROUP_ASSIGN_NODES
685 .. _rapi-res-groups-group_name-tags:
687 ``/2/groups/[group_name]/tags``
688 +++++++++++++++++++++++++++++++
690 Manages per-nodegroup tags.
692 .. rapi_resource_details:: /2/groups/[group_name]/tags
695 .. _rapi-res-groups-group_name-tags+get:
700 Returns a list of tags.
704 ["tag1", "tag2", "tag3"]
706 .. _rapi-res-groups-group_name-tags+put:
713 The request as a list of strings should be ``PUT`` to this URI. The
714 result will be a job id.
716 It supports the ``dry-run`` argument.
719 .. _rapi-res-groups-group_name-tags+delete:
726 In order to delete a set of tags, the DELETE request should be addressed
729 /tags?tag=[tag]&tag=[tag]
731 It supports the ``dry-run`` argument.
734 .. _rapi-res-networks:
739 The networks resource.
741 .. rapi_resource_details:: /2/networks
744 .. _rapi-res-networks+get:
749 Returns a list of all existing networks.
756 "uri": "\/2\/networks\/network1"
760 "uri": "\/2\/networks\/network2"
764 If the optional bool *bulk* argument is provided and set to a true value
765 (i.e ``?bulk=1``), the output contains detailed information about networks
768 Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.NET_FIELDS))`.
774 'external_reservations': '10.0.0.0, 10.0.0.1, 10.0.0.15',
776 'gateway': '10.0.0.1',
778 'group_list': ['default(bridged, prv0)'],
781 'map': 'XX.............X',
783 'network': '10.0.0.0/28',
793 .. _rapi-res-networks+post:
800 If the optional bool *dry-run* argument is provided, the job will not be
801 actually executed, only the pre-execution checks will be done.
803 Returns: a job ID that can be used later for polling.
807 .. opcode_params:: OP_NETWORK_ADD
811 .. opcode_result:: OP_NETWORK_ADD
814 .. _rapi-res-networks-network_name:
816 ``/2/networks/[network_name]``
817 ++++++++++++++++++++++++++++++
819 Returns information about a network.
821 .. rapi_resource_details:: /2/networks/[network_name]
824 .. _rapi-res-networks-network_name+get:
829 Returns information about a network, similar to the bulk output from
832 Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.NET_FIELDS))`.
835 .. _rapi-res-networks-network_name+delete:
842 It supports the ``dry-run`` argument.
846 .. opcode_result:: OP_NETWORK_REMOVE
849 .. _rapi-res-networks-network_name-modify:
851 ``/2/networks/[network_name]/modify``
852 +++++++++++++++++++++++++++++++++++++
854 Modifies the parameters of a network.
856 .. rapi_resource_details:: /2/networks/[network_name]/modify
859 .. _rapi-res-networks-network_name-modify+put:
868 .. opcode_params:: OP_NETWORK_SET_PARAMS
872 .. opcode_result:: OP_NETWORK_SET_PARAMS
875 .. _rapi-res-networks-network_name-connect:
877 ``/2/networks/[network_name]/connect``
878 ++++++++++++++++++++++++++++++++++++++
880 Connects a network to a nodegroup.
882 .. rapi_resource_details:: /2/networks/[network_name]/connect
885 .. _rapi-res-networks-network_name-connect+put:
890 Returns a job ID. It supports the ``dry-run`` arguments.
894 .. opcode_params:: OP_NETWORK_CONNECT
898 .. opcode_result:: OP_NETWORK_CONNECT
901 .. _rapi-res-networks-network_name-disconnect:
903 ``/2/networks/[network_name]/disconnect``
904 +++++++++++++++++++++++++++++++++++++++++
906 Disonnects a network from a nodegroup.
908 .. rapi_resource_details:: /2/networks/[network_name]/disconnect
911 .. _rapi-res-networks-network_name-disconnect+put:
916 Returns a job ID. It supports the ``dry-run`` arguments.
920 .. opcode_params:: OP_NETWORK_DISCONNECT
924 .. opcode_result:: OP_NETWORK_DISCONNECT
927 .. _rapi-res-networks-network_name-tags:
929 ``/2/networks/[network_name]/tags``
930 +++++++++++++++++++++++++++++++++++
932 Manages per-network tags.
934 .. rapi_resource_details:: /2/networks/[network_name]/tags
937 .. _rapi-res-networks-network_name-tags+get:
942 Returns a list of tags.
946 ["tag1", "tag2", "tag3"]
949 .. _rapi-res-networks-network_name-tags+put:
956 The request as a list of strings should be ``PUT`` to this URI. The
957 result will be a job id.
959 It supports the ``dry-run`` argument.
962 .. _rapi-res-networks-network_name-tags+delete:
969 In order to delete a set of tags, the DELETE request should be addressed
972 /tags?tag=[tag]&tag=[tag]
974 It supports the ``dry-run`` argument.
977 .. _rapi-res-instances-multi-alloc:
979 ``/2/instances-multi-alloc``
980 ++++++++++++++++++++++++++++
982 Tries to allocate multiple instances.
984 .. rapi_resource_details:: /2/instances-multi-alloc
987 .. _rapi-res-instances-multi-alloc+post:
994 .. opcode_params:: OP_INSTANCE_MULTI_ALLOC
998 .. opcode_result:: OP_INSTANCE_MULTI_ALLOC
1001 .. _rapi-res-instances:
1006 The instances resource.
1008 .. rapi_resource_details:: /2/instances
1011 .. _rapi-res-instances+get:
1016 Returns a list of all available instances.
1022 "name": "web.example.com",
1023 "uri": "\/instances\/web.example.com"
1026 "name": "mail.example.com",
1027 "uri": "\/instances\/mail.example.com"
1031 If the optional bool *bulk* argument is provided and set to a true value
1032 (i.e ``?bulk=1``), the output contains detailed information about
1033 instances as a list.
1035 Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.I_FIELDS))`.
1041 "status": "running",
1042 "disk_usage": 20480,
1046 "name": "web.example.com",
1047 "tags": ["tag1", "tag2"],
1055 "pnode": "node1.example.com",
1056 "nic.macs": ["01:23:45:67:89:01"],
1057 "snodes": ["node2.example.com"],
1058 "disk_template": "drbd",
1059 "admin_state": true,
1060 "os": "debian-etch",
1068 .. _rapi-res-instances+post:
1073 Creates an instance.
1075 If the optional bool *dry-run* argument is provided, the job will not be
1076 actually executed, only the pre-execution checks will be done. Query-ing
1077 the job result will return, in both dry-run and normal case, the list of
1078 nodes selected for the instance.
1080 Returns: a job ID that can be used later for polling.
1084 ``__version__`` (int, required)
1085 Must be ``1`` (older Ganeti versions used a different format for
1086 instance creation requests, version ``0``, but that format is no
1089 .. opcode_params:: OP_INSTANCE_CREATE
1091 Earlier versions used parameters named ``name`` and ``os``. These have
1092 been replaced by ``instance_name`` and ``os_type`` to match the
1093 underlying opcode. The old names can still be used.
1097 .. opcode_result:: OP_INSTANCE_CREATE
1100 .. _rapi-res-instances-instance_name:
1102 ``/2/instances/[instance_name]``
1103 ++++++++++++++++++++++++++++++++
1105 Instance-specific resource.
1107 .. rapi_resource_details:: /2/instances/[instance_name]
1110 .. _rapi-res-instances-instance_name+get:
1115 Returns information about an instance, similar to the bulk output from
1118 Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.I_FIELDS))`.
1121 .. _rapi-res-instances-instance_name+delete:
1126 Deletes an instance.
1128 It supports the ``dry-run`` argument.
1132 .. opcode_result:: OP_INSTANCE_REMOVE
1135 .. _rapi-res-instances-instance_name-info:
1137 ``/2/instances/[instance_name]/info``
1138 +++++++++++++++++++++++++++++++++++++++
1140 .. rapi_resource_details:: /2/instances/[instance_name]/info
1143 .. _rapi-res-instances-instance_name-info+get:
1148 Requests detailed information about the instance. An optional parameter,
1149 ``static`` (bool), can be set to return only static information from the
1150 configuration without querying the instance's nodes. The result will be
1155 .. opcode_result:: OP_INSTANCE_QUERY_DATA
1158 .. _rapi-res-instances-instance_name-reboot:
1160 ``/2/instances/[instance_name]/reboot``
1161 +++++++++++++++++++++++++++++++++++++++
1163 Reboots URI for an instance.
1165 .. rapi_resource_details:: /2/instances/[instance_name]/reboot
1168 .. _rapi-res-instances-instance_name-reboot+post:
1173 Reboots the instance.
1175 The URI takes optional ``type=soft|hard|full`` and
1176 ``ignore_secondaries=0|1`` parameters.
1178 ``type`` defines the reboot type. ``soft`` is just a normal reboot,
1179 without terminating the hypervisor. ``hard`` means full shutdown
1180 (including terminating the hypervisor process) and startup again.
1181 ``full`` is like ``hard`` but also recreates the configuration from
1182 ground up as if you would have done a ``gnt-instance shutdown`` and
1183 ``gnt-instance start`` on it.
1185 ``ignore_secondaries`` is a bool argument indicating if we start the
1186 instance even if secondary disks are failing.
1188 It supports the ``dry-run`` argument.
1192 .. opcode_result:: OP_INSTANCE_REBOOT
1195 .. _rapi-res-instances-instance_name-shutdown:
1197 ``/2/instances/[instance_name]/shutdown``
1198 +++++++++++++++++++++++++++++++++++++++++
1200 Instance shutdown URI.
1202 .. rapi_resource_details:: /2/instances/[instance_name]/shutdown
1205 .. _rapi-res-instances-instance_name-shutdown+put:
1210 Shutdowns an instance.
1212 It supports the ``dry-run`` argument.
1214 .. opcode_params:: OP_INSTANCE_SHUTDOWN
1215 :exclude: instance_name, dry_run
1219 .. opcode_result:: OP_INSTANCE_SHUTDOWN
1222 .. _rapi-res-instances-instance_name-startup:
1224 ``/2/instances/[instance_name]/startup``
1225 ++++++++++++++++++++++++++++++++++++++++
1227 Instance startup URI.
1229 .. rapi_resource_details:: /2/instances/[instance_name]/startup
1232 .. _rapi-res-instances-instance_name-startup+put:
1237 Startup an instance.
1239 The URI takes an optional ``force=1|0`` parameter to start the
1240 instance even if secondary disks are failing.
1242 It supports the ``dry-run`` argument.
1246 .. opcode_result:: OP_INSTANCE_STARTUP
1249 .. _rapi-res-instances-instance_name-reinstall:
1251 ``/2/instances/[instance_name]/reinstall``
1252 ++++++++++++++++++++++++++++++++++++++++++++++
1254 Installs the operating system again.
1256 .. rapi_resource_details:: /2/instances/[instance_name]/reinstall
1259 .. _rapi-res-instances-instance_name-reinstall+post:
1268 ``os`` (string, required)
1269 Instance operating system.
1270 ``start`` (bool, defaults to true)
1271 Whether to start instance after reinstallation.
1273 Dictionary with (temporary) OS parameters.
1275 For backwards compatbility, this resource also takes the query
1276 parameters ``os`` (OS template name) and ``nostartup`` (bool). New
1277 clients should use the body parameters.
1280 .. _rapi-res-instances-instance_name-replace-disks:
1282 ``/2/instances/[instance_name]/replace-disks``
1283 ++++++++++++++++++++++++++++++++++++++++++++++
1285 Replaces disks on an instance.
1287 .. rapi_resource_details:: /2/instances/[instance_name]/replace-disks
1290 .. _rapi-res-instances-instance_name-replace-disks+post:
1299 .. opcode_params:: OP_INSTANCE_REPLACE_DISKS
1300 :exclude: instance_name
1302 Ganeti 2.4 and below used query parameters. Those are deprecated and
1303 should no longer be used.
1307 .. opcode_result:: OP_INSTANCE_REPLACE_DISKS
1310 .. _rapi-res-instances-instance_name-activate-disks:
1312 ``/2/instances/[instance_name]/activate-disks``
1313 +++++++++++++++++++++++++++++++++++++++++++++++
1315 Activate disks on an instance.
1317 .. rapi_resource_details:: /2/instances/[instance_name]/activate-disks
1320 .. _rapi-res-instances-instance_name-activate-disks+put:
1325 Takes the bool parameter ``ignore_size``. When set ignore the recorded
1326 size (useful for forcing activation when recorded size is wrong).
1330 .. opcode_result:: OP_INSTANCE_ACTIVATE_DISKS
1333 .. _rapi-res-instances-instance_name-deactivate-disks:
1335 ``/2/instances/[instance_name]/deactivate-disks``
1336 +++++++++++++++++++++++++++++++++++++++++++++++++
1338 Deactivate disks on an instance.
1340 .. rapi_resource_details:: /2/instances/[instance_name]/deactivate-disks
1343 .. _rapi-res-instances-instance_name-deactivate-disks+put:
1348 Takes no parameters.
1352 .. opcode_result:: OP_INSTANCE_DEACTIVATE_DISKS
1355 .. _rapi-res-instances-instance_name-recreate-disks:
1357 ``/2/instances/[instance_name]/recreate-disks``
1358 +++++++++++++++++++++++++++++++++++++++++++++++++
1360 Recreate disks of an instance.
1362 .. rapi_resource_details:: /2/instances/[instance_name]/recreate-disks
1365 .. _rapi-res-instances-instance_name-recreate-disks+post:
1374 .. opcode_params:: OP_INSTANCE_RECREATE_DISKS
1375 :exclude: instance_name
1379 .. opcode_result:: OP_INSTANCE_RECREATE_DISKS
1382 .. _rapi-res-instances-instance_name-disk-disk_index-grow:
1384 ``/2/instances/[instance_name]/disk/[disk_index]/grow``
1385 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1387 Grows one disk of an instance.
1389 .. rapi_resource_details:: /2/instances/[instance_name]/disk/[disk_index]/grow
1392 .. _rapi-res-instances-instance_name-disk-disk_index-grow+post:
1401 .. opcode_params:: OP_INSTANCE_GROW_DISK
1402 :exclude: instance_name, disk
1406 .. opcode_result:: OP_INSTANCE_GROW_DISK
1409 .. _rapi-res-instances-instance_name-prepare-export:
1411 ``/2/instances/[instance_name]/prepare-export``
1412 +++++++++++++++++++++++++++++++++++++++++++++++++
1414 Prepares an export of an instance.
1416 .. rapi_resource_details:: /2/instances/[instance_name]/prepare-export
1419 .. _rapi-res-instances-instance_name-prepare-export+put:
1424 Takes one parameter, ``mode``, for the export mode. Returns a job ID.
1428 .. opcode_result:: OP_BACKUP_PREPARE
1431 .. _rapi-res-instances-instance_name-export:
1433 ``/2/instances/[instance_name]/export``
1434 +++++++++++++++++++++++++++++++++++++++++++++++++
1436 Exports an instance.
1438 .. rapi_resource_details:: /2/instances/[instance_name]/export
1441 .. _rapi-res-instances-instance_name-export+put:
1450 .. opcode_params:: OP_BACKUP_EXPORT
1451 :exclude: instance_name
1452 :alias: target_node=destination
1456 .. opcode_result:: OP_BACKUP_EXPORT
1459 .. _rapi-res-instances-instance_name-migrate:
1461 ``/2/instances/[instance_name]/migrate``
1462 ++++++++++++++++++++++++++++++++++++++++
1464 Migrates an instance.
1466 .. rapi_resource_details:: /2/instances/[instance_name]/migrate
1469 .. _rapi-res-instances-instance_name-migrate+put:
1478 .. opcode_params:: OP_INSTANCE_MIGRATE
1479 :exclude: instance_name, live
1483 .. opcode_result:: OP_INSTANCE_MIGRATE
1486 .. _rapi-res-instances-instance_name-failover:
1488 ``/2/instances/[instance_name]/failover``
1489 +++++++++++++++++++++++++++++++++++++++++
1491 Does a failover of an instance.
1493 .. rapi_resource_details:: /2/instances/[instance_name]/failover
1496 .. _rapi-res-instances-instance_name-failover+put:
1505 .. opcode_params:: OP_INSTANCE_FAILOVER
1506 :exclude: instance_name
1510 .. opcode_result:: OP_INSTANCE_FAILOVER
1513 .. _rapi-res-instances-instance_name-rename:
1515 ``/2/instances/[instance_name]/rename``
1516 ++++++++++++++++++++++++++++++++++++++++
1518 Renames an instance.
1520 .. rapi_resource_details:: /2/instances/[instance_name]/rename
1523 .. _rapi-res-instances-instance_name-rename+put:
1532 .. opcode_params:: OP_INSTANCE_RENAME
1533 :exclude: instance_name
1537 .. opcode_result:: OP_INSTANCE_RENAME
1540 .. _rapi-res-instances-instance_name-modify:
1542 ``/2/instances/[instance_name]/modify``
1543 ++++++++++++++++++++++++++++++++++++++++
1545 Modifies an instance.
1547 .. rapi_resource_details:: /2/instances/[instance_name]/modify
1550 .. _rapi-res-instances-instance_name-modify+put:
1559 .. opcode_params:: OP_INSTANCE_SET_PARAMS
1560 :exclude: instance_name
1564 .. opcode_result:: OP_INSTANCE_SET_PARAMS
1567 .. _rapi-res-instances-instance_name-console:
1569 ``/2/instances/[instance_name]/console``
1570 ++++++++++++++++++++++++++++++++++++++++
1572 Request information for connecting to instance's console.
1574 .. rapi_resource_details:: /2/instances/[instance_name]/console
1577 .. _rapi-res-instances-instance_name-console+get:
1582 Returns a dictionary containing information about the instance's
1583 console. Contained keys:
1587 constants.CONS_ALL == frozenset([
1588 constants.CONS_MESSAGE,
1591 constants.CONS_SPICE,
1596 frozenset(objects.InstanceConsole.GetAllSlots()) == frozenset([
1611 Console type, one of :pyeval:`constants.CONS_SSH`,
1612 :pyeval:`constants.CONS_VNC`, :pyeval:`constants.CONS_SPICE`
1613 or :pyeval:`constants.CONS_MESSAGE`
1615 Message to display (:pyeval:`constants.CONS_MESSAGE` type only)
1617 Host to connect to (:pyeval:`constants.CONS_SSH`,
1618 :pyeval:`constants.CONS_VNC` or :pyeval:`constants.CONS_SPICE` only)
1620 TCP port to connect to (:pyeval:`constants.CONS_VNC` or
1621 :pyeval:`constants.CONS_SPICE` only)
1623 Username to use (:pyeval:`constants.CONS_SSH` only)
1625 Command to execute on machine (:pyeval:`constants.CONS_SSH` only)
1627 VNC display number (:pyeval:`constants.CONS_VNC` only)
1630 .. _rapi-res-instances-instance_name-tags:
1632 ``/2/instances/[instance_name]/tags``
1633 +++++++++++++++++++++++++++++++++++++
1635 Manages per-instance tags.
1637 .. rapi_resource_details:: /2/instances/[instance_name]/tags
1640 .. _rapi-res-instances-instance_name-tags+get:
1645 Returns a list of tags.
1649 ["tag1", "tag2", "tag3"]
1652 .. _rapi-res-instances-instance_name-tags+put:
1659 The request as a list of strings should be ``PUT`` to this URI. The
1660 result will be a job id.
1662 It supports the ``dry-run`` argument.
1665 .. _rapi-res-instances-instance_name-tags+delete:
1672 In order to delete a set of tags, the DELETE request should be addressed
1675 /tags?tag=[tag]&tag=[tag]
1677 It supports the ``dry-run`` argument.
1685 The ``/2/jobs`` resource.
1687 .. rapi_resource_details:: /2/jobs
1690 .. _rapi-res-jobs+get:
1695 Returns a dictionary of jobs.
1697 Returns: a dictionary with jobs id and uri.
1699 If the optional bool *bulk* argument is provided and set to a true value
1700 (i.e. ``?bulk=1``), the output contains detailed information about jobs
1703 Returned fields for bulk requests (unlike other bulk requests, these
1704 fields are not the same as for per-job requests):
1705 :pyeval:`utils.CommaJoin(sorted(rlib2.J_FIELDS_BULK))`.
1708 .. _rapi-res-jobs-job_id:
1710 ``/2/jobs/[job_id]``
1711 ++++++++++++++++++++
1715 .. rapi_resource_details:: /2/jobs/[job_id]
1718 .. _rapi-res-jobs-job_id+get:
1723 Returns a dictionary with job parameters, containing the fields
1724 :pyeval:`utils.CommaJoin(sorted(rlib2.J_FIELDS))`.
1726 The result includes:
1728 - id: job ID as a number
1729 - status: current job status as a string
1730 - ops: involved OpCodes as a list of dictionaries for each opcodes in
1732 - opstatus: OpCodes status as a list
1733 - opresult: OpCodes results as a list
1735 For a successful opcode, the ``opresult`` field corresponding to it will
1736 contain the raw result from its :term:`LogicalUnit`. In case an opcode
1737 has failed, its element in the opresult list will be a list of two
1740 - first element the error type (the Ganeti internal error name)
1741 - second element a list of either one or two elements:
1743 - the first element is the textual error description
1744 - the second element, if any, will hold an error classification
1746 The error classification is most useful for the ``OpPrereqError``
1747 error type - these errors happen before the OpCode has started
1748 executing, so it's possible to retry the OpCode without side
1749 effects. But whether it make sense to retry depends on the error
1754 errors.ECODE_ALL == set([errors.ECODE_RESOLVER, errors.ECODE_NORES,
1755 errors.ECODE_INVAL, errors.ECODE_STATE, errors.ECODE_NOENT,
1756 errors.ECODE_EXISTS, errors.ECODE_NOTUNIQUE, errors.ECODE_FAULT,
1757 errors.ECODE_ENVIRON, errors.ECODE_TEMP_NORES])
1759 :pyeval:`errors.ECODE_RESOLVER`
1760 Resolver errors. This usually means that a name doesn't exist in DNS,
1761 so if it's a case of slow DNS propagation the operation can be retried
1764 :pyeval:`errors.ECODE_NORES`
1765 Not enough resources (iallocator failure, disk space, memory,
1766 etc.). If the resources on the cluster increase, the operation might
1769 :pyeval:`errors.ECODE_TEMP_NORES`
1770 Simliar to :pyeval:`errors.ECODE_NORES`, but indicating the operation
1771 should be attempted again after some time.
1773 :pyeval:`errors.ECODE_INVAL`
1774 Wrong arguments (at syntax level). The operation will not ever be
1775 accepted unless the arguments change.
1777 :pyeval:`errors.ECODE_STATE`
1778 Wrong entity state. For example, live migration has been requested for
1779 a down instance, or instance creation on an offline node. The
1780 operation can be retried once the resource has changed state.
1782 :pyeval:`errors.ECODE_NOENT`
1783 Entity not found. For example, information has been requested for an
1786 :pyeval:`errors.ECODE_EXISTS`
1787 Entity already exists. For example, instance creation has been
1788 requested for an already-existing instance.
1790 :pyeval:`errors.ECODE_NOTUNIQUE`
1791 Resource not unique (e.g. MAC or IP duplication).
1793 :pyeval:`errors.ECODE_FAULT`
1794 Internal cluster error. For example, a node is unreachable but not set
1795 offline, or the ganeti node daemons are not working, etc. A
1796 ``gnt-cluster verify`` should be run.
1798 :pyeval:`errors.ECODE_ENVIRON`
1799 Environment error (e.g. node disk error). A ``gnt-cluster verify``
1802 Note that in the above list, by entity we refer to a node or instance,
1803 while by a resource we refer to an instance's disk, or NIC, etc.
1806 .. _rapi-res-jobs-job_id+delete:
1811 Cancel a not-yet-started job.
1814 .. _rapi-res-jobs-job_id-wait:
1816 ``/2/jobs/[job_id]/wait``
1817 +++++++++++++++++++++++++
1819 .. rapi_resource_details:: /2/jobs/[job_id]/wait
1822 .. _rapi-res-jobs-job_id-wait+get:
1827 Waits for changes on a job. Takes the following body parameters in a
1831 The job fields on which to watch for changes
1833 ``previous_job_info``
1834 Previously received field values or None if not yet available
1836 ``previous_log_serial``
1837 Highest log serial number received so far or None if not yet
1840 Returns None if no changes have been detected and a dict with two keys,
1841 ``job_info`` and ``log_entries`` otherwise.
1851 .. rapi_resource_details:: /2/nodes
1854 .. _rapi-res-nodes+get:
1859 Returns a list of all nodes.
1865 "id": "node1.example.com",
1866 "uri": "\/nodes\/node1.example.com"
1869 "id": "node2.example.com",
1870 "uri": "\/nodes\/node2.example.com"
1874 If the optional bool *bulk* argument is provided and set to a true value
1875 (i.e ``?bulk=1``), the output contains detailed information about nodes
1878 Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.N_FIELDS))`.
1887 "name": "www.example.com",
1900 .. _rapi-res-nodes-node_name:
1902 ``/2/nodes/[node_name]``
1903 +++++++++++++++++++++++++++++++++
1905 Returns information about a node.
1907 .. rapi_resource_details:: /2/nodes/[node_name]
1910 .. _rapi-res-nodes-node_name+get:
1915 Returned fields: :pyeval:`utils.CommaJoin(sorted(rlib2.N_FIELDS))`.
1919 .. _rapi-res-nodes-node_name-powercycle:
1921 ``/2/nodes/[node_name]/powercycle``
1922 +++++++++++++++++++++++++++++++++++
1926 .. rapi_resource_details:: /2/nodes/[node_name]/powercycle
1929 .. _rapi-res-nodes-node_name-powercycle+post:
1938 .. opcode_result:: OP_NODE_POWERCYCLE
1941 .. _rapi-res-nodes-node_name-evacuate:
1943 ``/2/nodes/[node_name]/evacuate``
1944 +++++++++++++++++++++++++++++++++
1946 Evacuates instances off a node.
1948 .. rapi_resource_details:: /2/nodes/[node_name]/evacuate
1951 .. _rapi-res-nodes-node_name-evacuate+post:
1956 Returns a job ID. The result of the job will contain the IDs of the
1957 individual jobs submitted to evacuate the node.
1961 .. opcode_params:: OP_NODE_EVACUATE
1964 Up to and including Ganeti 2.4 query arguments were used. Those are no
1965 longer supported. The new request can be detected by the presence of the
1966 :pyeval:`rlib2._NODE_EVAC_RES1` feature string.
1970 .. opcode_result:: OP_NODE_EVACUATE
1973 .. _rapi-res-nodes-node_name-migrate:
1975 ``/2/nodes/[node_name]/migrate``
1976 +++++++++++++++++++++++++++++++++
1978 Migrates all primary instances from a node.
1980 .. rapi_resource_details:: /2/nodes/[node_name]/migrate
1983 .. _rapi-res-nodes-node_name-migrate+post:
1988 If no mode is explicitly specified, each instances' hypervisor default
1989 migration mode will be used. Body parameters:
1991 .. opcode_params:: OP_NODE_MIGRATE
1994 The query arguments used up to and including Ganeti 2.4 are deprecated
1995 and should no longer be used. The new request format can be detected by
1996 the presence of the :pyeval:`rlib2._NODE_MIGRATE_REQV1` feature string.
2000 .. opcode_result:: OP_NODE_MIGRATE
2003 .. _rapi-res-nodes-node_name-role:
2005 ``/2/nodes/[node_name]/role``
2006 +++++++++++++++++++++++++++++
2010 .. rapi_resource_details:: /2/nodes/[node_name]/role
2012 The role is always one of the following:
2019 Note that the 'master' role is a special, and currently it can't be
2020 modified via RAPI, only via the command line (``gnt-cluster
2024 .. _rapi-res-nodes-node_name-role+get:
2029 Returns the current node role.
2036 .. _rapi-res-nodes-node_name-role+put:
2041 Change the node role.
2043 The request is a string which should be PUT to this URI. The result will
2046 It supports the bool ``force`` argument.
2050 .. opcode_result:: OP_NODE_SET_PARAMS
2053 .. _rapi-res-nodes-node_name-modify:
2055 ``/2/nodes/[node_name]/modify``
2056 +++++++++++++++++++++++++++++++
2058 Modifies the parameters of a node.
2060 .. rapi_resource_details:: /2/nodes/[node_name]/modify
2063 .. _rapi-res-nodes-node_name-modify+post:
2072 .. opcode_params:: OP_NODE_SET_PARAMS
2077 .. opcode_result:: OP_NODE_SET_PARAMS
2080 .. _rapi-res-nodes-node_name-storage:
2082 ``/2/nodes/[node_name]/storage``
2083 ++++++++++++++++++++++++++++++++
2085 Manages storage units on the node.
2087 .. rapi_resource_details:: /2/nodes/[node_name]/storage
2090 .. _rapi-res-nodes-node_name-storage+get:
2095 FIXME: enable ".. pyassert::" again when all storage types are
2098 constants.VALID_STORAGE_TYPES == set([constants.ST_FILE,
2099 constants.ST_LVM_PV,
2100 constants.ST_LVM_VG])
2102 Requests a list of storage units on a node. Requires the parameters
2103 ``storage_type`` (one of :pyeval:`constants.ST_FILE`,
2104 :pyeval:`constants.ST_LVM_PV` or :pyeval:`constants.ST_LVM_VG`) and
2105 ``output_fields``. The result will be a job id, using which the result
2109 .. _rapi-res-nodes-node_name-storage-modify:
2111 ``/2/nodes/[node_name]/storage/modify``
2112 +++++++++++++++++++++++++++++++++++++++
2114 Modifies storage units on the node.
2116 .. rapi_resource_details:: /2/nodes/[node_name]/storage/modify
2119 .. _rapi-res-nodes-node_name-storage-modify+put:
2124 Modifies parameters of storage units on the node. Requires the
2125 parameters ``storage_type`` (one of :pyeval:`constants.ST_FILE`,
2126 :pyeval:`constants.ST_LVM_PV` or :pyeval:`constants.ST_LVM_VG`)
2127 and ``name`` (name of the storage unit). Parameters can be passed
2128 additionally. Currently only :pyeval:`constants.SF_ALLOCATABLE` (bool)
2129 is supported. The result will be a job id.
2133 .. opcode_result:: OP_NODE_MODIFY_STORAGE
2136 .. _rapi-res-nodes-node_name-storage-repair:
2138 ``/2/nodes/[node_name]/storage/repair``
2139 +++++++++++++++++++++++++++++++++++++++
2141 Repairs a storage unit on the node.
2143 .. rapi_resource_details:: /2/nodes/[node_name]/storage/repair
2146 .. _rapi-res-nodes-node_name-storage-repair+put:
2153 constants.VALID_STORAGE_OPERATIONS == {
2154 constants.ST_LVM_VG: set([constants.SO_FIX_CONSISTENCY]),
2157 Repairs a storage unit on the node. Requires the parameters
2158 ``storage_type`` (currently only :pyeval:`constants.ST_LVM_VG` can be
2159 repaired) and ``name`` (name of the storage unit). The result will be a
2164 .. opcode_result:: OP_REPAIR_NODE_STORAGE
2167 .. _rapi-res-nodes-node_name-tags:
2169 ``/2/nodes/[node_name]/tags``
2170 +++++++++++++++++++++++++++++
2172 Manages per-node tags.
2174 .. rapi_resource_details:: /2/nodes/[node_name]/tags
2177 .. _rapi-res-nodes-node_name-tags+get:
2182 Returns a list of tags.
2186 ["tag1", "tag2", "tag3"]
2189 .. _rapi-res-nodes-node_name-tags+put:
2196 The request as a list of strings should be PUT to this URI. The result
2199 It supports the ``dry-run`` argument.
2202 .. _rapi-res-nodes-node_name-tags+delete:
2209 In order to delete a set of tags, the DELETE request should be addressed
2212 /tags?tag=[tag]&tag=[tag]
2214 It supports the ``dry-run`` argument.
2217 .. _rapi-res-query-resource:
2219 ``/2/query/[resource]``
2220 +++++++++++++++++++++++
2222 Requests resource information. Available fields can be found in man
2223 pages and using ``/2/query/[resource]/fields``. The resource is one of
2224 :pyeval:`utils.CommaJoin(constants.QR_VIA_RAPI)`. See the :doc:`query2
2225 design document <design-query2>` for more details.
2227 .. rapi_resource_details:: /2/query/[resource]
2230 .. _rapi-res-query-resource+get:
2235 Returns list of included fields and actual data. Takes a query parameter
2236 named "fields", containing a comma-separated list of field names. Does
2237 not support filtering.
2240 .. _rapi-res-query-resource+put:
2245 Returns list of included fields and actual data. The list of requested
2246 fields can either be given as the query parameter "fields" or as a body
2247 parameter with the same name. The optional body parameter "filter" can
2248 be given and must be either ``null`` or a list containing filter
2252 .. _rapi-res-query-resource-fields:
2254 ``/2/query/[resource]/fields``
2255 ++++++++++++++++++++++++++++++
2257 Request list of available fields for a resource. The resource is one of
2258 :pyeval:`utils.CommaJoin(constants.QR_VIA_RAPI)`. See the
2259 :doc:`query2 design document <design-query2>` for more details.
2261 .. rapi_resource_details:: /2/query/[resource]/fields
2264 .. _rapi-res-query-resource-fields+get:
2269 Returns a list of field descriptions for available fields. Takes an
2270 optional query parameter named "fields", containing a comma-separated
2271 list of field names.
2281 .. rapi_resource_details:: /2/os
2284 .. _rapi-res-os+get:
2289 Return a list of all OSes.
2291 Can return error 500 in case of a problem. Since this is a costly
2292 operation for Ganeti 2.0, it is not recommended to execute it too often.
2304 Manages cluster tags.
2306 .. rapi_resource_details:: /2/tags
2309 .. _rapi-res-tags+get:
2314 Returns the cluster tags.
2318 ["tag1", "tag2", "tag3"]
2321 .. _rapi-res-tags+put:
2328 The request as a list of strings should be PUT to this URI. The result
2331 It supports the ``dry-run`` argument.
2334 .. _rapi-res-tags+delete:
2341 In order to delete a set of tags, the DELETE request should be addressed
2344 /tags?tag=[tag]&tag=[tag]
2346 It supports the ``dry-run`` argument.
2349 .. _rapi-res-version:
2354 The version resource.
2356 This resource should be used to determine the remote API version and to
2357 adapt clients accordingly.
2359 .. rapi_resource_details:: /version
2362 .. _rapi-res-version+get:
2367 Returns the remote API version. Ganeti 1.2 returned ``1`` and Ganeti 2.0
2371 .. _rapi-access-permissions:
2376 The following list describes the access permissions required for each
2377 resource. See :ref:`rapi-users` for more details.
2379 .. rapi_access_table::
2382 .. vim: set textwidth=72 :