Utils: Add isRight

We already have isLeft.

Signed-off-by: Niklas Hambuechen <niklash@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>
WConfd.Client: Add `withLockedConfig` helper function

Blocks until a a lock on the config is obtained.

Signed-off-by: Niklas Hambuechen <niklash@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>
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>
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>