Revision f2374060 htools/Ganeti/Queryd.hs

b/htools/Ganeti/Queryd.hs
29 29

  
30 30
where
31 31

  
32
import Control.Applicative
32 33
import Control.Concurrent
33 34
import Control.Exception
34 35
import Data.Bits (bitSize)
......
41 42

  
42 43
import qualified Ganeti.Constants as C
43 44
import Ganeti.Objects
44
--import Ganeti.Config
45
import qualified Ganeti.Config as Config
45 46
import Ganeti.BasicTypes
46 47
import Ganeti.Logging
47 48
import Ganeti.Luxi
......
118 119

  
119 120
  in return . Ok . J.makeObj $ obj
120 121

  
122
handleCall cfg (QueryTags kind name) =
123
  let tags = case kind of
124
               TagCluster -> Ok . clusterTags $ configCluster cfg
125
               TagGroup -> groupTags <$> Config.getGroup cfg name
126
               TagNode -> nodeTags <$> Config.getNode cfg name
127
               TagInstance -> instTags <$> Config.getInstance cfg name
128
  in return (J.showJSON <$> tags)
129

  
121 130
handleCall _ op =
122 131
  return . Bad $ "Luxi call '" ++ strOfOp op ++ "' not implemented"
123 132

  

Also available in: Unified diff