ganeti

Safe HaskellNone

Ganeti.OpCodes

Description

Implementation of the opcodes.

Synopsis

Documentation

data OpCode Source

OpCode representation.

We only implement a subset of Ganeti opcodes: those which are actually used in the htools codebase.

Constructors

OpTestDelay 
OpInstanceReplaceDisks 
OpInstanceFailover 
OpInstanceMigrate 
OpTagsGet 

Fields

opKind :: TagObject
 
opUseLocking :: Bool
 
OpTagsSearch 
OpTagsSet 

Fields

opKind :: TagObject
 
opTags :: [String]
 
OpTagsDel 

Fields

opKind :: TagObject
 
opTags :: [String]
 
OpClusterPostInit 
OpClusterDestroy 
OpClusterQuery 
OpClusterVerify 
OpClusterVerifyConfig 

Fields

opDebugSimulateErrors :: Bool
 
opErrorCodes :: Bool
 
opIgnoreErrors :: Set CVErrorCode
 
opVerbose :: Bool
 
OpClusterVerifyGroup 
OpClusterVerifyDisks 
OpGroupVerifyDisks 
OpClusterRepairDiskSizes 
OpClusterConfigQuery 
OpClusterRename 
OpClusterSetParams 

Fields

opForce :: Bool
 
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
 
opEnabledDiskTemplates :: Maybe (NonEmpty DiskTemplate)
 
opModifyEtcHosts :: Maybe Bool
 
OpClusterRedistConf 
OpClusterActivateMasterIp 
OpClusterDeactivateMasterIp 
OpQuery 
OpQueryFields 
OpOobCommand 
OpNodeRemove 
OpNodeAdd 

Fields

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 
OpNodeQueryvols 
OpNodeQueryStorage 
OpNodeModifyStorage 
OpRepairNodeStorage 
OpNodeSetParams 

Fields

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 

Fields

opNodeName :: NonEmptyString
 
opForce :: Bool
 
OpNodeMigrate 
OpNodeEvacuate 
OpInstanceCreate 
OpInstanceMultiAlloc 
OpInstanceReinstall 

Fields

opInstanceName :: String
 
opForceVariant :: Bool
 
opOsType :: Maybe NonEmptyString
 
opTempOsParams :: Maybe UncheckedDict
 
OpInstanceRemove 
OpInstanceRename 

Fields

opInstanceName :: String
 
opNewName :: NonEmptyString
 
opNameCheck :: Bool
 
opIpCheck :: Bool
 
OpInstanceStartup 
OpInstanceShutdown 

Fields

opInstanceName :: String
 
opForce :: Bool
 
opIgnoreOfflineNodes :: Bool
 
opInstShutdownTimeout :: NonNegative Int
 
opNoRemember :: Bool
 
OpInstanceReboot 
OpInstanceMove 
OpInstanceConsole 

Fields

opInstanceName :: String
 
OpInstanceActivateDisks 

Fields

opInstanceName :: String
 
opIgnoreSize :: Bool
 
opWaitForSync :: Bool
 
OpInstanceDeactivateDisks 

Fields

opInstanceName :: String
 
opForce :: Bool
 
OpInstanceRecreateDisks 
OpInstanceQuery 
OpInstanceQueryData 

Fields

opUseLocking :: Bool
 
opInstances :: [NonEmptyString]
 
opStatic :: Bool
 
OpInstanceSetParams 
OpInstanceGrowDisk 
OpInstanceChangeGroup 
OpGroupAdd 
OpGroupAssignNodes 
OpGroupQuery 
OpGroupSetParams 
OpGroupRemove 
OpGroupRename 
OpGroupEvacuate 
OpOsDiagnose 
OpExtStorageDiagnose 
OpBackupQuery 

Fields

opUseLocking :: Bool
 
opNodes :: [NonEmptyString]
 
OpBackupPrepare 

Fields

opInstanceName :: String
 
opExportMode :: ExportMode
 
OpBackupExport 
OpBackupRemove 

Fields

opInstanceName :: String
 
OpTestAllocator 
OpTestJqueue 

Fields

opNotifyWaitlock :: Bool
 
opNotifyExec :: Bool
 
opLogMessages :: [String]
 
opJQueueFail :: Bool
 
OpTestDummy 
OpNetworkAdd 
OpNetworkRemove 
OpNetworkSetParams 
OpNetworkConnect 
OpNetworkDisconnect 
OpNetworkQuery 
OpRestrictedCommand 

Instances

Eq OpCode 
Show OpCode 
Arbitrary OpCode 
JSON OpCode 

saveOpCode :: OpCode -> JSValueSource

toDictOpCode :: OpCode -> [(String, JSValue)]Source

loadOpCode :: JSValue -> Result OpCodeSource

allOpFields :: String -> [String]Source

opID :: OpCode -> StringSource

Returns the OP_ID for a given opcode value.

allOpIDs :: [String]Source

A list of all defined/supported opcode IDs.

opSummaryVal :: OpCode -> Maybe StringSource

opSummary :: OpCode -> StringSource

Computes the summary of the opcode.

data CommonOpParams Source

Generic/common opcode parameters.

Constructors

CommonOpParams 

Fields

opDryRun :: Maybe Bool
 
opDebugLevel :: Maybe (NonNegative Int)
 
opPriority :: OpSubmitPriority
 
opDepends :: Maybe [JobDependency]
 
opComment :: Maybe String
 
opReason :: ReasonTrail
 

Instances

toDictCommonOpParams :: CommonOpParams -> [(String, JSValue)]Source

defOpParams :: CommonOpParamsSource

Default common parameter values.

data MetaOpCode Source

The top-level opcode type.

Instances

Eq MetaOpCode 
Show MetaOpCode 
Arbitrary MetaOpCode

Arbitrary instance for MetaOpCode, defined here due to TH ordering.

JSON MetaOpCode 

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.