, setPri
, setSec
, setBoth
+ , specOf
, shrinkByType
) where
then T.Bad "out of vcpus"
else T.Ok inst { vcpus = v }
shrinkByType _ f = T.Bad $ "Unhandled failure mode " ++ show f
+
+-- | Return the spec of an instance.
+specOf :: Instance -> T.RSpec
+specOf Instance { mem = m, dsk = d, vcpus = c } =
+ T.RSpec { T.rspecCpu = c, T.rspecMem = m, T.rspecDsk = d }