Complete the instance OpCodes and parameters
[ganeti-local] / htools / Ganeti / Types.hs
index 4420d47..1b4e9f5 100644 (file)
@@ -53,12 +53,16 @@ module Ganeti.Types
   , MigrationMode(..)
   , VerifyOptionalChecks(..)
   , DdmSimple(..)
+  , DdmFull(..)
   , CVErrorCode(..)
   , cVErrorCodeToRaw
   , Hypervisor(..)
   , OobCommand(..)
   , StorageType(..)
   , NodeEvacMode(..)
+  , FileDriver(..)
+  , InstCreateMode(..)
+  , RebootType(..)
   ) where
 
 import qualified Text.JSON as JSON
@@ -215,6 +219,14 @@ $(THH.declareSADT "DdmSimple"
      ])
 $(THH.makeJSONInstance ''DdmSimple)
 
+-- | Dynamic device modification, all operations version.
+$(THH.declareSADT "DdmFull"
+     [ ("DdmFullAdd",    'C.ddmAdd)
+     , ("DdmFullRemove", 'C.ddmRemove)
+     , ("DdmFullModify", 'C.ddmModify)
+     ])
+$(THH.makeJSONInstance ''DdmFull)
+
 -- | Hypervisor type definitions.
 $(THH.declareSADT "Hypervisor"
   [ ( "Kvm",    'C.htKvm )
@@ -251,3 +263,26 @@ $(THH.declareSADT "NodeEvacMode"
   , ("NEvacAll",       'C.iallocatorNevacAll)
   ])
 $(THH.makeJSONInstance ''NodeEvacMode)
+
+-- | The file driver type.
+$(THH.declareSADT "FileDriver"
+  [ ("FileLoop",   'C.fdLoop)
+  , ("FileBlktap", 'C.fdBlktap)
+  ])
+$(THH.makeJSONInstance ''FileDriver)
+
+-- | The instance create mode.
+$(THH.declareSADT "InstCreateMode"
+  [ ("InstCreate",       'C.instanceCreate)
+  , ("InstImport",       'C.instanceImport)
+  , ("InstRemoteImport", 'C.instanceRemoteImport)
+  ])
+$(THH.makeJSONInstance ''InstCreateMode)
+
+-- | Reboot type.
+$(THH.declareSADT "RebootType"
+  [ ("RebootSoft", 'C.instanceRebootSoft)
+  , ("RebootHard", 'C.instanceRebootHard)
+  , ("RebootFull", 'C.instanceRebootFull)
+  ])
+$(THH.makeJSONInstance ''RebootType)