design-optables: Wording and formatting fixes

Just a few wording and consistency improvements.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Tests: Refactor namefield selection

This makes it easier to add new cases.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Query.Language: Add Ord instances

We need them for putting things into Sets and Maps.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Add MonadBaseControl instance for RpcClientMonad

So that exceptions can be caught in the `RpcClientMonad`.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Utils: Add isRight

We already have isLeft.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Utils: Add `isUUID`

We have an existing uuidRegex with which UUIDs can be checked,
but it is conditionally compiled if Ganeti is configured with
regex-pcre support, and we don't want to make the dependency on that
unconditional.

This implements `isUUID` with an Attoparsec parser that is equivalent
to the `uuidRegex`.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
WConfd.Client: Add `withLockedConfig` helper function

Blocks until a a lock on the config is obtained.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Query.Server: Extract `handleQuery` function

We will need to query things that have no names (only UUIDs) as well.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
JSON: Add Tuple5 type

This is because Text.JSON from the "json" package only has JSON
instances for tuples up to size 4.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Add filter management to Luxid (RAPI and CLI interfaces)

This implements the management (add, remove, replace) of job filter rules
as specified by `doc/design-optables.rst`; it does not yet implement
the filtering logic.

This commit also includes the implementation of filters in the RAPI client.py
and its tests because the client tests check that if all available RAPI
resources are being used by the client, and the only way to make them
be used is to write tests for them.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>