Statistics
| Branch: | Tag: | Revision:

root / lib / rapi @ d9b67f70

# Date Author Comment
d9b67f70 05/11/2010 05:31 pm Michael Hanselmann

RAPI client: Allow waiting for job changes

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

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

RAPI: Allow waiting for job changes

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

cf9ada49 05/11/2010 05:31 pm Michael Hanselmann

RAPI client: Rename “DeleteJob” to “CancelJob”

Jobs can't be deleted, but cancelled (even though the HTTP method
“DELETE” is used).

Signed-off-by: Michael Hanselmann <>
Reviewed-by: David Knowles <>

cfc03c54 05/11/2010 05:31 pm Michael Hanselmann

RAPI client: Various code style changes

- Replace hardcoded values with constants
- Code formatting
- Exception messages without periods and fixed string formatting

Signed-off-by: Michael Hanselmann <>
Reviewed-by: David Knowles <>

768747ed 05/11/2010 05:30 pm Michael Hanselmann

RAPI client: Always pass _SendRequest args as positional

Signed-off-by: Michael Hanselmann <>
Reviewed-by: David Knowles <>

ccd6b542 05/11/2010 05:29 pm Michael Hanselmann

RAPI client: Simplify URL construction

Signed-off-by: Michael Hanselmann <>
Reviewed-by: David Knowles <>

d3844674 05/11/2010 05:29 pm Michael Hanselmann

RAPI client: Instantiate JSON encoder only once

Signed-off-by: Michael Hanselmann <>
Reviewed-by: David Knowles <>

cd577680 05/11/2010 05:29 pm Michael Hanselmann

RAPI client: Always return job ID

Even removing tags returns a job ID.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: David Knowles <>

a60e3cb0 05/11/2010 05:27 pm Michael Hanselmann

RAPI client: Hardcode version in URLs

If the version changes, the API is likely to change as well. Not
having to ask for the version first makes the code simpler.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: David Knowles <>

9279e986 05/11/2010 05:27 pm Michael Hanselmann

Remove httplib2 dependency from ganeti.rapi.client

- It's possible to implement all functionality in ganeti.rapi.client
using Python's standard modules httplib and urllib2
- By doing so, proper SSL certificate verification is implemented
- Adjust some of the code to Ganeti's code style (this is not yet...

f2f88abf 05/04/2010 08:13 pm David Knowles

Small fixes for RAPI client

- Always check SSL certificate for validity
- Actually JSON-encode HTTP content

Signed-off-by: David Knowles <>
Signed-off-by: Michael Hanselmann <>
Reviewed-by: Michael Hanselmann <>

cab667cc 04/21/2010 10:23 am David Knowles

Fix RAPI client methods return values

Ensure that all RAPI client methods that should return job ids actually
return job ids.

Signed-off-by: David Knowles <>
Reviewed-by: Iustin Pop <>
Signed-off-by: Iustin Pop <>

bb579a7d 04/20/2010 12:11 pm René Nussbaumer

Fix heading to the one of epydoc

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

88394aa7 04/15/2010 12:08 pm René Nussbaumer

Improving the RAPI documentation

  • Be more clear about when POST and PUT should be used
  • Be more verbose on parameters
  • Describe allowed parameter values (if not self explaining)

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

95ab4de9 04/06/2010 05:37 pm David Knowles

Adding RAPI client library.

Signed-off-by: David Knowles <>
Reviewed-by: Iustin Pop <>
Signed-off-by: Iustin Pop <>
(modified slightly the unittest to account for
missing httplib2 library)

2263aec2 03/23/2010 10:33 am René Nussbaumer

Adding missing documentation to make the docs better

Also fixed a typo I noticed.

Signed-off-by: René Nussbaumer <>
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 <>

2d54e29c 01/04/2010 11:17 am Iustin Pop

Further pylint disables, mostly for Unused args

Many of our functions have to follow a given API, and thus we have to
keep a given signature, but pylint doesn't understand this. Therefore,
we silence this warning.

The patch does a few other cleanups.

Signed-off-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 <>

7260cfbe 01/04/2010 11:15 am Iustin Pop

