Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (1.7 kB)

1
{-| Implementation of Ganeti Lock field queries
2

    
3
The actual computation of the field values is done by forwarding
4
the request; so only have a minimal field definition here.
5

    
6
-}
7

    
8
{-
9

    
10
Copyright (C) 2014 Google Inc.
11

    
12
This program is free software; you can redistribute it and/or modify
13
it under the terms of the GNU General Public License as published by
14
the Free Software Foundation; either version 2 of the License, or
15
(at your option) any later version.
16

    
17
This program is distributed in the hope that it will be useful, but
18
WITHOUT ANY WARRANTY; without even the implied warranty of
19
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20
General Public License for more details.
21

    
22
You should have received a copy of the GNU General Public License
23
along with this program; if not, write to the Free Software
24
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25
02110-1301, USA.
26

    
27
-}
28

    
29
module Ganeti.Query.Locks
30
  ( fieldsMap
31
  ) where
32

    
33
import Ganeti.Query.Common
34
import Ganeti.Query.Language
35
import Ganeti.Query.Types
36

    
37
-- | List of all lock fields.
38
lockFields :: FieldList String ()
39
lockFields =
40
  [ (FieldDefinition "name" "Name" QFTOther "Lock name",
41
     FieldSimple rsNormal, QffNormal)
42
  , (FieldDefinition "mode" "Mode" QFTOther "Mode in which the lock is\
43
                                             \ currently acquired\
44
                                             \ (exclusive or shared)",
45
     FieldSimple rsNormal, QffNormal)
46
  , (FieldDefinition "owner" "Owner" QFTOther "Current lock owner(s)",
47
     FieldSimple rsNormal, QffNormal)
48
  , (FieldDefinition "pending" "Pending" QFTOther "Jobs waiting for the lock",
49
     FieldSimple rsNormal, QffNormal)
50
  ]
51

    
52
-- | The lock fields map.
53
fieldsMap :: FieldMap String ()
54
fieldsMap = fieldListToFieldMap lockFields