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))
 
opDiskparams :: Maybe (GenericContainer DiskTemplate (JSObject JSValue))
 
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
 
opgenericNdParams :: Maybe (JSObject JSValue)
 
opIpolicy :: Maybe (JSObject JSValue)
 
opDrbdHelper :: Maybe String
 
opDefaultIallocator :: Maybe String
 
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
 
OpClusterRedistConf 
OpClusterActivateMasterIp 
OpClusterDeactivateMasterIp 
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)
 
OpNodeQuery 
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)
 
OpInstanceRemove 
OpInstanceRename 
OpInstanceStartup 

Fields

opInstanceName :: String
 
opInstanceUuid :: Maybe NonEmptyString
 
opForce :: Bool
 
opIgnoreOfflineNodes :: Bool
 
opTempHvParams :: JSObject JSValue
 
opTempBeParams :: JSObject JSValue
 
opNoRemember :: Bool
 
opStartupPaused :: Bool
 
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 
OpInstanceQuery 
OpInstanceQueryData 

Fields

opUseLocking :: Bool
 
opInstances :: [NonEmptyString]
 
opStatic :: Bool
 
OpInstanceSetParams 
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 
OpGroupQuery 
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 
OpBackupQuery 

Fields

opUseLocking :: Bool
 
opNodes :: [NonEmptyString]
 
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 
OpNetworkQuery 

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.