ganeti

Safe HaskellNone

Ganeti.OpCodes

Description

Implementation of the opcodes.

Synopsis

Documentation

type JobIdListOnly = Map String [(Bool, Either String JobId)]Source

type InstanceMultiAllocResponse = ([(Bool, Either String JobId)], NonEmptyString)Source

data OpCode Source

OpCode representation.

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

Constructors

OpClusterPostInit 
OpClusterDestroy 
OpClusterQuery 
OpClusterVerify 
OpClusterVerifyConfig 
OpClusterVerifyGroup 
OpClusterVerifyDisks 
OpGroupVerifyDisks 
OpClusterRepairDiskSizes 
OpClusterConfigQuery 
OpClusterRename 
OpClusterSetParams 

Fields

opForce :: Bool
 
opHvState :: Maybe (JSObject JSValue)
 
opDiskState :: Maybe (JSObject JSValue)
 
opVgName :: Maybe String
 
opEnabledHypervisors :: Maybe [Hypervisor]
 
opClusterHvParams :: Maybe (GenericContainer String (JSObject JSValue))
 
opClusterBeParams :: Maybe (JSObject JSValue)
 
opOsHvp :: Maybe (GenericContainer String (JSObject JSValue))
 
opClusterOsParams :: Maybe (GenericContainer String (JSObject JSValue))
 
opClusterOsParamsPrivate :: Maybe (GenericContainer String (JSObject (Private JSValue)))
 
opDiskparams :: Maybe (GenericContainer DiskTemplate (JSObject JSValue))
 
opCandidatePoolSize :: Maybe (Positive Int)
 
opMaxRunningJobs :: Maybe (Positive Int)
 
opMaxTrackedJobs :: Maybe (Positive Int)
 
opUidPool :: Maybe [(Int, Int)]
 
opAddUids :: Maybe [(Int, Int)]
 
opRemoveUids :: Maybe [(Int, Int)]
 
opMaintainNodeHealth :: Maybe Bool
 
opPreallocWipeDisks :: Maybe Bool
 
opNicparams :: Maybe INicParams
 
opgenericNdParams :: Maybe (JSObject JSValue)
 
opIpolicy :: Maybe (JSObject JSValue)
 
opDrbdHelper :: Maybe String
 
opDefaultIallocator :: Maybe String
 
opDefaultIallocatorParams :: Maybe (JSObject JSValue)
 
opNetMacPrefix :: Maybe NonEmptyString
 
opMasterNetdev :: Maybe String
 
opMasterNetmask :: Maybe (NonNegative Int)
 
opReservedLvs :: Maybe [NonEmptyString]
 
opHiddenOs :: Maybe [(DdmSimple, NonEmptyString)]
 
opBlacklistedOs :: Maybe [(DdmSimple, NonEmptyString)]
 
opUseExternalMipScript :: Maybe Bool
 
opEnabledDiskTemplates :: Maybe [DiskTemplate]
 
opModifyEtcHosts :: Maybe Bool
 
opClusterFileStorageDir :: Maybe String
 
opClusterSharedFileStorageDir :: Maybe String
 
opClusterGlusterStorageDir :: Maybe String
 
opInstallImage :: Maybe String
 
opInstanceCommunicationNetwork :: Maybe String
 
opZeroingImage :: Maybe String
 
opCompressionTools :: Maybe [NonEmptyString]
 
opEnabledUserShutdown :: Maybe Bool
 
OpClusterRedistConf 
OpClusterActivateMasterIp 
OpClusterDeactivateMasterIp 
OpClusterRenewCrypto 

Fields

opVerbose :: Bool
 
opDebug :: Bool
 
OpQuery 

Fields

opWhat :: QueryTypeOp
 
opUseLocking :: Bool
 
opFields :: [NonEmptyString]
 
opQfilter :: Maybe [JSValue]
 
