Commit 9d4cc8ed authored by Iustin Pop's avatar Iustin Pop
Browse files

One more SADT type - VType



This adds the VTYPE_* conversion to VType, used for QFT equivalence
later.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
parent 8c957eb3
......@@ -29,7 +29,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-}
module Ganeti.Objects
( HvParams
( VType(..)
, vTypeFromRaw
, HvParams
, OsParams
, NICMode(..)
, PartialNicParams(..)
......@@ -107,6 +109,16 @@ fillDict defaults custom skip_keys =
let updated = Map.union custom defaults
in foldl' (flip Map.delete) updated skip_keys
-- | The VTYPES, a mini-type system in Python.
$(declareSADT "VType"
[ ("VTypeString", 'C.vtypeString)
, ("VTypeMaybeString", 'C.vtypeMaybeString)
, ("VTypeBool", 'C.vtypeBool)
, ("VTypeSize", 'C.vtypeSize)
, ("VTypeInt", 'C.vtypeInt)
])
$(makeJSONInstance ''VType)
-- | The hypervisor parameter type. This is currently a simple map,
-- without type checking on key/value pairs.
type HvParams = Container JSValue
......
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