Revision 795d035d
b/lib/luxi.py | ||
---|---|---|
86 | 86 |
REQ_QUERY_INSTANCES, |
87 | 87 |
REQ_QUERY_JOBS, |
88 | 88 |
REQ_QUERY_NODES, |
89 |
REQ_QUERY_NETWORKS, |
|
89 | 90 |
REQ_QUERY_TAGS, |
90 | 91 |
REQ_SET_DRAIN_FLAG, |
91 | 92 |
REQ_SET_WATCHER_PAUSE, |
b/src/Ganeti/Luxi.hs | ||
---|---|---|
119 | 119 |
, simpleField "fields" [t| [String] |] |
120 | 120 |
, simpleField "lock" [t| Bool |] |
121 | 121 |
]) |
122 |
, (luxiReqQueryNetworks, |
|
123 |
[ simpleField "names" [t| [String] |] |
|
124 |
, simpleField "fields" [t| [String] |] |
|
125 |
, simpleField "lock" [t| Bool |] |
|
126 |
]) |
|
122 | 127 |
, (luxiReqQueryInstances, |
123 | 128 |
[ simpleField "names" [t| [String] |] |
124 | 129 |
, simpleField "fields" [t| [String] |] |
... | ... | |
341 | 346 |
return $ QueryGroups names fields locking |
342 | 347 |
ReqQueryClusterInfo -> |
343 | 348 |
return QueryClusterInfo |
349 |
ReqQueryNetworks -> do |
|
350 |
(names, fields, locking) <- fromJVal args |
|
351 |
return $ QueryNetworks names fields locking |
|
344 | 352 |
ReqQuery -> do |
345 | 353 |
(what, fields, qfilter) <- fromJVal args |
346 | 354 |
return $ Query what fields qfilter |
b/src/Ganeti/Query/Server.hs | ||
---|---|---|
173 | 173 |
handleClassicQuery cfg (Qlang.ItemTypeLuxi Qlang.QRJob) |
174 | 174 |
(map (Right . fromIntegral . fromJobId) names) fields False |
175 | 175 |
|
176 |
handleCall cfg (QueryNetworks names fields lock) = |
|
177 |
handleClassicQuery cfg (Qlang.ItemTypeOpCode Qlang.QRNetwork) |
|
178 |
(map Left names) fields lock |
|
179 |
|
|
176 | 180 |
handleCall _ op = |
177 | 181 |
return . Bad $ |
178 | 182 |
GenericError ("Luxi call '" ++ strOfOp op ++ "' not implemented") |
b/test/hs/Test/Ganeti/Luxi.hs | ||
---|---|---|
64 | 64 |
genFields <*> arbitrary |
65 | 65 |
Luxi.ReqQueryGroups -> Luxi.QueryGroups <$> arbitrary <*> |
66 | 66 |
arbitrary <*> arbitrary |
67 |
Luxi.ReqQueryNetworks -> Luxi.QueryNetworks <$> arbitrary <*> |
|
68 |
arbitrary <*> arbitrary |
|
67 | 69 |
Luxi.ReqQueryInstances -> Luxi.QueryInstances <$> listOf genFQDN <*> |
68 | 70 |
genFields <*> arbitrary |
69 | 71 |
Luxi.ReqQueryJobs -> Luxi.QueryJobs <$> arbitrary <*> genFields |
Also available in: Unified diff