Commit 795d035d authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Add luxiReqQueryNetworks to LuxiOp



When the QueryNetwork was introduced as a method, apparently
it was forgotten in the Haskell world. Add it here as well.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parent 385d4574
......@@ -86,6 +86,7 @@ REQ_ALL = compat.UniqueFrozenset([
REQ_QUERY_INSTANCES,
REQ_QUERY_JOBS,
REQ_QUERY_NODES,
REQ_QUERY_NETWORKS,
REQ_QUERY_TAGS,
REQ_SET_DRAIN_FLAG,
REQ_SET_WATCHER_PAUSE,
......
......@@ -119,6 +119,11 @@ $(genLuxiOp "LuxiOp"
, simpleField "fields" [t| [String] |]
, simpleField "lock" [t| Bool |]
])
, (luxiReqQueryNetworks,
[ simpleField "names" [t| [String] |]
, simpleField "fields" [t| [String] |]
, simpleField "lock" [t| Bool |]
])
, (luxiReqQueryInstances,
[ simpleField "names" [t| [String] |]
, simpleField "fields" [t| [String] |]
......@@ -341,6 +346,9 @@ decodeCall (LuxiCall call args) =
return $ QueryGroups names fields locking
ReqQueryClusterInfo ->
return QueryClusterInfo
ReqQueryNetworks -> do
(names, fields, locking) <- fromJVal args
return $ QueryNetworks names fields locking
ReqQuery -> do
(what, fields, qfilter) <- fromJVal args
return $ Query what fields qfilter
......
......@@ -173,6 +173,10 @@ handleCall cfg (QueryJobs names fields) =
handleClassicQuery cfg (Qlang.ItemTypeLuxi Qlang.QRJob)
(map (Right . fromIntegral . fromJobId) names) fields False
handleCall cfg (QueryNetworks names fields lock) =
handleClassicQuery cfg (Qlang.ItemTypeOpCode Qlang.QRNetwork)
(map Left names) fields lock
handleCall _ op =
return . Bad $
GenericError ("Luxi call '" ++ strOfOp op ++ "' not implemented")
......
......@@ -64,6 +64,8 @@ instance Arbitrary Luxi.LuxiOp where
genFields <*> arbitrary
Luxi.ReqQueryGroups -> Luxi.QueryGroups <$> arbitrary <*>
arbitrary <*> arbitrary
Luxi.ReqQueryNetworks -> Luxi.QueryNetworks <$> arbitrary <*>
arbitrary <*> arbitrary
Luxi.ReqQueryInstances -> Luxi.QueryInstances <$> listOf genFQDN <*>
genFields <*> arbitrary
Luxi.ReqQueryJobs -> Luxi.QueryJobs <$> arbitrary <*> genFields
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment