Statistics
| Branch: | Tag: | Revision:

root / htools / Ganeti / Objects.hs @ 1ba01ff7

History | View | Annotate | Download (20.5 kB)

# Date Author Comment
0ea11dcb 12/19/2012 03:14 pm Bernardo Dal Seno

Add exclusive_storage node parameter

Unit tests updated and expanded with an inheritance check.

The flag has no effect yet.

Signed-off-by: Bernardo Dal Seno <>
Reviewed-by: Iustin Pop <>

76a0266e 12/11/2012 05:18 pm Helga Velroyen

Network and address pool (again)

Implementation of the network objects and address pool. Functionality
as in the reverted commit b9a616e132af9bba718d2da8c94eeec7af886814, but
now using only the vector library and not the bit-vector library.
Tested with vector library version 0.9 and 0.10., which are...

fa23de0b 12/07/2012 11:45 am Helga Velroyen

Revert "Network and address pool"

This reverts commit b9a616e132af9bba718d2da8c94eeec7af886814, which
depends on the "bitvec" library. We need to investigate a bit further that
dependency, as it in turns depends on "vector" 0.9.1 or below, since
0.10.* removed support for Data.Vector.Unboxed.Safe which it uses....

b9a616e1 12/06/2012 07:13 pm Helga Velroyen

Network and address pool

Implementation of the network and address pool class in
Haskell. Not complete yet. Includes unit tests that cover
all functionality that is so far implemented.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Iustin Pop <>

fa10983e 12/04/2012 01:44 pm Iustin Pop

Rework custom fields handling

