Revision 72295708 htools/Ganeti/Luxi.hs

b/htools/Ganeti/Luxi.hs
109 109

  
110 110
-- | Currently supported Luxi operations and JSON serialization.
111 111
$(genLuxiOp "LuxiOp"
112
  [(luxiReqQuery,
112
  [ (luxiReqQuery,
113 113
    [ ("what",    [t| Qlang.ItemType |])
114 114
    , ("fields",  [t| [String]  |])
115 115
    , ("qfilter", [t| Qlang.Filter |])
116 116
    ])
117
  , (luxiReqQueryFields,
118
    [ ("what",    [t| Qlang.ItemType |])
119
    , ("fields",  [t| [String]  |])
120
    ])
117 121
  , (luxiReqQueryNodes,
118 122
     [ ("names",  [t| [String] |])
119 123
     , ("fields", [t| [String] |])
......
343 347
    ReqQuery -> do
344 348
              (what, fields, qfilter) <- fromJVal args
345 349
              return $ Query what fields qfilter
350
    ReqQueryFields -> do
351
              (what, fields) <- fromJVal args
352
              fields' <- case fields of
353
                           JSNull -> return []
354
                           _ -> fromJVal fields
355
              return $ QueryFields what fields'
346 356
    ReqSubmitJob -> do
347 357
              [ops1] <- fromJVal args
348 358
              ops2 <- mapM (fromJResult (luxiReqToRaw call) . J.readJSON) ops1

Also available in: Unified diff