Revision 6e94b75c src/Ganeti/Query/Server.hs

b/src/Ganeti/Query/Server.hs
52 52
import Ganeti.BasicTypes
53 53
import Ganeti.Logging
54 54
import Ganeti.Luxi
55
import Ganeti.OpCodes (TagObject(..))
56 55
import qualified Ganeti.Query.Language as Qlang
57 56
import qualified Ganeti.Query.Cluster as QCluster
58 57
import Ganeti.Query.Query
59 58
import Ganeti.Query.Filter (makeSimpleFilter)
59
import Ganeti.Types
60 60

  
61 61
-- | Helper for classic queries.
62 62
handleClassicQuery :: ConfigData      -- ^ Cluster config
......
149 149
    Ok _ -> return . Ok . J.makeObj $ obj
150 150
    Bad ex -> return $ Bad ex
151 151

  
152
handleCall cfg (QueryTags kind) =
152
handleCall cfg (QueryTags kind name) = do
153 153
  let tags = case kind of
154
               TagCluster       -> Ok . clusterTags $ configCluster cfg
155
               TagGroup    name -> groupTags <$> Config.getGroup    cfg name
156
               TagNode     name -> nodeTags  <$> Config.getNode     cfg name
157
               TagInstance name -> instTags  <$> Config.getInstance cfg name
158
  in return (J.showJSON <$> tags)
154
               TagKindCluster  -> Ok . clusterTags $ configCluster cfg
155
               TagKindGroup    -> groupTags <$> Config.getGroup    cfg name
156
               TagKindNode     -> nodeTags  <$> Config.getNode     cfg name
157
               TagKindInstance -> instTags  <$> Config.getInstance cfg name
158
  return (J.showJSON <$> tags)
159 159

  
160 160
handleCall cfg (Query qkind qfields qfilter) = do
161 161
  result <- query cfg True (Qlang.Query qkind qfields qfilter)

Also available in: Unified diff