Revision d286d795 src/Ganeti/Query/Instance.hs

b/src/Ganeti/Query/Instance.hs
1
{-# LANGUAGE TupleSections #-}
2

  
3 1
{-| Implementation of the Ganeti Query2 instance queries.
4 2

  
5 3
-}
......
26 24
-}
27 25

  
28 26
module Ganeti.Query.Instance
29
  ( Runtime
30
  , fieldsMap
31
  , collectLiveData
32
  ) where
27
  (fieldsMap) where
33 28

  
34 29
import qualified Data.Map as Map
35 30

  
......
38 33
import Ganeti.Query.Language
39 34
import Ganeti.Query.Types
40 35

  
41
-- | Dummy type for runtime to be implemented later, see the 'genericQuery'
42
-- function in 'Ganeti.Query.Query' for an explanation
43
data Runtime = Runtime
44

  
45
instanceFields :: FieldList Instance Runtime
36
instanceFields :: FieldList Instance NoDataRuntime
46 37
instanceFields =
47 38
  [ (FieldDefinition "disk_template" "Disk_template" QFTText
48 39
     "Disk template",
......
63 54
  serialFields "Instance" ++
64 55
  uuidFields "Instance"
65 56

  
66
fieldsMap :: FieldMap Instance Runtime
57
fieldsMap :: FieldMap Instance NoDataRuntime
67 58
fieldsMap =
68 59
  Map.fromList [(fdefName f, v) | v@(f, _, _) <- instanceFields]
69

  
70
-- | Dummy function for collecting live data - just for interface testing
71
collectLiveData :: Bool -> ConfigData -> [Instance] -> IO [(Instance, Runtime)]
72
collectLiveData _ _ = return . map (, Runtime)

Also available in: Unified diff