Commit 8a9ee1e9 authored by Iustin Pop's avatar Iustin Pop
Browse files

Remove obsolete QrViaLuxi type



The actual query definitions are now in Qlang.hs, so let's use the
ItemType from there instead of luxi-defined type (which is also
incomplete).
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
parent 303bc802
......@@ -98,17 +98,17 @@ genericConvert otype oname oattr =
-- | The input data for node query.
queryNodesMsg :: L.LuxiOp
queryNodesMsg =
L.Query L.QRNode ["name", "mtotal", "mnode", "mfree", "dtotal", "dfree",
"ctotal", "offline", "drained", "vm_capable",
"ndp/spindle_count", "group.uuid"] Qlang.EmptyFilter
L.Query Qlang.QRNode ["name", "mtotal", "mnode", "mfree", "dtotal", "dfree",
"ctotal", "offline", "drained", "vm_capable",
"ndp/spindle_count", "group.uuid"] Qlang.EmptyFilter
-- | The input data for instance query.
queryInstancesMsg :: L.LuxiOp
queryInstancesMsg =
L.Query L.QRInstance ["name", "disk_usage", "be/memory", "be/vcpus",
"status", "pnode", "snodes", "tags", "oper_ram",
"be/auto_balance", "disk_template",
"be/spindle_use"] Qlang.EmptyFilter
L.Query Qlang.QRInstance ["name", "disk_usage", "be/memory", "be/vcpus",
"status", "pnode", "snodes", "tags", "oper_ram",
"be/auto_balance", "disk_template",
"be/spindle_use"] Qlang.EmptyFilter
-- | The input data for cluster query.
queryClusterInfoMsg :: L.LuxiOp
......@@ -117,7 +117,7 @@ queryClusterInfoMsg = L.QueryClusterInfo
-- | The input data for node group query.
queryGroupsMsg :: L.LuxiOp
queryGroupsMsg =
L.Query L.QRGroup ["uuid", "name", "alloc_policy", "ipolicy"]
L.Query Qlang.QRGroup ["uuid", "name", "alloc_policy", "ipolicy"]
Qlang.EmptyFilter
-- | Wraper over 'callMethod' doing node query.
......
......@@ -590,6 +590,9 @@ genFilter' n = do
n'' = max n' 2 -- but we don't want empty or 1-element lists,
-- so use this for and/or filter list length
instance Arbitrary Qlang.ItemType where
arbitrary = elements [minBound..maxBound]
-- * Actual tests
-- ** Utils tests
......@@ -1847,9 +1850,6 @@ testSuite "JSON"
instance Arbitrary Luxi.LuxiReq where
arbitrary = elements [minBound..maxBound]
instance Arbitrary Luxi.QrViaLuxi where
arbitrary = elements [minBound..maxBound]
instance Arbitrary Luxi.LuxiOp where
arbitrary = do
lreq <- arbitrary
......
......@@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
module Ganeti.Luxi
( LuxiOp(..)
, QrViaLuxi(..)
, ResultStatus(..)
, LuxiReq(..)
, Client
......@@ -100,20 +99,10 @@ data RecvResult = RecvConnClosed -- ^ Connection closed
-- | The Ganeti job type.
type JobId = Int
$(declareSADT "QrViaLuxi"
[ ("QRLock", 'qrLock)
, ("QRInstance", 'qrInstance)
, ("QRNode", 'qrNode)
, ("QRGroup", 'qrGroup)
, ("QROs", 'qrOs)
, ("QRJob", 'qrJob)
])
$(makeJSONInstance ''QrViaLuxi)
-- | Currently supported Luxi operations and JSON serialization.
$(genLuxiOp "LuxiOp"
[(luxiReqQuery,
[ ("what", [t| QrViaLuxi |])
[ ("what", [t| Qlang.ItemType |])
, ("fields", [t| [String] |])
, ("qfilter", [t| Qlang.Filter |])
])
......
......@@ -34,6 +34,7 @@ module Ganeti.Qlang
, QueryFieldsResult(..)
, FieldDefinition(..)
, ResultEntry(..)
, ItemType(..)
) where
import Control.Applicative
......
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