Revision 2cad4b91
b/doc/rapi.rst | ||
---|---|---|
25 | 25 |
.. _JSON: http://www.json.org/ |
26 | 26 |
.. _REST: http://en.wikipedia.org/wiki/Representational_State_Transfer |
27 | 27 |
|
28 |
Generic parameters |
|
29 |
------------------ |
|
30 |
|
|
31 |
A few parameter mean the same thing across all resources which implement it. |
|
32 |
|
|
33 |
``bulk`` |
|
34 |
++++++++ |
|
35 |
|
|
36 |
Bulk-mode means that for the resources which usually return just a |
|
37 |
list of child resources (e.g. ``/2/instances`` which returns just |
|
38 |
instance names), the output will instead contain detailed data for all |
|
39 |
these subresources. This is more efficient than query-ing the |
|
40 |
sub-resources themselves. |
|
41 |
|
|
42 |
``dry-run`` |
|
43 |
+++++++++++ |
|
44 |
|
|
45 |
The optional *dry-run* argument, if provided and set to a positive |
|
46 |
integer value (e.g. ``?dry-run=1``), signals to Ganeti that the job |
|
47 |
should not be executed, only the pre-execution checks will be done. |
|
48 |
|
|
49 |
This is useful in trying to determine (without guarantees though, as |
|
50 |
in the meantime the cluster state could have changed) if the operation |
|
51 |
is likely to succeed or at least start executing. |
|
52 |
|
|
28 | 53 |
Usage examples |
29 | 54 |
-------------- |
30 | 55 |
|
... | ... | |
58 | 83 |
JavaScript |
59 | 84 |
++++++++++ |
60 | 85 |
|
61 |
.. warning:: While it's possible to use JavaScript, it poses several potential
|
|
62 |
problems, including browser blocking request due to |
|
63 |
non-standard ports or different domain names. Fetching the data |
|
64 |
on the webserver is easier.
|
|
86 |
.. warning:: While it's possible to use JavaScript, it poses several |
|
87 |
potential problems, including browser blocking request due to
|
|
88 |
non-standard ports or different domain names. Fetching the data on
|
|
89 |
the webserver is easier. |
|
65 | 90 |
|
66 | 91 |
.. highlight:: javascript |
67 | 92 |
|
... | ... | |
171 | 196 |
|
172 | 197 |
Returns a list of all available instances. |
173 | 198 |
|
174 |
|
|
175 | 199 |
Example:: |
176 | 200 |
|
177 | 201 |
[ |
... | ... | |
224 | 248 |
|
225 | 249 |
Creates an instance. |
226 | 250 |
|
251 |
If the optional *dry-run* argument is provided and set to a positive |
|
252 |
integer valu (e.g. ``?dry-run=1``), the job will not be actually |
|
253 |
executed, only the pre-execution checks will be done. Query-ing the |
|
254 |
job result will return, in both dry-run and normal case, the list of |
|
255 |
nodes selected for the instance. |
|
256 |
|
|
227 | 257 |
Returns: a job ID that can be used later for polling. |
228 | 258 |
|
229 | 259 |
``/2/instances/[instance_name]`` |
... | ... | |
244 | 274 |
|
245 | 275 |
Deletes an instance. |
246 | 276 |
|
277 |
It supports the ``dry-run`` argument. |
|
278 |
|
|
247 | 279 |
|
248 | 280 |
``/2/instances/[instance_name]/reboot`` |
249 | 281 |
+++++++++++++++++++++++++++++++++++++++ |
... | ... | |
260 | 292 |
The URI takes optional ``type=hard|soft|full`` and |
261 | 293 |
``ignore_secondaries=False|True`` parameters. |
262 | 294 |
|
295 |
It supports the ``dry-run`` argument. |
|
296 |
|
|
297 |
|
|
263 | 298 |
``/2/instances/[instance_name]/shutdown`` |
264 | 299 |
+++++++++++++++++++++++++++++++++++++++++ |
265 | 300 |
|
... | ... | |
272 | 307 |
|
273 | 308 |
Shutdowns an instance. |
274 | 309 |
|
310 |
It supports the ``dry-run`` argument. |
|
311 |
|
|
275 | 312 |
|
276 | 313 |
``/2/instances/[instance_name]/startup`` |
277 | 314 |
++++++++++++++++++++++++++++++++++++++++ |
... | ... | |
288 | 325 |
The URI takes an optional ``force=False|True`` parameter to start the |
289 | 326 |
instance if even if secondary disks are failing. |
290 | 327 |
|
328 |
It supports the ``dry-run`` argument. |
|
329 |
|
|
330 |
|
|
291 | 331 |
``/2/instances/[instance_name]/tags`` |
292 | 332 |
+++++++++++++++++++++++++++++++++++++ |
293 | 333 |
|
... | ... | |
312 | 352 |
The request as a list of strings should be ``PUT`` to this URI. The |
313 | 353 |
result willl be a job id. |
314 | 354 |
|
355 |
It supports the ``dry-run`` argument. |
|
356 |
|
|
357 |
|
|
315 | 358 |
``DELETE`` |
316 | 359 |
~~~~~~~~~~ |
317 | 360 |
|
... | ... | |
322 | 365 |
|
323 | 366 |
/tags?tag=[tag]&tag=[tag] |
324 | 367 |
|
368 |
It supports the ``dry-run`` argument. |
|
369 |
|
|
370 |
|
|
325 | 371 |
``/2/jobs`` |
326 | 372 |
+++++++++++ |
327 | 373 |
|
... | ... | |
436 | 482 |
The request as a list of strings should be PUT to this URI. The result |
437 | 483 |
will be a job id. |
438 | 484 |
|
485 |
It supports the ``dry-run`` argument. |
|
486 |
|
|
439 | 487 |
``DELETE`` |
440 | 488 |
~~~~~~~~~~ |
441 | 489 |
|
... | ... | |
446 | 494 |
|
447 | 495 |
/tags?tag=[tag]&tag=[tag] |
448 | 496 |
|
497 |
It supports the ``dry-run`` argument. |
|
498 |
|
|
499 |
|
|
449 | 500 |
``/2/os`` |
450 | 501 |
+++++++++ |
451 | 502 |
|
... | ... | |
490 | 541 |
The request as a list of strings should be PUT to this URI. The result |
491 | 542 |
will be a job id. |
492 | 543 |
|
544 |
It supports the ``dry-run`` argument. |
|
545 |
|
|
546 |
|
|
493 | 547 |
``DELETE`` |
494 | 548 |
~~~~~~~~~~ |
495 | 549 |
|
... | ... | |
500 | 554 |
|
501 | 555 |
/tags?tag=[tag]&tag=[tag] |
502 | 556 |
|
557 |
It supports the ``dry-run`` argument. |
|
558 |
|
|
559 |
|
|
503 | 560 |
``/version`` |
504 | 561 |
++++++++++++ |
505 | 562 |
|
Also available in: Unified diff