This patch changes a bit the handling of custom fields. Since in
general we use custom fields to aggregate multiple entries in the JSON
object into a safer data-type, we should also have a way to declare
which extra entries this field covers (so that in the future we can...

139c0683 11/30/2012 03:54 pm Iustin Pop

Remove read instances from our Haskell code

It turns out that optimising 'read' derived instances (via -O) for
complex data types (like OpCode, or the various objects) can be slow
to very slow. Disabling such instances results in (time make
$all_our_haskell_binaries) large compile-time savings and also smaller...

497beee2 11/30/2012 03:54 pm Iustin Pop

Move NICMode from Objects.hs to Types.hs

Also add some unittests for this type.

Signed-off-by: Iustin Pop <>
Reviewed-by: Helga Velroyen <>

c65621d7 11/30/2012 03:48 pm Iustin Pop

Move FileDriver from Objects to Types

Another base type that we need in opcodes as well.

Signed-off-by: Iustin Pop <>
Reviewed-by: Helga Velroyen <>

22381768 11/21/2012 03:51 pm Iustin Pop

Move the 'Hypervisor' type from Objects to Types

This is a very basic type and 'Objects' is a heavy-weight module. By
moving it to 'types' we simplify (in the future) the import chains.

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

5e9deac0 11/20/2012 11:16 am Iustin Pop

Create a new Ganeti/Types.hs module

There are already three cases where we copied type definitions between
the htools-specific types into the main ganeti code. Let's stop doing
this ☺ and create a common types module that holds these.

Note that there already exists BasicTypes.hs, but that refers to very...

32a569fe 11/15/2012 12:20 pm Iustin Pop

Cleanup THH function use from built module namespace

Currently, THH.hs "injects" into the built code names of library
functions like Text.JSON.makeObj, Ganeti.JSON.fromObj, etc. built
directly from strings, via (e.g.)

varE (mkName "makeObj")

This means that the "makeObj" name must exist in the target module,...

db154319 10/08/2012 12:41 pm Iustin Pop

Add missing ipolicy field

This was missing so far…

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

f9b0084a 09/26/2012 07:34 pm Agata Murawska

Change cluster's hypervisors type

We now have Hypervisor type in Objects, might just as well use it.

Signed-off-by: Agata Murawska <>
Reviewed-by: Iustin Pop <>

5b11f8db 09/05/2012 05:31 pm Iustin Pop

Further hlint fixes

Commit 2cdaf22, “Re-enable standard hlint warnings”, got it almost
right. The only problem is that (confusingly) the default set of hints
is not in HLint.Default, but in HLint.HLint (it includes Default and
some built-ins).

After changing the lint file to correctly include the defaults, we had...

9924d61e 09/05/2012 05:18 pm Iustin Pop

Add entire ConfigData serialisation tests

Using the recently-added genArbitrary, we can now implement Arbitrary
instances for even "huge" objects like Cluster, so let's use that to
implement entire ConfigData serialisation tests.

Note that, as we don't have yet proper types for some of the Params...

8d2b6a12 09/05/2012 04:58 pm Iustin Pop

Add unit test for serialisation of DiskLogicalId and Nodes

Since the DiskLogicalId type is manually serialised/deserialised (see
Objects.hs, `encodeDLid' and `decodeDLId'), let's add a test that
checks that these are idempotent when combined.

Since we're at it, let's add the same test for Node serialisation,...

f3baf5ef 09/04/2012 04:51 pm Iustin Pop

Move JSON.hs and Compat.hs out from under HTools/

These two files are not htools-specific, so let's move them out of the
HTools subdirectory/module hierarchy and directly under Ganeti.

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

9d4cc8ed 09/03/2012 04:45 pm Iustin Pop

One more SADT type - VType

This adds the VTYPE_* conversion to VType, used for QFT equivalence
later.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

2af78b97 09/03/2012 04:45 pm Iustin Pop

Expand THH with more functionality for parameters

This adds two related improvements to THH:

- for parameters, we declare a list with all their fields, so that
Query2 can build the list of fields (e.g. for hvparams, or ndparams)
automatically

- we declare a new type class for "DictObjects", i.e. objects which...

da45c352 09/03/2012 04:45 pm Iustin Pop

Add more node-related data types and functions

This is a simple type declaration for NodeRole, a NdParamObject type
class, and a few related helper functions for nodes and node groups.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

04dd53a3 09/03/2012 04:45 pm Iustin Pop

Add type classes for common objects

These mirror the TaggableObject in Python, in the sense that we will
be able to define generic functions for querying such fields.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

b09cce64 09/03/2012 03:13 pm Iustin Pop

Expand Objects.hs definitions

This patch adds the missing parameters in the cluster/group objects,
for now as simple maps (dictionaries), without type safety. The
rationale for adding them as such is:

- we need something to enable query functionality
- since we don't modify the values, we don't risk introducing bugs...

adb77e3a 09/03/2012 03:13 pm Iustin Pop

Add a fillDict function

This is similar to the Python version, objects.py:FillDict.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

f2374060 08/28/2012 06:02 pm Iustin Pop

Enable tags query over the query socket

This patch adds the tags field to the objects which were missing it
(all except Cluster), implements handling the LuxiCall QueryTags, and
then enables the use of the query socket in cli.ListTags, used by all
commands, and in the RAPI client....

7514fe92 08/28/2012 05:59 pm Iustin Pop

Add Objects definitions for the ispec/ipolicy types

Note that since we don't have yet a way to nicely handle two-level
optional parameters, the Filled/Partial types and filling function are
all manually built.

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

a957e150 08/28/2012 05:59 pm Iustin Pop

Improve Objects.hs definitions

This adds a few missing/incomplete definitions. We're still missing
the special parameters (disk params, hvparams, os_hvp).

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

d5a93a80 08/28/2012 05:59 pm Iustin Pop

Remove container field special cases

Since we now handle Containers uniformly, we can remove all traces of
the special handling for this field type.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

02cccecd 08/28/2012 05:58 pm Iustin Pop

Expand TH with tags field

Also add this new field and the other generic fields to the cluster
object.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

c4f65a0e 08/28/2012 12:56 pm Agata Murawska

Add Hypervisor and start exporting AdminState

Very simple Hypervisor object, that we want to pass in some of RPC
calls is added. We also export AdminState data type, as it is used
in one of the calls that will be implemented in this patch series.

Signed-off-by: Agata Murawska <>...

2e12944a 07/19/2012 11:01 am Iustin Pop

Add disk logical ID support in Objects.hs

This is a complex field, so we have to do a lot of manual work for now.

The complexity arises from the fact that the contents of the field,
and the way to parse it, depends on the disk type field, so we don't
have a single, static way of parsing it. Hence we needed the...

b1e81520 03/13/2012 02:48 pm Iustin Pop

htools: add partial implementation of lib/objects.py

This is partial since not all object types can be easily converted for
now (will need some changes on the Python side for this).

Most importantly, the *Params types do not have a good solution now:
the Python code, due to its dynamic typing, hides the fact that we...