Statistics
| Branch: | Tag: | Revision:

root / htools / Ganeti / Rpc.hs @ 22381768

History | View | Annotate | Download (15.4 kB)

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

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

29a30533 11/12/2012 01:21 pm Iustin Pop

Remove unsafePerformIO usage

We need to change a few things, most importantly CLI options defaults,
but otherwise we already used the path to files from functions which
were already in the I/O monad, so we don't have to change much of the
code flow.

Additionally, Path.hs now has an explicit export list, to stop...

de2a5704 10/16/2012 03:14 pm Iustin Pop

confd: add the test_delay RPC call

Also add some more haddock structure to the module. The RPC call
itself is rather trivial.

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

ff8f0049 10/16/2012 12:47 pm Iustin Pop

confd: fix RpcVersion call

By accident, we sent the node object as call data in this rpc call,
instead the version request (i.e. nothing). This is due to the fact
that the 'call' data comes second, not first in the function argument.

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

3d3f562b 09/28/2012 12:27 pm Agata Murawska

Remove explicit recursion from sanitizeDictResults

Since ERpcError is still not a monad, a simple foldr will have to
do for now.

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

70c2362e 09/28/2012 12:27 pm Agata Murawska

Pretty printing JSValue

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

0ae9ddc4 09/28/2012 12:27 pm Agata Murawska

Merge parseHttpResponse with rpcResultParse

parseHttpResponse is such a simple function that we can actually
do the entire unpacking in rpcResultParse.

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

7328a28c 09/28/2012 12:27 pm Agata Murawska

Simplify and generalize rpcResultFill

For now ERpcError is still not a monad, but we can still simplify
rpcResultFill implementation for different calls simply by abstracting
it into two helpers.

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

a93b711b 09/28/2012 12:27 pm Agata Murawska

Remove monadic results wherever possible

There is no need (at least right now) for some of the resulting
types to be in additional monad, so let us just have more
"normal" functions.

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

274366e5 09/28/2012 12:27 pm Agata Murawska

Realign instances of typeclasses

As per Iustin's suggestion, this patch aligns parts of typeclass
instance on "=".

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

60443f61 09/28/2012 12:27 pm Agata Murawska

Rename RpcError -> String function

As per Iustin's suggestion, show is not a good solution - so instead
the name is now explainRpcError.

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

5188fdb7 09/26/2012 07:35 pm Agata Murawska

InstanceInfo RPC call

This patch implements single instance info call - somewhat similar to
all_instances_info, except we give a specific instance name.

Current implementation of reading the InstanceInfo value is somewhat
counter-intuitive because when we query a node on thich there is...

47163f0f 09/26/2012 07:35 pm Agata Murawska

Change RpcResult typeclass

For storage_list call, the result type depends on the call parameters.
Therefore, we have to add call as an argument for rpcResultFill - and
by extension, to the typeclass.

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

8779d21a 09/26/2012 07:35 pm Agata Murawska

Version RPC call

Implementation of node version query.

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

9b09c0be 09/26/2012 07:34 pm Agata Murawska

Fix RPC call and result (de)serialization

Previous version of RPC calls implementation in Haskell did not take
into account that the actual result type for queries is a list, not
a dictionary.

This patch aims at fixing the problem "for now" - it is not a pretty...

599239ad 09/26/2012 07:34 pm Agata Murawska

Add alias for Either RpcError a

This was repeated a lot, so we should abstract this into a type.

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

6fddde87 09/26/2012 07:34 pm Agata Murawska

Cleanup for RPC errors

Curl error messages are self contained and don't need "error" prefix;
added RpcResult Error which will be used once proper deserialization
of rpc response is in place.

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

7766de33 09/26/2012 07:34 pm Agata Murawska

Add nodedCertFile to Path

This patch adds missing Path entry and uses it in Rpc. It was not in
place before due to different build settings - i.e. if curl was
disabled, there were no problems.

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

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

2cdaf225 08/28/2012 05:59 pm Iustin Pop

Re-enable standard hlint warnings

Commit 5a1e31b4 (Add infrastructure for, and two extra hlint rules)
was intended to add two extra hlint rules, but I didn't realise at
that time that "--hint" when first used overrides the built-in
lints. As such, since then we were basically running with just those...

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

Implementation of NodeInfo call and result

node_info call takes hypervisors and vgs to ask for information about
node and returns bootid and results from hypervisors and volume groups.

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

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

Implementation of InstanceList call and result

instance_list call takes a list of hypervisors and returns a list
of running instances.

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

96dad12d 08/28/2012 12:56 pm Agata Murawska

Implementation of AllInstancesInfo call and result

all_instances_info call takes a list of hypervisors and returns a list
of (name, memory, state, vcpus, time) - one element for each
instance.

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

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

Infrastructure to execute RPC calls

Prepare and execute RPC call, prepare result for the call. These
procedures are generic in the sense that they only require the
Call and Result types to be connected.
We use curl library for sending http requests for RPC; as the library's...

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

Datatypes for haskell RPC calls

We introduce typeclasses for RPC call and result and create a typeclass
that binds the two together. For that we need to use
MultiParamTypeClasses and FunctionalDependencies language pragmas, which
allow us to ensure that RPC result type can be deduced based on the...