Commit 367c4241 authored by Dato Simó's avatar Dato Simó Committed by Iustin Pop

htools: move TagObject from Luxi.hs to OpCodes.hs

In addition to ReqQueryTags in Luxi.hs, the TagObject ADT is also
required for the "kind" attribute of OpTagsSet and OpTagsDel, which
are coming to OpCodes.hs next. Hence, we move TagObject there, and
adjust imports accordingly.
Signed-off-by: default avatarDato Simó <dato@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 2ac2e420
......@@ -50,8 +50,6 @@ import qualified Ganeti.Luxi as Luxi
-- * Luxi tests
$(genArbitrary ''Luxi.TagObject)
$(genArbitrary ''Luxi.LuxiReq)
instance Arbitrary Luxi.LuxiOp where
......
......@@ -48,6 +48,8 @@ import qualified Ganeti.OpCodes as OpCodes
-- * Arbitrary instances
$(genArbitrary ''OpCodes.TagObject)
$(genArbitrary ''OpCodes.ReplaceDisksMode)
instance Arbitrary OpCodes.DiskIndex where
......
......@@ -31,7 +31,6 @@ module Ganeti.Luxi
, Client
, JobId
, RecvResult(..)
, TagObject(..)
, strOfOp
, getClient
, getServer
......@@ -73,7 +72,7 @@ import Ganeti.Constants
import Ganeti.Errors
import Ganeti.JSON
import Ganeti.Jobs (JobStatus)
import Ganeti.OpCodes (OpCode)
import Ganeti.OpCodes
import Ganeti.Utils
import qualified Ganeti.Query.Language as Qlang
import Ganeti.THH
......@@ -99,15 +98,6 @@ data RecvResult = RecvConnClosed -- ^ Connection closed
-- | The Ganeti job type.
type JobId = Int
-- | Data type representing what items do the tag operations apply to.
$(declareSADT "TagObject"
[ ("TagInstance", 'tagInstance)
, ("TagNode", 'tagNode)
, ("TagGroup", 'tagNodegroup)
, ("TagCluster", 'tagCluster)
])
$(makeJSONInstance ''TagObject)
-- | Currently supported Luxi operations and JSON serialization.
$(genLuxiOp "LuxiOp"
[ (luxiReqQuery,
......
......@@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
module Ganeti.OpCodes
( OpCode(..)
, TagObject(..)
, ReplaceDisksMode(..)
, DiskIndex
, mkDiskIndex
......@@ -42,6 +43,15 @@ import Ganeti.THH
import Ganeti.JSON
-- | Data type representing what items do the tag operations apply to.
$(declareSADT "TagObject"
[ ("TagInstance", 'C.tagInstance)
, ("TagNode", 'C.tagNode)
, ("TagGroup", 'C.tagNodegroup)
, ("TagCluster", 'C.tagCluster)
])
$(makeJSONInstance ''TagObject)
-- | Replace disks type.
$(declareSADT "ReplaceDisksMode"
[ ("ReplaceOnPrimary", 'C.replaceDiskPri)
......
......@@ -50,6 +50,7 @@ import qualified Ganeti.Config as Config
import Ganeti.BasicTypes
import Ganeti.Logging
import Ganeti.Luxi
import Ganeti.OpCodes (TagObject(..))
import qualified Ganeti.Query.Language as Qlang
import Ganeti.Query.Query
import Ganeti.Query.Filter (makeSimpleFilter)
......
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