Add targeted pylint disables

This patch should have only:

- pylint disables
- docstring changes
- whitespace changes

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 <>...

460d22be 12/16/2009 11:54 am Iustin Pop

Command line/RAPI support for --no-name-check

This patch adds --no-name-check to gnt-instance add and gnt-backup
import. This is opposite to the opcode parameter (name_check) as it is
similar to ip_check and start.

It also adds it to RAPI and gnt-instance batch-create as a parameter in...

82e186f8 11/25/2009 02:08 pm Michael Hanselmann

Re-add “nic.bridges” field to RAPI bulk instance list

Commit 495cfdf0 removed “nic.bridges” from the default
list for bulk instance list RAPI requests.

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

64246438 10/13/2009 03:03 pm Iustin Pop

rapi: fix tag operations

This patch fixes the tag PUT/DELETE operations, and additionally changes
the Tags* functions to take only positional and not keyword arguments
(the defaults do not make any sense at all, and they are always called
with all arguments)....

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 <>

e3ac208c 10/05/2009 12:46 pm Guido Trotter

Update client os lists to name+variant format

List of OSes are displayed by gnt-os list, rapi, and gnt-instance
reinstall --select-os, and checked by burnin. In all of these show the
list with name+variant, if the os has variants.

Signed-off-by: Guido Trotter <>...

7118a0df 09/24/2009 02:38 pm Iustin Pop

Export the uuid in RAPI

This also simplifies a little the field declaration in RAPI.

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

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 <>

5c566e17 08/28/2009 06:35 pm Michael Hanselmann

Merge branch 'next' into branch-2.1

  • next:
    Add script to clean archived jobs after 21 days
    rapi: export more static node information
    Pass the correct signal to handlers
    cli: Use ToStdout/ToStderr instead of print
    Fix small typo in gnt-node
    Simplify handling of boolean args in rapi...
93962b80 08/25/2009 04:20 pm Iustin Pop

rapi: export more static node information

Currently not all static node information is exported over rapi, and
this makes it less complete than gnt-node list. This patch attempts to
reduce the difference.

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

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 <>

94cdfa4a 08/14/2009 12:51 pm Iustin Pop

Simplify handling of boolean args in rapi

This patch replaces hardcoded boolean-type args with
bool(_checkIntVariable). There should be no other cases of this left, I
think.

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

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 <>

73086975 08/13/2009 02:49 pm Michael Hanselmann

rlib2: Remove leftover DOC_URI constant

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 <>

8381fa2d 08/11/2009 05:05 pm Michael Hanselmann

rlib2: Import rapi

This fixes ganeti-rapi which was broken in commit 7a95a954.

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 <>

3fb8680a 07/30/2009 07:36 pm Michael Hanselmann

rapi: Add default parameter to _checkIntVariable

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Guido Trotter <>
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...
2a061e15 07/17/2009 02:40 pm Guido Trotter

Merge branch 'master' into next

  • master:
    Update NEWS and version for 2.0.2 release
    Improve the description of node flags in man page
    Change default stripe count to 1
    Use full-stripe size in LVM growth
    RAPI: implement instance reinstall
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 <>

3427d34f 07/13/2009 05:58 pm Michael Hanselmann

rapi: Add generic “force” parameter

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...

2f7140ba 07/08/2009 12:28 pm Guido Trotter

Merge branch 'next' into branch-2.1

  • next:
    Create a new --no-voting option for masterfailover
    ganeti-masterd: allow non-interactive --no-voting
    Fix pylint warnings
    Add custom pylintrc
    bootstrap: Don't leak file descriptor when generating SSL certificate...
7c4d6c7b 07/07/2009 03:54 pm Michael Hanselmann

Fix pylint warnings

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

6f59b964 06/19/2009 04:24 pm Iustin Pop

rapi: implement dry-run mode

This patch implements dry-run mode for the operations which modify the
state of the cluster. Dry-run mode is enabled by passing a 'dry-run'
query argument with positive integer value.

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

495cfdf0 06/17/2009 04:22 pm Guido Trotter

RAPI: move to nic parameters

