Statistics
| Branch: | Tag: | Revision:

root / htools / Ganeti / Types.hs @ 77d43564

History | View | Annotate | Download (15.3 kB)

# Date Author Comment
77d43564 12/17/2012 01:38 pm Iustin Pop

Fix parsing of absolute job dependencies

It seems that Python code generates (sometimes) absolute job
dependencies which are strings, instead of integers, so we should be
able to parse these as well. We simply change from explicit int-based
parsing (makeJobId) to the generic one (parseJobId)....

fd958a3d 12/17/2012 01:38 pm Iustin Pop

Abstract code related to job ID creation

Having makeJobIdS as a separate function will allow us to use it
outside of json encoding.

The patch also exports one more function from the Types module.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michele Tartara <>

5cd95d46 12/17/2012 01:29 pm Iustin Pop

Add a type for the log type in job/opcode logs

Also fixes indentation for OP_STATUS.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

57fb6fcb 12/14/2012 04:28 pm Guido Trotter

Very very very basic openvswitch support

This is a "better than nothing" support, just for kvm and just joining
the machine to the opevswitch bridge with the right command.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>...

3bdbe4b3 12/05/2012 09:03 pm Dato Simó

Jobs.hs: move OpStatus and JobStatus ADTs to Types.hs

This leaves Ganeti/Jobs.hs and Test/Ganeti/Jobs.hs empty, but they're the
target of a future move of some functions, so we leave them around, and
don't delete them, to avoid unnecessary delete/create diffs....

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

Add a negative type

This mirrors the positive one, and will be needed for relative job
IDs.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

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

Add types and parameters for common opcode implementation

This will go into a separate type; this patch adds the needed
underlying types and parameters.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

6903fea0 12/04/2012 01:44 pm Iustin Pop

Add type for finalised job statuses

For now, we don't need a pending job status type as well, so we'll
delay adding that until later.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

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

Add a 'real' type for JobIds

Currently, the job ID is a simple type alias. This is suboptimal, as
it means we can't use a custom JSON (or Arbitrary) instance for it.

The patch changes it into a newtype, and then a) simplifies some
deserialisation code and b) changes some more fields to this new type...

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

8d239fa4 11/30/2012 03:54 pm Iustin Pop

Add types, parameters and the opcodes for networks

This completes the last missing opcode group. The only difficulty was
with the ip addresses, where we used simple strings to represent them
and (for IPv4) a few helpers to generate arbitrary instances;
otherwise, the patch is trivial....

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

a3f02317 11/30/2012 03:54 pm Iustin Pop

Complete the Test opcodes

This adds the OpTestAllocator, OpTestJqueue and OpTestDummy
opcodes. The OpTestAllocator seems to need some cleanup (on the Python
side), for now we implement it as is. As for the other two, while not
used in production, we should have full coverage for them as well....

398e9066 11/30/2012 03:54 pm Iustin Pop

Add Group, OS and Backup opcodes

This also corrects a docstring in OpBackupExport on the Python side.

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

c2d3219b 11/30/2012 03:54 pm Iustin Pop

Complete the instance OpCodes and parameters

Only the original instance opcodes (used in htools) are left
non-converted to only parameter style; they'll be cleaned up later,
once the htools codebase itself migrates to safer types.

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

6d558717 11/30/2012 03:48 pm Iustin Pop

Add types and parameters for OpInstanceCreate

This is a "big" opcode, so sending it separately.

A few types needed changing, and a few parameters were renamed to make
it more clear which are cluster-level and which are instance-level
parameters.

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

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

6a28e02c 11/21/2012 04:58 pm Iustin Pop

Add two more basic types

These are needed for completing the node opcode parameters.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

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

Add more basic Ganeti types

These are needed both in opcodes and (potentially) outside, so we add
them in the main Types module.

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

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

Generalise the JSON "Container" type

Currently, we have some types that we kept as dictionaries in the
objects representation (due to inconsistent behaviour, or other
technical reasons). This should be improved in the future, but in the
meantime we can improve the Container type by allowing its keys to be...

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

48755fac 11/21/2012 03:51 pm Iustin Pop

Move StorageType from RPC.hs to Types.hs

This fixes a FIXME actually recommending this move :)

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

edb5a1c8 11/20/2012 05:39 pm Iustin Pop

Add more basic validation types

This mirrors the ht.py types PositiveInt, NonNegative, etc., except
that they work at a more generic level (any numeric type, respectively
any non-empty list).

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