Statistics
| Branch: | Tag: | Revision:

root / test / ganeti.rapi.client_unittest.py @ 3ce9a5e7

History | View | Annotate | Download (45.8 kB)

# Date Author Comment
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 <>

9a8ae794 03/30/2011 02:51 pm Michael Hanselmann

RAPI client: Remove support for version 0 instance creation requests

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

dde0e97c 03/18/2011 04:54 pm Michael Hanselmann

RAPI client: Tidy and test WaitForJobCompletion

- Use constants
- Don't sleep if no delay is given
- Mark function as deprecated: it uses polling instead of waiting for changes
(but the latter needs authentication); it can still be used
- Add unittests...

63d5eb8a 03/18/2011 04:54 pm Michael Hanselmann

RAPI client: Add job status constants

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

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

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

Add RAPI resource for instance console

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

70b0d2a2 01/27/2011 01:05 pm Michael Hanselmann

Ensure all resources are used by RAPI client

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

54d4c13b 01/27/2011 01:04 pm Michael Hanselmann

RAPI client: Wrap /2/redistribute-config resource

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

b680c8be 01/27/2011 01:04 pm Michael Hanselmann

RAPI client: De-/activating instance disks

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

08c11c40 01/27/2011 01:04 pm Michael Hanselmann

Add unittest for RAPI client's ModifyInstance

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

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

7187e6ff 01/10/2011 04:07 pm Adeodato Simo

Add unit test for ganeti.rapi.client's ModifyGroup

This was forgotten in f18fab7.

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

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

a268af8d 12/08/2010 02:27 pm Adeodato Simo

Group operations: update ganeti.rapi.client with all node group operations

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

c744425f 11/29/2010 07:52 pm Michael Hanselmann

RAPI: Implement OS parameters for instance reinstallation

Dictionaries are hard to encode into query strings, therefore the
“/2/instances/[instance_name]/reinstall” resource is changed to accept
its parameters via the request body. The old query string parameters are...

d654aae1 08/10/2010 06:56 pm Michael Hanselmann

RAPI client: Support renaming instances

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

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

RAPI client: Don't re-use PycURL object

With this patch, a new PycURL object will be created for each request.
This should make the RAPI client safe for simultaneous calls from
multiple threads. Unittests are adjusted accordingly.

An unnecessary variable assignment is also removed from the unittest...

fcee9675 07/29/2010 04:05 pm David Knowles

RAPI client: The os argument for instance reinstalls is optional

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

e0ac6ce6 07/29/2010 04:05 pm Michael Hanselmann

RAPI client: Support migrating instances

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

1f334d96 07/23/2010 08:26 pm Iustin Pop

Update the RAPI client for the migration mode

See the discussion on the previous patch about this. Basically unless we
want to a add a new 'feature' marking for the live migration parameter,
there is no simple way to handle this nicely in the client.

Given that the client was/is marked as experimental, this patch simply...

54dc4fdb 07/13/2010 11:39 pm Michael Hanselmann

Merge remote branch 'origin/devel-2.1'

  • origin/devel-2.1:
    RAPI client: Implement old instance creation request format
    rlib2: Use constants for disk and NIC parameters

Conflicts:
test/ganeti.rapi.client_unittest.py: Trivial
test/ganeti.rapi.rlib2_unittest.py: Trivial...

48436b97 07/13/2010 09:55 pm Michael Hanselmann

RAPI client: Implement old instance creation request format

Commit 8a47b4478 implemented instance creation in the RAPI client,
but it left out support for the old instance creation request format.
This patch now implements the old format as good as possible. This...

2a7c3583 07/01/2010 03:13 pm Michael Hanselmann

RAPI client: Switch to pycURL

Currently the RAPI client uses the urllib2 and httplib modules from
Python's standard library. They're used with pyOpenSSL in a very fragile
way, and there are known issues when receiving large responses from a RAPI
server.
...

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

591e5103 05/17/2010 01:52 pm Michael Hanselmann

RAPI client: Rename Get{Node,Instance}Info, add new GetInstanceInfo

GetInstanceInfo should return the resource /2/instances/$name/info,
but so far it returns /2/instances/$name. The same applies to
GetNodeInfo, which returns /2/nodes/$name. Both names are stripped...

8a47b447 05/13/2010 04:58 pm Michael Hanselmann

RAPI client: Implement instance creation

Currently this only supports the new instance creation request data
format version 1, but support for the old version can be easily
implemented.

Most arguments are optional and documented in the RAPI documentation....

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

1068639f 05/11/2010 08:27 pm Michael Hanselmann

RAPI client: Don't check node role in client

Only the server knows which node roles can be set via RAPI.
Constants are provided for convenience.

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

bfc2002f 05/11/2010 08:27 pm Michael Hanselmann

RAPI client: Update ReplaceInstanceDisks

- The RAPI client shouldn't check the replacement mode as only
the server knows which ones are valid (constants are still
provided for convenience)
- Disks shouldn't be a list of names, but of indexes

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

fde28316 05/11/2010 08:27 pm Michael Hanselmann

RAPI client: Fix behaviour of “allocatable” storage flag

When modifying a storage unit, the “allocatable” flag should default
to “no modification”. This replicates the behaviour of the command
line interface.

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

10f5ab6c 05/11/2010 08:27 pm Michael Hanselmann

RAPI client: Encode boolean and None query values

Boolean values must be passed as 0 or 1. None should be an empty
value ("").

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

75f53ffe 05/11/2010 08:27 pm Michael Hanselmann

RAPI client: No longer check storage type locally

Only the RAPI server (actually masterd) knows which storage types
are valid. The exception can no longer be raised as the type is
only checked in the job.

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

8a019a03 05/11/2010 05:59 pm Michael Hanselmann

RAPI client: Include HTTP error code in GanetiApiError exception

Having the HTTP error code allows users of the class to act differently based
on the error code.

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

de4f53e6 05/11/2010 05:58 pm Michael Hanselmann

Support different HTTP error codes in RAPI client unittest mock

This allows testing error conditions (e.g. if a job wasn't found).

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

09127904 05/11/2010 05:56 pm Michael Hanselmann

RAPI client: Fix error message for unsupported methods in unittest

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

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

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

752df8bb 05/11/2010 05:31 pm Michael Hanselmann

RAPI client: Add missing unittest for RepairNodeStorageUnits

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

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

2004e673 04/07/2010 11:55 am Iustin Pop

Fix unittest for the rapi client library

Wrong escape, so we make sure to use proper escapes (we want the
backslashes to be embedded, not interpreted). Also change " to ' to be
easier to read.

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

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)