Commit 86b04819 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Provide fields for lock queries

For luxid to be feature-complete with respect to masterd, it
also needs to answer requests about locks. This includes knowing
the fields available for locks.
Signed-off-by: default avatarKlaus Aehlig <>
Reviewed-by: default avatarPetr Pudlak <>
parent 4f704244
......@@ -726,6 +726,7 @@ HS_LIB_SRCS = \
src/Ganeti/Query/Instance.hs \
src/Ganeti/Query/Job.hs \
src/Ganeti/Query/Language.hs \
src/Ganeti/Query/Locks.hs \
src/Ganeti/Query/Network.hs \
src/Ganeti/Query/Node.hs \
src/Ganeti/Query/Query.hs \
{-| Implementation of Ganeti Lock field queries
The actual computation of the field values is done by forwarding
the request; so only have a minimal field definition here.
Copyright (C) 2014 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
module Ganeti.Query.Locks
( fieldsMap
) where
import qualified Data.Map as Map
import Ganeti.Query.Common
import Ganeti.Query.Language
import Ganeti.Query.Types
-- | List of all lock fields.
lockFields :: FieldList String ()
lockFields =
[ (FieldDefinition "name" "Name" QFTOther "Lock name",
FieldSimple rsNormal, QffNormal)
, (FieldDefinition "mode" "Mode" QFTOther "Mode in which the lock is\
\ currently acquired\
\ (exclusive or shared)",
FieldSimple rsNormal, QffNormal)
, (FieldDefinition "owner" "Owner" QFTOther "Current lock owner(s)",
FieldSimple rsNormal, QffNormal)
, (FieldDefinition "pending" "Pending" QFTOther "Jobs waiting for the lock",
FieldSimple rsNormal, QffNormal)
-- | The lock fields map.
fieldsMap :: FieldMap String ()
fieldsMap =
Map.fromList $ map (\v@(f, _, _) -> (fdefName f, v)) lockFields
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment