Statistics
| Branch: | Tag: | Revision:

root / lib / rapi / connector.py @ 653bc0f1

History | View | Annotate | Download (9.1 kB)

# Date Author Comment
fb409531 03/22/2013 05:01 pm Michele Tartara

Remove use of deprecated function

cgi.parse_qs() is deprecated in python 2.6 and substituted by
urlparse.parse_qs().

This patch modifies the code to use the new function.

Signed-off-by: Michele Tartara <>
Reviewed-by: Helga Velroyen <>

798f1ac9 02/20/2013 01:14 pm Michael Hanselmann

Allow generating different RAPI resource lookup tables

Until now the RAPI resource table returned by
“rapi.connector.GetHandlers” always uses fixed strings or compiled
regular expressions as dictionary keys. Now that a table of all RAPI
resources (and their access rights) should be written for the...

6e8091f9 11/20/2012 07:51 pm Dimitris Aragiorgis

Fixes to pass unittests (make check)

Signed-off-by: Dimitris Aragiorgis <>
Reviewed-by: Iustin Pop <>

4588b4bd 11/20/2012 07:51 pm Dimitris Aragiorgis

Rapi support for networks

Support:
- GetNetwork(s)
- CreateNetwork
- ConnectNetwork
- DisconnectNetwork
- RemoveNetwork

Signed-off-by: Dimitris Aragiorgis <>
Reviewed-by: Iustin Pop <>

4ee72287 09/24/2012 02:49 pm René Nussbaumer

Adding RAPI resource for multi-allocation

This is straightforward.

Signed-off-by: René Nussbaumer <>
Reviewed-by: Michael Hanselmann <>

682878d9 10/18/2011 04:00 pm Guido Trotter

Merge branch 'devel-2.5'

  • devel-2.5:
    rapi.client.ModifyNode should PUT rather than POST
    Fix RAPI node modify client and server calls
    xen: changes to facilitate "xl" support (xen 4.1)
    xen: abstract instance config file naming
    Abstract xen's 'xm' command as a constant...
94497dd1 10/13/2011 05:40 pm Michael Hanselmann

rapi: Add resource for modifying node

A separate patch will add “auto-promote” through
“/2/nodes/[node_name]/role”.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

42d4d8b9 09/20/2011 06:17 pm Michael Hanselmann

RAPI: Add resource to powercycle node

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

a52978c7 09/16/2011 10:44 am Michael Hanselmann

RAPI: Add resource to recreate instance's disks

This was still missing from RAPI.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

e4f4896b 09/15/2011 04:40 pm Guido Trotter

Merge branch 'devel-2.5'

  • devel-2.5: (33 commits)
    htools: remove dead code
    hail: don't select the primary as new secondary
    hail: add an extra safety check in relocate
    Fix RAPI documentation for gnt-instance console
    Add SPICE compression and streaming options...
132cdb87 09/13/2011 02:38 pm Michael Hanselmann

rapi: Re-add “/2” resource

Like “/”, it'll just return a JSON null.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

0f945c65 09/07/2011 06:40 pm Michael Hanselmann

rapi: Remove “/2” resource, deprecate “/”

These were never really useful. Neither gave a complete list of
available resources—the documentation in doc/rapi.rst is much better at
that.

Since some monitoring code might use the “/” resource it's kept around...

b459a848 08/30/2011 11:24 am Andrea Spadaccini

DeprecationWarning fixes for pylint

In version 0.21, pylint unified all the disable-* (and enable-*)
directives to disable (resp. enable). This leads to a lot of
DeprecationWarning being emitted even if one uses the recommended
version of pylint (0.21.1, as stated in devnotes.rst)....

d0c8c01d 07/25/2011 04:55 pm Iustin Pop

Most boring patch ever

s/'/"/ in (hopefully) the right places.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

c0a146a1 07/21/2011 04:25 pm Michael Hanselmann

Implement instance failover via RAPI

No idea why this was missed before.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

414ebaf1 04/21/2011 04:08 pm Michael Hanselmann

RAPI: Add support for tagging node groups

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

208a6cff 03/15/2011 03:04 pm Michael Hanselmann

RAPI: Add support for querying resources

- Access is only permitted for authenticated clients (queries can return
sensitive data)
- Filters can be specified when sending a PUT request
- Updates RAPI client, documentation and tests

Signed-off-by: Michael Hanselmann <>...

1c7fd467 03/15/2011 03:04 pm Michael Hanselmann

Add support for query resources in RAPI URIs

Signed-off-by: Michael Hanselmann <>
Reviewed-by: René Nussbaumer <>

b82d4c5e 01/28/2011 04:31 pm Michael Hanselmann

Add RAPI resource for instance console

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

b58a4d16 01/12/2011 07:54 pm Michael Hanselmann

Fix typos in RAPI docstrings, add unittest

This patch fixes a number of typos and standardizes RAPI resource
docstrings. A unittest is added.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

4245446f 01/10/2011 06:32 pm Adeodato Simo

