Statistics
| Branch: | Tag: | Revision:

root / htools / Ganeti / Query / Query.hs @ 29a30533

History | View | Annotate | Download (8.5 kB)

# Date Author Comment
5183e8be 10/25/2012 01:05 pm Iustin Pop

Convert query path from string errors to GanetiException

This patch converts all the call paths from 'Result' (which contains
just string errors) to 'ErrorResult', which holds
GanetiException-encoded errors. We can now return proper
OpPrereq/OpExec errors to the clients of the luxi/query socket....

a2ae14e9 10/11/2012 01:03 pm Iustin Pop

Add a helper for query field checks

… and also use it to simplify 'needsLiveData'. Additionally, add an
explicit export list to Ganeti.Query.Types, since otherwise we'd
(re)export all imported symbols.

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

cd67e337 10/11/2012 01:03 pm Iustin Pop

Add support for classic queries

This patch adds support for classic-style queries (before query2) to
the query socket server. The patch is rather trivial, since as in
Python we just piggy-back on the query2 implementation.

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

b04dc242 10/11/2012 01:03 pm Iustin Pop

Simplify a bit queryFields

We don't add a type class for fully-generic handling, but we do
abstract the duplicate part.

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

90d033ef 10/11/2012 01:03 pm Iustin Pop

Add function for getting a group's merged disk params

… and use it in the Query implementation, removing the last
non-correct query field for Groups.

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

1fc3812c 10/11/2012 01:03 pm Iustin Pop

Switch ordering of names on query to niceSort

This makes the "all" names queries consistent with the Python
results. The change requires updating the unittests, at which point a
duplicate error message is simplified.

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

a41c337e 10/11/2012 01:03 pm Iustin Pop

Use the new name filtering behaviour in query

We do this not quite generically, which means we have to add
another layer in the call chain, and rename the current query
function, plus add special-case code for each query type. Hopefully we
will be able to improve on this in the future....

bc4cdeef 10/11/2012 01:03 pm Iustin Pop

Add functionality for checking validity of names

This replicates in the Haskell Query2 implementation the behaviour of
the Python code: if a "simple" filter is passed (one that contains
only Or aggregators and EQ binary ops on the name field), then an
failure is flagged if the given values are not known....

0ec87781 10/10/2012 03:03 pm Iustin Pop

Fixup hypervisor queries in node query

We need to only query the default (first enabled) hypervisor, not all
hypervisors. For this, we need to add a manual check to ensure that we
don't have a corrupt config (there's no "NonEmptyList" type…).

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

7f0fd838 09/26/2012 07:35 pm Agata Murawska

Node query now collects live fields

We make use of the parameter added in the previous patch and add
option to add live parameters to the query.

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

fa2c927c 09/26/2012 07:35 pm Agata Murawska

Add live parameter to query

The tests we currently have assume, that all the data required for
running the query is available - once we add live data, this will no
longer be the case.

This patch adds boolean parameter to query function, which tells it
whether to ignore live parameters gathering....

40246fa0 09/26/2012 07:34 pm Agata Murawska

NodeGroup query in Haskell

Implementation of nodegroup queries in Haskell. This is not yet
complete as we are missing merged disk parameters and option
want_diskparams is not implemented.

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

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

4cab6703 09/04/2012 02:00 pm Iustin Pop

Rename the Qlang and Queryd modules

Per the new query module hierarchy, rename Qlang to Query/Language and
Queryd to Query/Server. This way, all query-related functionality is
now "contained" in the Query/ directory.

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

8a65c02b 09/04/2012 02:00 pm Iustin Pop

Add filtering support in Query

This adds basic infrastructure for filtering (fully functional except,
as usual, for runtime data), and then uses it for node queries.

Since the filtering exports regex matching as an external
functionality, we have to use a regex library. There are many flavours...

518023a9 09/04/2012 01:59 pm Iustin Pop

Implement QueryFields for Nodes

Since we have all the definitions already, we can easily enable
this. Manual testing shows no difference between the Python and the
Haskell versions of node list-fields.

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

046fe3f5 09/03/2012 04:52 pm Iustin Pop

Add Query support for Nodes (no filtering, no RPC)

This is the initial support for Query2: basic infrastructure (except
filtering) and node query support (without RPC).

It implements all the fields (tests by comparison with list-fields on
the Python side), except that:...

4cbe9bda 09/03/2012 04:45 pm Iustin Pop

Stub query2 call integration into QueryD

This patch corrects the definitions in Qlang.hs to match what Python
expects on the wire; this means replacing some manual data type
definitions with 'buildObject' so that we get serialisation (and field
names) for free, adding (manually) JSON instances for types which are...