In query we ask for nic.links, rather than nic.bridges
In create we accept both "link" and "bridge" and let the opcode deal
with it. Note that we still can create only one nic per instance.

Signed-off-by: Guido Trotter <>...

af0413bb 06/16/2009 02:28 pm Guido Trotter

Merge branch 'next' into branch-2.1

  • next: (22 commits)
    Update NEWS and version for 2.0.1 release
    gnt-{instance,backup}(8) --nic is actually --net
    Fix a wrong function name in backend.DrbdAttachNet
    GNT-CLUSTER fix search-tags example
    Enable stripped LVs...
59b4eeef 05/25/2009 01:12 pm Iustin Pop

rapi: rework error handling

Currently the rapi code doesn't have any custom error handling; any
exceptions raised are simply converted into an HTTP 500 error, without
much explanation.

This patch adds a couple of generic SubmitJob/GetClient functions that...

25e39bfa 05/25/2009 12:14 pm Iustin Pop

rapi: make tags query not use jobs

Currently the rapi tags query implementation is similar to the command
line one: it submits OpGetTags jobs. This not good, since this being an
API it can be used a lot and can pollute the job queue with many such
trivial jobs....

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 <>...

a8b16c4e 05/11/2009 12:12 pm Tim Boring

Exporting the instance network_port on the RAPI

Patch for adding network_port to the instance attributes exported by the
RAPI.

[: slightly changed the formatting]
Signed-off-by: Iustin Pop <>
Reviewed-by: Iustin Pop <>

5fcc718f 02/27/2009 03:06 pm Iustin Pop

Fix some epydoc style issues

99% of the epydoc return tags are "@return:", but each of the modified files
had one "@returns:" line. We fix this for consistency.

Reviewed-by: imsnah

74aa2478 02/19/2009 05:49 pm Iustin Pop

Update version numbers to beta2

Note that the RAPI change is in a docstring (i.e. example), not in code.

Reviewed-by: ultrotter

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

6e99c5a0 02/13/2009 05:54 pm Iustin Pop

RAPI: fixes related to write mode

This patch fixes many small issues related to write functions:
- update documentations w.r.t. how to add users
- update the instance add function for latest API
- add instance delete
- fix addition of tags
- update some error messages...

0b2454b9 02/10/2009 04:45 pm Iustin Pop

Allow query of the drained node attribute

This patch exports the drained attribute:
- LUQueryNodes accepts now the drained field
- RAPI exports it for node objects
- gnt-node info shows it now (along newly-added master_candidate and
offline flags)...

7a6b9510 02/10/2009 03:40 pm Iustin Pop

RAPI: fix a pylint warning

Child classes of _R_TAGS must define TAG_LEVEL, but for good style let's
define it also here to at least ensure we don't get a 'Unknown
attribute' exception.

Of course, this also silences a pylint warning.

Reviewed-by: amishchenko

024e157f 02/09/2009 04:04 pm Iustin Pop

Add a new instance query flag ‘disk_usage’

This patch adds a new instance query flag called disk_usage that
retrieves the overall space used by an instance on each of its nodes.
This can be used when balancing the cluster or checking N+1 status.

The flag is also exported in RAPI. Note the flag is currently broken for...

0105bad3 02/09/2009 12:41 pm Iustin Pop

Export the cpu nodes and sockets from Xen

This is a hand-picked forward patch of commit 1755 on the 1.2 branch
(hand-picked since the trees diverged too much since then):

The patch changed the xen hypervisor to compute the number of cpu
sockets/nodes and enables the command line and the RAPI to show this...
ee69c97f 02/06/2009 10:09 am Iustin Pop

Fix rapi job listing

This patch fixes a couple of issues with the job listing:
- in case of a non-existing job, nicely raise 404 instead of 500
- in the job detail listing, also list the job log, the job
timestamps, etc.
- the opcode migrate instance was missing its description field...

a5b9d725 02/05/2009 11:47 am Iustin Pop

Revive RAPI QA tests for 2.0-style RAPI

This patch fixes the RAPI QA tests to work with today's RAPI code and
also does some other minor improvements:
- QA: only create the cluster if so configured (‘create-cluster’ key),
this allows running parts of the QA suite against existing clusters...