Expose OpAssignGroupNodes over RAPI and RAPI client

Signed-off-by: Adeodato Simo <>
Reviewed-by: Michael Hanselmann <>

e23881ed 01/05/2011 06:14 pm Michael Hanselmann

RAPI: Add resource to grow instance disk

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

62e999a5 01/05/2011 01:27 pm Michael Hanselmann

RAPI: Add resource to modify cluster

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

f18fab7d 12/13/2010 06:33 pm Adeodato Simo

Expose OpSetGroupParams in RAPI and RAPI client

This creates the /2/groups/<name>/modify resource; at the moment, only the
"alloc_policy" attribute can be modified.

Signed-off-by: Adeodato Simo <>
Reviewed-by: Michael Hanselmann <>

0dbaa9ca 12/08/2010 02:27 pm Adeodato Simo

Group operations: expose add/remove/rename in RAPI

Signed-off-by: Adeodato Simo <>
Reviewed-by: Michael Hanselmann <>

0897dc97 12/01/2010 09:31 pm Adeodato Simo

Querying node groups: RAPI support

This implements /groups and /groups/%s RAPI end points.

Signed-off-by: Adeodato Simo <>
Signed-off-by: Iustin Pop <>
Reviewed-by: Iustin Pop <>

0b5303da 11/28/2010 03:57 pm Iustin Pop

Move compilation of some regexes to init time

I have found a few regexes which are static and thus can be moved to
load time, rather than run time, creation.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

691c81b7 10/20/2010 03:53 pm Michael Hanselmann

utils: Add function to find items in dictionary using regex

This basically extracts a small piece of code from ganeti-rapi and puts
it into a utility function. RAPI resources are found using a dictionary
in which the keys can either be static strings or compiled regular...

3882937a 08/18/2010 02:21 pm Michael Hanselmann

RAPI: Allow modifying instance

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

d56e7dc7 08/10/2010 06:55 pm Michael Hanselmann

Allow renaming instances via RAPI

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

2c0be3d0 07/29/2010 08:50 pm Michael Hanselmann

Add check for RAPI paths to start with /2

During a discussion in July 2010 it was decided that we'll stabilize on /2. See
message ID <> for reference.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

5823e0d2 07/29/2010 04:05 pm Michael Hanselmann

RAPI: Support migrating instances

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

ebeb600f 05/18/2010 06:53 pm Michael Hanselmann

RAPI changes for instance moves

Two new resources are added:
- /2/instances/$name/prepare-export
- /2/instances/$name/export

The documentation for the existing resource for creating instances is updated
for remote imports. The RAPI client is extended for the new resources....

7eac4a4d 05/13/2010 04:57 pm Michael Hanselmann

Add new /2/features RAPI resource

The /2/features RAPI resource can be used to detect optional
features implemented by the RAPI server. This will be used
to recognize servers implementing a new request format for
instance creation requests.

Signed-off-by: Michael Hanselmann <>...

793a8f7c 05/11/2010 05:31 pm Michael Hanselmann

RAPI: Allow waiting for job changes

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

0a37de5f 03/22/2010 05:25 pm René Nussbaumer

Adding RAPI call to deactivate-disks for an instance

Signed-off-by: René Nussbaumer <>
Reviewed-by: Iustin Pop <>

2197b66f 03/22/2010 05:25 pm René Nussbaumer

Adding RAPI call for activate-disks on an instance

Signed-off-by: René Nussbaumer <>
Reviewed-by: Iustin Pop <>

e11ddf13 01/04/2010 11:16 am Iustin Pop

pylint cleanups: dangerous initializers

Plus a silence for a wrong "uninitialized var".

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

7e950d31 01/04/2010 11:16 am Iustin Pop

Convert to static methods (where appropriate)

Many methods are simple pure functions, and not depending on the object
state. We convert these to staticmethods.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

d984846d 12/28/2009 02:05 pm Iustin Pop

Merge branch 'devel-2.0' into devel-2.1

  • devel-2.0:
    Fix indentation in hv_kvm
    Implement BuildHooksEnv for NoHooksLU
    Clarifiy some more wide pylint disables
    Fix two bugs in seldom-used codepaths
    Update pylintrc
    Add targetted pylint disables
    Partial cherry-pick of 6c881c5 from the 2.1 branch...
fe267188 12/28/2009 12:43 pm Iustin Pop

Add targetted pylint disables

This patch adds targeted pylint disables, where it makes sense (either
due to limitations in pylint or due to historical usage), and also a few
blanket ones in rapi where all the names are… “different”.

Signed-off-by: Iustin Pop <>...

69b99987 10/12/2009 01:48 pm Michael Hanselmann

Code and docstring style fixes

Found using pylint and epydoc.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

508e9b20 09/03/2009 06:45 pm Michael Hanselmann

Add RAPI resource to redistribute config

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Luca Bigliardi <>

bf968b7f 09/03/2009 06:45 pm Michael Hanselmann

Add simple unittest for remote API docs

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Luca Bigliardi <>