OpQueryFields 
OpOobCommand 
OpRestrictedCommand 
OpNodeRemove 
OpNodeAdd 

Fields

opNodeName :: NonEmptyString
 
opHvState :: Maybe (JSObject JSValue)
 
opDiskState :: Maybe (JSObject JSValue)
 
opPrimaryIp :: Maybe NonEmptyString
 
opSecondaryIp :: Maybe NonEmptyString
 
opReadd :: Bool
 
opGroup :: Maybe NonEmptyString
 
opMasterCapable :: Maybe Bool
 
opVmCapable :: Maybe Bool
 
opgenericNdParams :: Maybe (JSObject JSValue)
 
OpNodeQueryvols 
OpNodeQueryStorage 
OpNodeModifyStorage 
OpRepairNodeStorage 
OpNodeSetParams 

Fields

opNodeName :: NonEmptyString
 
opNodeUuid :: Maybe NonEmptyString
 
opForce :: Bool
 
opHvState :: Maybe (JSObject JSValue)
 
opDiskState :: Maybe (JSObject JSValue)
 
opMasterCandidate :: Maybe Bool
 
opOffline :: Maybe Bool
 
opDrained :: Maybe Bool
 
opAutoPromote :: Bool
 
opMasterCapable :: Maybe Bool
 
opVmCapable :: Maybe Bool
 
opSecondaryIp :: Maybe NonEmptyString
 
opgenericNdParams :: Maybe (JSObject JSValue)
 
opPowered :: Maybe Bool
 
OpNodePowercycle 
OpNodeMigrate 
OpNodeEvacuate 
OpInstanceCreate 
OpInstanceMultiAlloc 

Fields

opOpportunisticLocking :: Bool
 
opIallocator :: Maybe NonEmptyString
 
opInstMultiAlloc :: [JSValue]
 
OpInstanceReinstall 

Fields

opInstanceName :: String
 
opInstanceUuid :: Maybe NonEmptyString
 
opForceVariant :: Bool
 
opOsType :: Maybe NonEmptyString
 
opTempOsParams :: Maybe (JSObject JSValue)
 
opOsparamsPrivate :: Maybe (JSObject (Private JSValue))
 
opOsparamsSecret :: Maybe (JSObject (Private JSValue))
 
OpInstanceRemove 
OpInstanceRename 
OpInstanceStartup 

Fields

opInstanceName :: String
 
opInstanceUuid :: Maybe NonEmptyString
 
opForce :: Bool
 
opIgnoreOfflineNodes :: Bool
 
opTempHvParams :: JSObject JSValue
 
opTempBeParams :: JSObject JSValue
 
opNoRemember :: Bool
 
opStartupPaused :: Bool
 
opShutdownTimeout :: NonNegative Int
 
OpInstanceShutdown 
OpInstanceReboot 
OpInstanceReplaceDisks 
OpInstanceFailover 
OpInstanceMigrate 
OpInstanceMove 
OpInstanceConsole 

Fields

opInstanceName :: String
 
opInstanceUuid :: Maybe NonEmptyString
 
OpInstanceActivateDisks 

Fields

opInstanceName :: String
 
opInstanceUuid :: Maybe NonEmptyString
 
opIgnoreSize :: Bool
 
opWaitForSync :: Bool
 
OpInstanceDeactivateDisks 

Fields

opInstanceName :: String
 
opInstanceUuid :: Maybe NonEmptyString
 
opForce :: Bool
 
OpInstanceRecreateDisks 
OpInstanceQueryData 

Fields

opUseLocking :: Bool
 
opInstances :: [NonEmptyString]
 
opStatic :: Bool
 
OpInstanceSetParams 

Fields

opInstanceName :: String
 
opInstanceUuid :: Maybe NonEmptyString
 
opForce :: Bool
 
opForceVariant :: Bool
 
opIgnoreIpolicy :: Bool
 
opInstNicChanges :: SetParamsMods INicParams
 