3d103742 02/04/2009 09:14 pm Iustin Pop

rapi: fix 'bulk' processing and add locking option

This patch fixes the 'bulk' parameter (before any non-empty
specification was considered True, in conflict with the documentation,
i.e. bulk=0 still did bulk queries).

The patch also adds optional locking on the instance/node listing (does...

9031ee8e 02/04/2009 09:14 pm Iustin Pop

rapi: cleanup and update to latest 2.0 API

This patch cleans up and updates the RAPI interface:
- queries are changes to luxi queries instead of jobs, where possible
- since we changed the API version, we remove the old-style attributes
(sda_size, ip, etc.) and replace them with 2.0 style...

ec79568d 02/04/2009 12:30 pm Iustin Pop

Implement lockless query operations

This patch adds the framework for, and enables lockless OpQueryInstances. This
means that instances will be shown in ERROR_up or ERROR_down state, even though
this is not an error (but just an in-progress job).

The framework is implemented as follows:...

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

b5b67ef9 12/19/2008 02:58 pm Michael Hanselmann

ganeti-rapi: Implement HTTP authentication

Passwords are stored in "$localstatedir/lib/ganeti/rapi_users". User
options specify the access permissions of a user (see docstring for
ganeti.http.ReadPasswordFile), for which only "write" is supported
to grant write access. Every other user has read-only access....

79589f25 12/18/2008 03:45 pm Michael Hanselmann

Rename http.HttpInternalError to HttpInternalServerError

All other exceptions are named after the error name in RFC2616 (HTTP/1.1).

Reviewed-by: amishchenko

f6f91001 12/14/2008 02:05 pm Iustin Pop

cleanup: rapi v2 instance tags wrong attribute

This was changed in the past, but it seems this class was forgotten.

Reviewed-by: amishchenko

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

21f04e5e 11/26/2008 01:25 pm Oleksiy Mishchenko

RAPI: Make calls safier

Reviewed-by: imsnah

c7f5f338 11/21/2008 05:55 pm Oleksiy Mishchenko

RAPI: Cancel a job

Reviewed-by: imsnah

d50b3059 11/19/2008 01:09 pm Oleksiy Mishchenko

RAPI: Instance modify.

Split parameters filter to the separate function and reuse it in instance creation.

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

1a05d855 10/23/2008 01:41 am Oleksiy Mishchenko

RAPI: Export beparams as dict. The patch also enables LUQueryInstances to accept beparams as valid field.

Reviewed-by: iustinp

212fa3a7 10/22/2008 11:54 pm Oleksiy Mishchenko

RAPI: Forgoten in r1923 instance add change.

Reviewed-by: iustinp

7a8f64da 10/21/2008 11:32 pm Oleksiy Mishchenko

Pass request headers in to RAPI handlers.

Reviewed-by: iustinp

713faea6 10/17/2008 04:06 pm Oleksiy Mishchenko

ETag passing support.

Reviewed-by: imsnah

16a8967d 10/16/2008 07:54 pm Michael Hanselmann

rapi: Convert to new HTTP server class

Requests are no longer logged to a separate file.

Reviewed-by: amishchenko

2f7635f4 10/16/2008 05:40 pm Oleksiy Mishchenko

RAPI: Instance add/delete implementation.

Reviewed-by: iustinp

966405b7 10/15/2008 01:13 pm Michael Hanselmann

rapi: Don't throw class as an exception

Reviewed-by: ultrotter

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

rapi: Whitespace fixes

Reviewed-by: ultrotter

937e4814 10/14/2008 11:24 am Michael Hanselmann

Get rid of httperror module

This was a leftover from the early days of the remote API in Ganeti 1.2.

Reviewed-by: ultrotter

e49099a4 10/08/2008 08:31 pm Alexander Schreiber

Update scripts and qa config for changed hypervisor names.

Reviewed-by: ultrotter

15fd9fd5 07/31/2008 03:58 pm Oleksiy Mishchenko

RAPI Implement DELETE for tags

Reviewed-by: imsnah

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