Statistics
| Branch: | Tag: | Revision:

root / src / Ganeti / Query / Locks.hs @ 88772d17

History | View | Annotate | Download (1.7 kB)

1 86b04819 Klaus Aehlig
{-| Implementation of Ganeti Lock field queries
2 86b04819 Klaus Aehlig
3 86b04819 Klaus Aehlig
The actual computation of the field values is done by forwarding
4 86b04819 Klaus Aehlig
the request; so only have a minimal field definition here.
5 86b04819 Klaus Aehlig
6 86b04819 Klaus Aehlig
-}
7 86b04819 Klaus Aehlig
8 86b04819 Klaus Aehlig
{-
9 86b04819 Klaus Aehlig
10 86b04819 Klaus Aehlig
Copyright (C) 2014 Google Inc.
11 86b04819 Klaus Aehlig
12 86b04819 Klaus Aehlig
This program is free software; you can redistribute it and/or modify
13 86b04819 Klaus Aehlig
it under the terms of the GNU General Public License as published by
14 86b04819 Klaus Aehlig
the Free Software Foundation; either version 2 of the License, or
15 86b04819 Klaus Aehlig
(at your option) any later version.
16 86b04819 Klaus Aehlig
17 86b04819 Klaus Aehlig
This program is distributed in the hope that it will be useful, but
18 86b04819 Klaus Aehlig
WITHOUT ANY WARRANTY; without even the implied warranty of
19 86b04819 Klaus Aehlig
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20 86b04819 Klaus Aehlig
General Public License for more details.
21 86b04819 Klaus Aehlig
22 86b04819 Klaus Aehlig
You should have received a copy of the GNU General Public License
23 86b04819 Klaus Aehlig
along with this program; if not, write to the Free Software
24 86b04819 Klaus Aehlig
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 86b04819 Klaus Aehlig
02110-1301, USA.
26 86b04819 Klaus Aehlig
27 86b04819 Klaus Aehlig
-}
28 86b04819 Klaus Aehlig
29 86b04819 Klaus Aehlig
module Ganeti.Query.Locks
30 86b04819 Klaus Aehlig
  ( fieldsMap
31 86b04819 Klaus Aehlig
  ) where
32 86b04819 Klaus Aehlig
33 86b04819 Klaus Aehlig
import Ganeti.Query.Common
34 86b04819 Klaus Aehlig
import Ganeti.Query.Language
35 86b04819 Klaus Aehlig
import Ganeti.Query.Types
36 86b04819 Klaus Aehlig
37 86b04819 Klaus Aehlig
-- | List of all lock fields.
38 86b04819 Klaus Aehlig
lockFields :: FieldList String ()
39 86b04819 Klaus Aehlig
lockFields =
40 86b04819 Klaus Aehlig
  [ (FieldDefinition "name" "Name" QFTOther "Lock name",
41 86b04819 Klaus Aehlig
     FieldSimple rsNormal, QffNormal)
42 86b04819 Klaus Aehlig
  , (FieldDefinition "mode" "Mode" QFTOther "Mode in which the lock is\
43 86b04819 Klaus Aehlig
                                             \ currently acquired\
44 86b04819 Klaus Aehlig
                                             \ (exclusive or shared)",
45 86b04819 Klaus Aehlig
     FieldSimple rsNormal, QffNormal)
46 86b04819 Klaus Aehlig
  , (FieldDefinition "owner" "Owner" QFTOther "Current lock owner(s)",
47 86b04819 Klaus Aehlig
     FieldSimple rsNormal, QffNormal)
48 86b04819 Klaus Aehlig
  , (FieldDefinition "pending" "Pending" QFTOther "Jobs waiting for the lock",
49 86b04819 Klaus Aehlig
     FieldSimple rsNormal, QffNormal)
50 86b04819 Klaus Aehlig
  ]
51 86b04819 Klaus Aehlig
52 86b04819 Klaus Aehlig
-- | The lock fields map.
53 86b04819 Klaus Aehlig
fieldsMap :: FieldMap String ()
54 c92b4671 Klaus Aehlig
fieldsMap = fieldListToFieldMap lockFields