Commit ccf17aa3 authored by Jose A. Lopes's avatar Jose A. Lopes
Browse files

Move 'StorageField' to 'Ganeti.Types'



Move 'StorageField' to 'Ganeti.Types' in order to break the
circularity of 'Ganeti.Rpc' and be able to generate constants from
this Haskell data type.
Signed-off-by: default avatarJose A. Lopes <jabolopes@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent cd238561
......@@ -60,7 +60,6 @@ module Ganeti.Rpc
, RpcCallVersion(..)
, RpcResultVersion(..)
, StorageField(..)
, RpcCallStorageList(..)
, RpcResultStorageList(..)
......@@ -414,18 +413,6 @@ instance Rpc RpcCallVersion RpcResultVersion where
-- ** StorageList
-- | StorageList
-- FIXME: This may be moved to Objects
$(declareSADT "StorageField"
[ ( "SFUsed", 'C.sfUsed)
, ( "SFName", 'C.sfName)
, ( "SFAllocatable", 'C.sfAllocatable)
, ( "SFFree", 'C.sfFree)
, ( "SFSize", 'C.sfSize)
])
$(makeJSONInstance ''StorageField)
$(buildObject "RpcCallStorageList" "rpcCallStorageList"
[ simpleField "su_name" [t| StorageType |]
, simpleField "su_args" [t| [String] |]
......
......@@ -139,6 +139,8 @@ module Ganeti.Types
, AdminState(..)
, adminStateFromRaw
, adminStateToRaw
, StorageField(..)
, storageFieldToRaw
) where
import Control.Monad (liftM)
......@@ -745,3 +747,14 @@ $(THH.declareLADT ''String "AdminState"
, ("AdminUp", "up")
])
$(THH.makeJSONInstance ''AdminState)
-- * Storage field type
$(THH.declareLADT ''String "StorageField"
[ ( "SFUsed", "used")
, ( "SFName", "name")
, ( "SFAllocatable", "allocatable")
, ( "SFFree", "free")
, ( "SFSize", "size")
])
$(THH.makeJSONInstance ''StorageField)
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