opInstDiskChanges :: SetParamsMods IDiskParams
 
opInstBeParams :: JSObject JSValue
 
opRuntimeMem :: Maybe (Positive Int)
 
opInstHvParams :: JSObject JSValue
 
opOptDiskTemplate :: Maybe DiskTemplate
 
opPnode :: Maybe NonEmptyString
 
opPnodeUuid :: Maybe NonEmptyString
 
opRemoteNode :: Maybe NonEmptyString
 
opRemoteNodeUuid :: Maybe NonEmptyString
 
opOsName :: Maybe NonEmptyString
 
opInstOsParams :: JSObject JSValue
 
opOsparamsPrivate :: Maybe (JSObject (Private JSValue))
 
opWaitForSync :: Bool
 
opOffline :: Maybe Bool
 
opConflictsCheck :: Bool
 
opHotplug :: Bool
 
opHotplugIfPossible :: Bool
 
opOptInstanceCommunication :: Maybe Bool
 
OpInstanceGrowDisk 
OpInstanceChangeGroup 
OpGroupAdd 

Fields

opGroupName :: NonEmptyString
 
opAllocPolicy :: Maybe AllocPolicy
 
opNdparams :: Maybe (JSObject JSValue)
 
opDiskparams :: Maybe (GenericContainer DiskTemplate (JSObject JSValue))
 
opHvState :: Maybe (JSObject JSValue)
 
opDiskState :: Maybe (JSObject JSValue)
 
opIpolicy :: Maybe (JSObject JSValue)
 
OpGroupAssignNodes 
OpGroupSetParams 

Fields

opGroupName :: NonEmptyString
 
opAllocPolicy :: Maybe AllocPolicy
 
opNdparams :: Maybe (JSObject JSValue)
 
opDiskparams :: Maybe (GenericContainer DiskTemplate (JSObject JSValue))
 
opHvState :: Maybe (JSObject JSValue)
 
opDiskState :: Maybe (JSObject JSValue)
 
opIpolicy :: Maybe (JSObject JSValue)
 
OpGroupRemove 
OpGroupRename 
OpGroupEvacuate 
OpOsDiagnose 
OpExtStorageDiagnose 
OpBackupPrepare 
OpBackupExport 
OpBackupRemove 

Fields

opInstanceName :: String
 
opInstanceUuid :: Maybe NonEmptyString
 
OpTagsGet 

Fields

opKind :: TagKind
 
opUseLocking :: Bool
 
opTagsGetName :: Maybe String
 
OpTagsSearch 
OpTagsSet 

Fields

opKind :: TagKind
 
opTags :: [String]
 
opTagsGetName :: Maybe String
 
OpTagsDel 

Fields

opKind :: TagKind
 
opTags :: [String]
 
opTagsGetName :: Maybe String
 
OpTestDelay 
OpTestAllocator 
OpTestJqueue 

Fields

opNotifyWaitlock :: Bool
 
opNotifyExec :: Bool
 
opLogMessages :: [String]
 
opJQueueFail :: Bool
 
OpTestDummy 

Fields

opTestDummyResult :: JSValue
 
opTestDummyMessages :: JSValue
 
opTestDummyFail :: JSValue
 
opTestDummySubmitJobs :: JSValue
 
OpNetworkAdd 
OpNetworkRemove 
OpNetworkSetParams 
OpNetworkConnect 
OpNetworkDisconnect 

Instances

Eq OpCode 
Show OpCode 
Arbitrary OpCode 
JSON OpCode 
DictObject OpCode 

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.

opReasonSrcID :: OpCode -> StringSource

Convert the opcode name to lowercase with underscores and strip the Op prefix.

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
 

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 
DictObject MetaOpCode 

resolveDependencies :: Monad m => MetaOpCode -> JobId -> m MetaOpCodeSource

Resolve relative dependencies to absolute ones, given the job Id.

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.