Safe Haskell | None |
---|
Implementation of the opcodes.
- data OpCode
- = OpTestDelay {
- opDelayDuration :: Double
- opDelayOnMaster :: Bool
- opDelayOnNodes :: [NonEmptyString]
- opDelayRepeat :: NonNegative Int
- | OpInstanceReplaceDisks {
- opInstanceName :: String
- opEarlyRelease :: Bool
- opIgnoreIpolicy :: Bool
- opReplaceDisksMode :: ReplaceDisksMode
- opReplaceDisksList :: [DiskIndex]
- opRemoteNode :: Maybe NonEmptyString
- opIallocator :: Maybe NonEmptyString
- | OpInstanceFailover {
- opInstanceName :: String
- opShutdownTimeout :: NonNegative Int
- opIgnoreConsistency :: Bool
- opTargetNode :: Maybe NonEmptyString
- opIgnoreIpolicy :: Bool
- opIallocator :: Maybe NonEmptyString
- | OpInstanceMigrate {
- opInstanceName :: String
- opMigrationMode :: Maybe MigrationMode
- opOldLiveMode :: Maybe Bool
- opTargetNode :: Maybe NonEmptyString
- opAllowRuntimeChanges :: Bool
- opIgnoreIpolicy :: Bool
- opMigrationCleanup :: Bool
- opIallocator :: Maybe NonEmptyString
- opAllowFailover :: Bool
- | OpTagsGet {
- opKind :: TagObject
- opUseLocking :: Bool
- | OpTagsSearch { }
- | OpTagsSet { }
- | OpTagsDel { }
- | OpClusterPostInit {
- | OpClusterDestroy {
- | OpClusterQuery {
- | OpClusterVerify {
- opDebugSimulateErrors :: Bool
- opErrorCodes :: Bool
- opSkipChecks :: Set VerifyOptionalChecks
- opIgnoreErrors :: Set CVErrorCode
- opVerbose :: Bool
- opOptGroupName :: Maybe NonEmptyString
- | OpClusterVerifyConfig {
- opDebugSimulateErrors :: Bool
- opErrorCodes :: Bool
- opIgnoreErrors :: Set CVErrorCode
- opVerbose :: Bool
- | OpClusterVerifyGroup {
- opGroupName :: NonEmptyString
- opDebugSimulateErrors :: Bool
- opErrorCodes :: Bool
- opSkipChecks :: Set VerifyOptionalChecks
- opIgnoreErrors :: Set CVErrorCode
- opVerbose :: Bool
- | OpClusterVerifyDisks {
- | OpGroupVerifyDisks { }
- | OpClusterRepairDiskSizes { }
- | OpClusterConfigQuery { }
- | OpClusterRename { }
- | OpClusterSetParams {
- opHvState :: Maybe UncheckedDict
- opDiskState :: Maybe UncheckedDict
- opVgName :: Maybe String
- opEnabledHypervisors :: Maybe (NonEmpty Hypervisor)
- opClusterHvParams :: Maybe (Container UncheckedDict)
- opClusterBeParams :: Maybe UncheckedDict
- opOsHvp :: Maybe (Container UncheckedDict)
- opClusterOsParams :: Maybe (Container UncheckedDict)
- opDiskparams :: Maybe (GenericContainer DiskTemplate UncheckedDict)
- opCandidatePoolSize :: Maybe (Positive Int)
- opUidPool :: Maybe [[(Int, Int)]]
- opAddUids :: Maybe [[(Int, Int)]]
- opRemoveUids :: Maybe [[(Int, Int)]]
- opMaintainNodeHealth :: Maybe Bool
- opPreallocWipeDisks :: Maybe Bool
- opNicparams :: Maybe INicParams
- opNdparams :: Maybe UncheckedDict
- opIpolicy :: Maybe UncheckedDict
- opDrbdHelper :: Maybe String
- opDefaultIallocator :: Maybe String
- opMasterNetdev :: Maybe String
- opMasterNetmask :: Maybe (NonNegative Int)
- opReservedLvs :: Maybe [NonEmptyString]
- opHiddenOs :: Maybe TestClusterOsList
- opBlacklistedOs :: Maybe TestClusterOsList
- opUseExternalMipScript :: Maybe Bool
- | OpClusterRedistConf {
- | OpClusterActivateMasterIp {
- | OpClusterDeactivateMasterIp {
- | OpQuery {
- opWhat :: QueryTypeOp
- opUseLocking :: Bool
- opFields :: [NonEmptyString]
- opQfilter :: Filter String
- | OpQueryFields {
- opWhat :: QueryTypeOp
- opFields :: [NonEmptyString]
- | OpOobCommand {
- opNodeNames :: [NonEmptyString]
- opCommand :: OobCommand
- opTimeout :: Int
- opIgnoreStatus :: Bool
- opPowerDelay :: Double
- | OpNodeRemove { }
- | OpNodeAdd {
- opNodeName :: NonEmptyString
- opHvState :: Maybe UncheckedDict
- opDiskState :: Maybe UncheckedDict
- opPrimaryIp :: Maybe String
- opSecondaryIp :: Maybe NonEmptyString
- opReadd :: Bool
- opGroup :: Maybe NonEmptyString
- opMasterCapable :: Maybe Bool
- opVmCapable :: Maybe Bool
- opNdparams :: Maybe UncheckedDict
- | OpNodeQuery {
- opOutputFields :: [NonEmptyString]
- opNames :: [NonEmptyString]
- opUseLocking :: Bool
- | OpNodeQueryvols { }
- | OpNodeQueryStorage { }
- | OpNodeModifyStorage { }
- | OpRepairNodeStorage { }
- | OpNodeSetParams {
- opNodeName :: NonEmptyString
- opForce :: Bool
- opHvState :: Maybe UncheckedDict
- opDiskState :: Maybe UncheckedDict
- opMasterCandidate :: Maybe Bool
- opOffline :: Maybe Bool
- opDrained :: Maybe Bool
- opAutoPromote :: Bool
- opMasterCapable :: Maybe Bool
- opVmCapable :: Maybe Bool
- opSecondaryIp :: Maybe NonEmptyString
- opNdparams :: Maybe UncheckedDict
- opPowered :: Maybe Bool
- | OpNodePowercycle {
- opNodeName :: NonEmptyString
- opForce :: Bool
- | OpNodeMigrate {
- opNodeName :: NonEmptyString
- opMigrationMode :: Maybe MigrationMode
- opOldLiveMode :: Maybe Bool
- opTargetNode :: Maybe NonEmptyString
- opAllowRuntimeChanges :: Bool
- opIgnoreIpolicy :: Bool
- opIallocator :: Maybe NonEmptyString
- | OpNodeEvacuate {
- opEarlyRelease :: Bool
- opNodeName :: NonEmptyString
- opRemoteNode :: Maybe NonEmptyString
- opIallocator :: Maybe NonEmptyString
- opEvacMode :: NodeEvacMode
- | OpInstanceCreate {
- opInstanceName :: String
- opForceVariant :: Bool
- opWaitForSync :: Bool
- opNameCheck :: Bool
- opIgnoreIpolicy :: Bool
- opInstBeParams :: UncheckedDict
- opinstDisks :: [IDiskParams]
- opDiskTemplate :: DiskTemplate
- opFileDriver :: Maybe FileDriver
- opFileStorageDir :: Maybe NonEmptyString
- opInstHvParams :: UncheckedDict
- opHypervisor :: Maybe Hypervisor
- opIallocator :: Maybe NonEmptyString
- opIdentifyDefaults :: Bool
- opIpCheck :: Bool
- opConflictsCheck :: Bool
- opInstCreateMode :: InstCreateMode
- opNics :: [INicParams]
- opNoInstall :: Maybe Bool
- opInstOsParams :: UncheckedDict
- opOsType :: Maybe NonEmptyString
- opPnode :: Maybe NonEmptyString
- opSnode :: Maybe NonEmptyString
- opSourceHandshake :: Maybe UncheckedList
- opSourceInstanceName :: Maybe NonEmptyString
- opSourceShutdownTimeout :: NonNegative Int
- opSourceX509Ca :: Maybe NonEmptyString
- opSrcNode :: Maybe NonEmptyString
- opSrcPath :: Maybe NonEmptyString
- opStart :: Bool
- opOpportunisticLocking :: Bool
- opInstTags :: [NonEmptyString]
- | OpInstanceMultiAlloc {
- opIallocator :: Maybe NonEmptyString
- opInstMultiAlloc :: UncheckedList
- opOpportunisticLocking :: Bool
- | OpInstanceReinstall {
- opInstanceName :: String
- opForceVariant :: Bool
- opOsType :: Maybe NonEmptyString
- opTempOsParams :: Maybe UncheckedDict
- | OpInstanceRemove {
- opInstanceName :: String
- opShutdownTimeout :: NonNegative Int
- opIgnoreFailures :: Bool
- | OpInstanceRename {
- opInstanceName :: String
- opNewName :: NonEmptyString
- opNameCheck :: Bool
- opIpCheck :: Bool
- | OpInstanceStartup {
- opInstanceName :: String
- opForce :: Bool
- opIgnoreOfflineNodes :: Bool
- opTempHvParams :: UncheckedDict
- opTempBeParams :: UncheckedDict
- opNoRemember :: Bool
- opStartupPaused :: Bool
- | OpInstanceShutdown {
- opInstanceName :: String
- opForce :: Bool
- opIgnoreOfflineNodes :: Bool
- opInstShutdownTimeout :: NonNegative Int
- opNoRemember :: Bool
- | OpInstanceReboot {
- opInstanceName :: String
- opShutdownTimeout :: NonNegative Int
- opIgnoreSecondaries :: Bool
- opRebootType :: RebootType
- | OpInstanceMove {
- opInstanceName :: String
- opShutdownTimeout :: NonNegative Int
- opIgnoreIpolicy :: Bool
- opMoveTargetNode :: NonEmptyString
- opIgnoreConsistency :: Bool
- | OpInstanceConsole {
- opInstanceName :: String
- | OpInstanceActivateDisks {
- opInstanceName :: String
- opIgnoreSize :: Bool
- opWaitForSync :: Bool
- | OpInstanceDeactivateDisks {
- opInstanceName :: String
- opForce :: Bool
- | OpInstanceRecreateDisks {
- opInstanceName :: String
- opRecreateDisksInfo :: RecreateDisksInfo
- opNodes :: [NonEmptyString]
- opIallocator :: Maybe NonEmptyString
- | OpInstanceQuery {
- opOutputFields :: [NonEmptyString]
- opNames :: [NonEmptyString]
- opUseLocking :: Bool
- | OpInstanceQueryData {
- opUseLocking :: Bool
- opInstances :: [NonEmptyString]
- opStatic :: Bool
- | OpInstanceSetParams {
- opInstanceName :: String
- opForce :: Bool
- opForceVariant :: Bool
- opIgnoreIpolicy :: Bool
- opInstNicChanges :: SetParamsMods INicParams
- opInstDiskChanges :: SetParamsMods IDiskParams
- opInstBeParams :: UncheckedDict
- opRuntimeMem :: Maybe (Positive Int)
- opInstHvParams :: UncheckedDict
- opOptDiskTemplate :: Maybe DiskTemplate
- opRemoteNode :: Maybe NonEmptyString
- opOsName :: Maybe NonEmptyString
- opInstOsParams :: UncheckedDict
- opWaitForSync :: Bool
- opOffline :: Maybe Bool
- opConflictsCheck :: Bool
- | OpInstanceGrowDisk {
- opInstanceName :: String
- opWaitForSync :: Bool
- opDiskIndex :: DiskIndex
- opDiskChgAmount :: NonNegative Int
- opDiskChkAbsolute :: Bool
- | OpInstanceChangeGroup {
- opInstanceName :: String
- opEarlyRelease :: Bool
- opIallocator :: Maybe NonEmptyString
- opTargetGroups :: Maybe [NonEmptyString]
- | OpGroupAdd {
- opGroupName :: NonEmptyString
- opAllocPolicy :: Maybe AllocPolicy
- opNdparams :: Maybe UncheckedDict
- opDiskparams :: Maybe (GenericContainer DiskTemplate UncheckedDict)
- opHvState :: Maybe UncheckedDict
- opDiskState :: Maybe UncheckedDict
- opIpolicy :: Maybe UncheckedDict
- | OpGroupAssignNodes {
- opGroupName :: NonEmptyString
- opForce :: Bool
- opReqNodes :: [NonEmptyString]
- | OpGroupQuery { }
- | OpGroupSetParams {
- opGroupName :: NonEmptyString
- opAllocPolicy :: Maybe AllocPolicy
- opNdparams :: Maybe UncheckedDict
- opDiskparams :: Maybe (GenericContainer DiskTemplate UncheckedDict)
- opHvState :: Maybe UncheckedDict
- opDiskState :: Maybe UncheckedDict
- opIpolicy :: Maybe UncheckedDict
- | OpGroupRemove { }
- | OpGroupRename { }
- | OpGroupEvacuate {
- opGroupName :: NonEmptyString
- opEarlyRelease :: Bool
- opIallocator :: Maybe NonEmptyString
- opTargetGroups :: Maybe [NonEmptyString]
- | OpOsDiagnose { }
- | OpExtStorageDiagnose { }
- | OpBackupQuery {
- opUseLocking :: Bool
- opNodes :: [NonEmptyString]
- | OpBackupPrepare {
- opInstanceName :: String
- opExportMode :: ExportMode
- | OpBackupExport {
- opInstanceName :: String
- opShutdownTimeout :: NonNegative Int
- opExportTarget :: ExportTarget
- opShutdown :: Bool
- opRemoveInstance :: Bool
- opIgnoreRemoveFailures :: Bool
- opExportMode :: ExportMode
- opX509KeyName :: Maybe UncheckedList
- opDestinationX509Ca :: Maybe NonEmptyString
- | OpBackupRemove {
- opInstanceName :: String
- | OpTestAllocator {
- opIAllocatorDirection :: IAllocatorTestDir
- opIAllocatorMode :: IAllocatorMode
- opIAllocatorReqName :: NonEmptyString
- opIAllocatorNics :: [UncheckedDict]
- opIAllocatorDisks :: UncheckedList
- opHypervisor :: Maybe Hypervisor
- opIallocator :: Maybe NonEmptyString
- opInstTags :: [NonEmptyString]
- opIAllocatorMem :: Maybe (NonNegative Int)
- opIAllocatorVCpus :: Maybe (NonNegative Int)
- opIAllocatorOs :: Maybe NonEmptyString
- opDiskTemplate :: DiskTemplate
- opIAllocatorInstances :: Maybe [NonEmptyString]
- opIAllocatorEvacMode :: Maybe NodeEvacMode
- opTargetGroups :: Maybe [NonEmptyString]
- opIAllocatorSpindleUse :: NonNegative Int
- opIAllocatorCount :: NonNegative Int
- | OpTestJqueue {
- opNotifyWaitlock :: Bool
- opNotifyExec :: Bool
- opLogMessages :: [String]
- opJQueueFail :: Bool
- | OpTestDummy { }
- | OpNetworkAdd {
- opNetworkName :: NonEmptyString
- opNetworkAddress4 :: NonEmptyString
- opNetworkGateway4 :: Maybe NonEmptyString
- opNetworkAddress6 :: Maybe NonEmptyString
- opNetworkGateway6 :: Maybe NonEmptyString
- opNetMacPrefix :: Maybe NonEmptyString
- opNetworkAddRsvdIps :: Maybe [NonEmptyString]
- opConflictsCheck :: Bool
- opInstTags :: [NonEmptyString]
- | OpNetworkRemove {
- opNetworkName :: NonEmptyString
- opForce :: Bool
- | OpNetworkSetParams {
- opNetworkName :: NonEmptyString
- opNetworkGateway4 :: Maybe NonEmptyString
- opNetworkAddress6 :: Maybe NonEmptyString
- opNetworkGateway6 :: Maybe NonEmptyString
- opNetMacPrefix :: Maybe NonEmptyString
- opNetworkAddRsvdIps :: Maybe [NonEmptyString]
- opNetworkRemoveRsvdIps :: Maybe [NonEmptyString]
- | OpNetworkConnect { }
- | OpNetworkDisconnect { }
- | OpNetworkQuery {
- opOutputFields :: [NonEmptyString]
- opNames :: [NonEmptyString]
- opUseLocking :: Bool
- | OpRestrictedCommand {
- opUseLocking :: Bool
- opReqNodes :: [NonEmptyString]
- opRestrictedCommand :: NonEmptyString
- = OpTestDelay {
- saveOpCode :: OpCode -> JSValue
- toDictOpCode :: OpCode -> [(String, JSValue)]
- loadOpCode :: JSValue -> Result OpCode
- allOpFields :: String -> [String]
- opID :: OpCode -> String
- allOpIDs :: [String]
- opSummaryVal :: OpCode -> Maybe String
- opSummary :: OpCode -> String
- data CommonOpParams = CommonOpParams {
- opDryRun :: Maybe Bool
- opDebugLevel :: Maybe (NonNegative Int)
- opPriority :: OpSubmitPriority
- opDepends :: Maybe [JobDependency]
- opComment :: Maybe String
- loadCommonOpParams :: JSValue -> Result CommonOpParams
- saveCommonOpParams :: CommonOpParams -> JSValue
- toDictCommonOpParams :: CommonOpParams -> [(String, JSValue)]
- defOpParams :: CommonOpParams
- data MetaOpCode = MetaOpCode {}
- showMeta :: MetaOpCode -> JSValue
- readMeta :: JSValue -> Result MetaOpCode
- wrapOpCode :: OpCode -> MetaOpCode
- setOpComment :: String -> MetaOpCode -> MetaOpCode
- setOpPriority :: OpSubmitPriority -> MetaOpCode -> MetaOpCode
Documentation
OpCode representation.
We only implement a subset of Ganeti opcodes: those which are actually used in the htools codebase.
saveOpCode :: OpCode -> JSValueSource
toDictOpCode :: OpCode -> [(String, JSValue)]Source
loadOpCode :: JSValue -> Result OpCodeSource
allOpFields :: String -> [String]Source
opSummaryVal :: OpCode -> Maybe StringSource
data CommonOpParams Source
Generic/common opcode parameters.
CommonOpParams | |
|
Eq CommonOpParams | |
Show CommonOpParams | |
Arbitrary CommonOpParams | |
JSON CommonOpParams |
loadCommonOpParams :: JSValue -> Result CommonOpParamsSource
saveCommonOpParams :: CommonOpParams -> JSValueSource
toDictCommonOpParams :: CommonOpParams -> [(String, JSValue)]Source
defOpParams :: CommonOpParamsSource
Default common parameter values.
data MetaOpCode Source
The top-level opcode type.
Eq MetaOpCode | |
Show MetaOpCode | |
Arbitrary MetaOpCode | Arbitrary instance for MetaOpCode, defined here due to TH ordering. |
JSON MetaOpCode |
showMeta :: MetaOpCode -> JSValueSource
readMeta :: JSValue -> Result MetaOpCodeSource
wrapOpCode :: OpCode -> MetaOpCodeSource
Wraps an OpCode
with the default parameters to build a
MetaOpCode
.
setOpComment :: String -> MetaOpCode -> MetaOpCodeSource
Sets the comment on a meta opcode.
setOpPriority :: OpSubmitPriority -> MetaOpCode -> MetaOpCodeSource
Sets the priority on a meta opcode.