{-
-Copyright (C) 2009, 2010, 2011, 2012 Google Inc.
+Copyright (C) 2009, 2010, 2011, 2012, 2013 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
, MetaOpCode(..)
, wrapOpCode
, setOpComment
+ , setOpPriority
) where
import Data.Maybe (fromMaybe)
-import Text.JSON (readJSON, showJSON, JSON, JSValue, makeObj)
+import Text.JSON (readJSON, JSON, JSValue, makeObj)
import qualified Text.JSON
import Ganeti.THH
[ pName
])
, ("OpClusterSetParams",
- [ pHvState
+ [ pForce
+ , pHvState
, pDiskState
, pVgName
, pEnabledHypervisors
, pHiddenOs
, pBlacklistedOs
, pUseExternalMipScript
+ , pEnabledDiskTemplates
+ , pModifyEtcHosts
])
, ("OpClusterRedistConf", [])
, ("OpClusterActivateMasterIp", [])
, pRuntimeMem
, pInstHvParams
, pOptDiskTemplate
+ , pPrimaryNode
, pRemoteNode
, pOsNameChange
, pInstOsParams
])
, ("OpNetworkAdd",
[ pNetworkName
- , pNetworkType
, pNetworkAddress4
, pNetworkGateway4
, pNetworkAddress6
])
, ("OpNetworkSetParams",
[ pNetworkName
- , pNetworkType
, pNetworkGateway4
, pNetworkAddress6
, pNetworkGateway6
, ("OpNetworkDisconnect",
[ pGroupName
, pNetworkName
- , pIpConflictsCheck
])
, ("OpNetworkQuery", dOldQuery)
, ("OpRestrictedCommand",
, pOpPriority
, pDependencies
, pComment
+ , pReason
])
-- | Default common parameter values.
, opPriority = OpPrioNormal
, opDepends = Nothing
, opComment = Nothing
+ , opReason = []
}
-- | The top-level opcode type.
setOpComment :: String -> MetaOpCode -> MetaOpCode
setOpComment comment (MetaOpCode common op) =
MetaOpCode (common { opComment = Just comment}) op
+
+-- | Sets the priority on a meta opcode.
+setOpPriority :: OpSubmitPriority -> MetaOpCode -> MetaOpCode
+setOpPriority prio (MetaOpCode common op) =
+ MetaOpCode (common { opPriority = prio }) op