d8260842 08/18/2009 12:40 pm Michael Hanselmann

rapi: Add /2/instances/[instance_name]/info resource

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

723f4565 08/17/2009 03:00 pm Michael Hanselmann

rapi: Add /2/nodes/[node_name]/storage/repair resource

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

4c98b915 08/13/2009 02:49 pm Michael Hanselmann

rapi: Add /2/instances/[instance_name]/replace-disks resource

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

1e82bc80 08/11/2009 05:05 pm Michael Hanselmann

rapi: Add /2/nodes/[node_name]/storage/modify resource

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

7a95a954 08/11/2009 02:55 pm Michael Hanselmann

rapi: Add /2/nodes/[node_name]/storage resource

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>

1c482bab 07/31/2009 02:31 pm Michael Hanselmann

rapi: Add /2/nodes/[node_name]/migrate resource

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

73452f12 07/30/2009 02:02 pm Michael Hanselmann

rapi: Add /2/[node_name]/evacuate resource

This can be used to evacuate a node.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

539210af 07/17/2009 02:41 pm Guido Trotter

Merge branch 'next' into branch-2.1

  • next:
    Fix another issue with hypervisor_name change
    Update NEWS and version for 2.0.2 release
    Improve the description of node flags in man page
    Add enabled hypervisors to TestConfigRunner
    Add a few more checks to verify config...
64dae8fc 07/13/2009 05:59 pm Michael Hanselmann

rapi: Implement /2/nodes/[node_name]/role resource

This resource can be used to retrieve and set the role of a node.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Iustin Pop <>

e5b7c4ca 07/13/2009 12:47 pm Iustin Pop

RAPI: implement instance reinstall

This patch adds instance reinstall to RAPI, with two optional parameters:
- ‘os', in order to change the OS on reinstall
- ‘nostartup’, in order to leave the instance down after reinstall

The call will first shutdown the instance, the reinstall it, and unless...

c8e0a534 05/21/2009 04:06 pm Iustin Pop

Doc fixes for RAPI

After moving the documentation from the .py files to .rst, we had some
cleanups to do.

This fixes the formatting of the comments, improves them a little, and
removes deprecated info (DOC_URI) from the python source.

Signed-off-by: Iustin Pop <>...

bf4a90af 02/13/2009 06:17 pm Iustin Pop

RAPI: documentation updates

This patch fixes the version and does some update to the RAPI resources
docs.

Reviewed-by: imsnah

18cb43a2 01/29/2009 05:03 pm Oleksiy Mishchenko

RAPI: tag work

Generalize tag work for instances/nodes/cluster tag management.

Reviewed-by: iustinp

4e5a68f8 01/29/2009 05:03 pm Oleksiy Mishchenko

RAPI: rlib1 removal

The resources we still need moved to rlib2.

Reviewed-by: iustinp

fc72a3a3 01/29/2009 05:02 pm Oleksiy Mishchenko

RAPI: Implement /2 resource

Reviewed-by: iustinp

dc824c9f 01/29/2009 04:52 pm Oleksiy Mishchenko

RAPI: Deprecate version Rapi version1

It is impossible to keep backward compatibility due to
significant changes in the Ganeti core.

Reviewed-by: iustinp

c41eea6e 12/11/2008 07:13 pm Iustin Pop

Fix epydoc format warnings

This patch should fix all outstanding epydoc parsing errors; as such, we
switch epydoc into verbose mode so that any new errors will be visible.

Reviewed-by: imsnah

84f2756e 12/04/2008 05:23 pm Michael Hanselmann

Rename all HTTP classes to camel case

It should be consistent.

Reviewed-by: amishchenko

028c6b76 11/28/2008 03:58 pm Oleksiy Mishchenko

RAPI:Fix root list and unittest for it.

Reviewed-by: imsnah

a0dcf7c2 11/28/2008 02:02 pm Oleksiy Mishchenko

RAPI: Switch from opcodes to no native 2.0 queries.

Reviewed-by: imsnah

0c55c24b 11/14/2008 06:59 pm Oleksiy Mishchenko

RAPI: Instance startup/shutdown resources

Reviewed-by: imsnah

2276aa29 11/14/2008 12:34 pm Oleksiy Mishchenko

RAPI: Implement an instance reboot

Reviewed-by: imsnah

a2f92677 10/15/2008 11:22 am Michael Hanselmann

rapi: Whitespace fixes

Reviewed-by: ultrotter

441e7cfd 07/31/2008 12:06 pm Oleksiy Mishchenko

First write operation (add tag) for Ganeti RAPI

Add instance tag handling, improved error logging.
...oh, yes adopt instance listing for RAPI2!

Reviewed-by: iustinp

a0638838 07/24/2008 07:34 pm Oleksiy Mishchenko

Switch RAPI to ganeti.http module

Reviewed-by: imsnah

10b207d4 07/22/2008 04:33 pm Oleksiy Mishchenko

Split RAPI resources to pieces

Reviewed-by: iustinp