Safe Haskell | None |
---|
Implementation of opcodes parameters.
These are defined in a separate module only due to TemplateHaskell stage restrictions - expressions defined in the current module can't be passed to splices. So we have to either parameters/repeat each parameter definition multiple times, or separate them into this module.
Synopsis
- booleanField :: String -> Field
- defaultFalse :: String -> Field
- defaultTrue :: String -> Field
- stringField :: String -> Field
- optionalStringField :: String -> Field
- optionalNEStringField :: String -> Field
- forceNonNeg :: (Num a, Ord a, Show a) => a -> NonNegative a
- newtype DiskIndex = DiskIndex {
- unDiskIndex :: Int
- mkDiskIndex :: MonadFail m => Int -> m DiskIndex
- data DiskAccess
- diskAccessFromRaw :: forall m. (Monad m, MonadFail m) => String -> m DiskAccess
- diskAccessToRaw :: DiskAccess -> String
- data INicParams = INicParams {
- inicMac :: (Maybe NonEmptyString)
- inicIp :: (Maybe String)
- inicMode :: (Maybe NonEmptyString)
- inicLink :: (Maybe NonEmptyString)
- inicName :: (Maybe NonEmptyString)
- inicVlan :: (Maybe String)
- inicBridge :: (Maybe NonEmptyString)
- inicNetwork :: (Maybe NonEmptyString)
- loadINicParams :: JSValue -> Result INicParams
- saveINicParams :: INicParams -> JSValue
- data IDiskParams = IDiskParams {
- idiskSize :: (Maybe Int)
- idiskMode :: (Maybe DiskAccess)
- idiskAdopt :: (Maybe NonEmptyString)
- idiskVg :: (Maybe NonEmptyString)
- idiskMetavg :: (Maybe NonEmptyString)
- idiskName :: (Maybe NonEmptyString)
- idiskProvider :: (Maybe NonEmptyString)
- idiskSpindles :: (Maybe Int)
- idiskAccess :: (Maybe NonEmptyString)
- idiskOpaque :: (Map String JSValue)
- loadIDiskParams :: JSValue -> Result IDiskParams
- saveIDiskParams :: IDiskParams -> JSValue
- data RecreateDisksInfo
- readRecreateDisks :: JSValue -> Result RecreateDisksInfo
- data DdmOldChanges
- = DdmOldIndex (NonNegative Int)
- | DdmOldMod DdmSimple
- readDdmOldChanges :: JSValue -> Result DdmOldChanges
- data SetParamsMods a
- = SetParamsEmpty
- | SetParamsDeprecated (NonEmpty (DdmOldChanges, a))
- | SetParamsNew (NonEmpty (DdmFull, Int, a))
- | SetParamsNewName (NonEmpty (DdmFull, String, a))
- readSetParams :: JSON a => JSValue -> Result (SetParamsMods a)
- data ExportTarget
- = ExportTargetLocal NonEmptyString
- | ExportTargetRemote [JSValue]
- readExportTarget :: JSValue -> Result ExportTarget
- pDryRun :: Field
- pDebugLevel :: Field
- pOpPriority :: Field
- pDependencies :: Field
- pComment :: Field
- pReason :: Field
- pSequential :: Field
- pDebugSimulateErrors :: Field
- pErrorCodes :: Field
- pSkipChecks :: Field
- pIgnoreErrors :: Field
- pVerbose :: Field
- pDebug :: Field
- pOptGroupName :: Field
- pGroupName :: Field
- pHotplug :: Field
- pHotplugIfPossible :: Field
- pInstances :: Field
- pOutputFields :: Field
- pName :: Field
- pForce :: Field
- pHvState :: Field
- pDiskState :: Field
- pClusterFileStorageDir :: Field
- pClusterSharedFileStorageDir :: Field
- pClusterGlusterStorageDir :: Field
- pInstallImage :: Field
- pInstanceCommunicationNetwork :: Field
- pZeroingImage :: Field
- pCompressionTools :: Field
- pVgName :: Field
- pEnabledHypervisors :: Field
- pClusterHvParams :: Field
- pClusterBeParams :: Field
- pOsHvp :: Field
- pClusterOsParams :: Field
- pClusterOsParamsPrivate :: Field
- pGroupDiskParams :: Field
- pCandidatePoolSize :: Field
- pMaxRunningJobs :: Field
- pMaxTrackedJobs :: Field
- pUidPool :: Field
- pAddUids :: Field
- pRemoveUids :: Field
- pMaintainNodeHealth :: Field
- pModifyEtcHosts :: Field
- pPreallocWipeDisks :: Field
- pNicParams :: Field
- pIpolicy :: Field
- pDrbdHelper :: Field
- pDefaultIAllocator :: Field
- pDefaultIAllocatorParams :: Field
- pMasterNetdev :: Field
- pMasterNetmask :: Field
- pReservedLvs :: Field
- pHiddenOs :: Field
- pBlacklistedOs :: Field
- pUseExternalMipScript :: Field
- pEnabledDiskTemplates :: Field
- pEnabledUserShutdown :: Field
- pQueryWhat :: Field
- pUseLocking :: Field
- pQueryFields :: Field
- pQueryFilter :: Field
- pQueryFieldsFields :: Field
- pNodeNames :: Field
- pNodeUuids :: Field
- pOobCommand :: Field
- pOobTimeout :: Field
- pIgnoreStatus :: Field
- pPowerDelay :: Field
- pRequiredNodes :: Field
- pRequiredNodeUuids :: Field
- pRestrictedCommand :: Field
- pNodeName :: Field
- pNodeUuid :: Field
- pPrimaryIp :: Field
- pSecondaryIp :: Field
- pReadd :: Field
- pNodeGroup :: Field
- pMasterCapable :: Field
- pVmCapable :: Field
- pNdParams :: Field
- pNames :: Field
- pNodes :: Field
- pStorageType :: Field
- pOptStorageType :: Field
- pStorageName :: Field
- pStorageChanges :: Field
- pIgnoreConsistency :: Field
- pIgnoreHVVersions :: Field
- pMasterCandidate :: Field
- pOffline :: Field
- pDrained :: Field
- pAutoPromote :: Field
- pPowered :: Field
- pMigrationMode :: Field
- pMigrationLive :: Field
- pMigrationTargetNode :: Field
- pMigrationTargetNodeUuid :: Field
- pAllowRuntimeChgs :: Field
- pIgnoreIpolicy :: Field
- pIallocator :: Field
- pEarlyRelease :: Field
- pRemoteNode :: Field
- pRemoteNodeUuid :: Field
- pEvacMode :: Field
- pIgnoreSoftErrors :: Field
- pInstanceName :: Field
- pInstanceCommunication :: Field
- pOptInstanceCommunication :: Field
- pForceVariant :: Field
- pWaitForSync :: Field
- pNameCheck :: Field
- pInstBeParams :: Field
- pInstDisks :: Field
- pDiskTemplate :: Field
- pExtParams :: Field
- pFileDriver :: Field
- pFileStorageDir :: Field
- pInstHvParams :: Field
- pHypervisor :: Field
- pResetDefaults :: Field
- pIpCheck :: Field
- pIpConflictsCheck :: Field
- pInstCreateMode :: Field
- pInstNics :: Field
- pNoInstall :: Field
- pInstOs :: Field
- pInstOsParams :: Field
- pInstOsParamsPrivate :: Field
- pInstOsParamsSecret :: Field
- pPrimaryNode :: Field
- pPrimaryNodeUuid :: Field
- pSecondaryNode :: Field
- pSecondaryNodeUuid :: Field
- pSourceHandshake :: Field
- pSourceInstance :: Field
- pSourceShutdownTimeout :: Field
- pSourceX509Ca :: Field
- pSrcNode :: Field
- pSrcNodeUuid :: Field
- pSrcPath :: Field
- pStartInstance :: Field
- pForthcoming :: Field
- pCommit :: Field
- pInstTags :: Field
- pMultiAllocInstances :: Field
- pOpportunisticLocking :: Field
- pInstanceUuid :: Field
- pTempOsParams :: Field
- pTempOsParamsPrivate :: Field
- pTempOsParamsSecret :: Field
- pShutdownTimeout :: Field
- pShutdownTimeout' :: Field
- pIgnoreFailures :: Field
- pNewName :: Field
- pIgnoreOfflineNodes :: Field
- pTempHvParams :: Field
- pTempBeParams :: Field
- pNoRemember :: Field
- pStartupPaused :: Field
- pIgnoreSecondaries :: Field
- pRebootType :: Field
- pReplaceDisksMode :: Field
- pReplaceDisksList :: Field
- pMigrationCleanup :: Field
- pAllowFailover :: Field
- pForceFailover :: Field
- pMoveTargetNode :: Field
- pMoveTargetNodeUuid :: Field
- pMoveCompress :: Field
- pBackupCompress :: Field
- pIgnoreDiskSize :: Field
- pWaitForSyncFalse :: Field
- pRecreateDisksInfo :: Field
- pStatic :: Field
- pInstParamsNicChanges :: Field
- pInstParamsDiskChanges :: Field
- pRuntimeMem :: Field
- pOptDiskTemplate :: Field
- pOsNameChange :: Field
- pDiskIndex :: Field
- pDiskChgAmount :: Field
- pDiskChgAbsolute :: Field
- pTargetGroups :: Field
- pNodeGroupAllocPolicy :: Field
- pGroupNodeParams :: Field
- pExportMode :: Field
- pExportTargetNode :: Field
- pExportTargetNodeUuid :: Field
- pShutdownInstance :: Field
- pRemoveInstance :: Field
- pIgnoreRemoveFailures :: Field
- pX509KeyName :: Field
- pX509DestCA :: Field
- pZeroFreeSpace :: Field
- pHelperStartupTimeout :: Field
- pHelperShutdownTimeout :: Field
- pZeroingTimeoutFixed :: Field
- pZeroingTimeoutPerMiB :: Field
- pTagsObject :: Field
- pTagsName :: Field
- pTagsList :: Field
- pTagSearchPattern :: Field
- pDelayDuration :: Field
- pDelayOnMaster :: Field
- pDelayOnNodes :: Field
- pDelayOnNodeUuids :: Field
- pDelayRepeat :: Field
- pDelayInterruptible :: Field
- pDelayNoLocks :: Field
- pIAllocatorDirection :: Field
- pIAllocatorMode :: Field
- pIAllocatorReqName :: Field
- pIAllocatorNics :: Field
- pIAllocatorDisks :: Field
- pIAllocatorMemory :: Field
- pIAllocatorVCpus :: Field
- pIAllocatorOs :: Field
- pIAllocatorInstances :: Field
- pIAllocatorEvacMode :: Field
- pIAllocatorSpindleUse :: Field
- pIAllocatorCount :: Field
- pJQueueNotifyWaitLock :: Field
- pJQueueNotifyExec :: Field
- pJQueueLogMessages :: Field
- pJQueueFail :: Field
- pTestDummyResult :: Field
- pTestDummyMessages :: Field
- pTestDummyFail :: Field
- pTestDummySubmitJobs :: Field
- pNetworkName :: Field
- pNetworkAddress4 :: Field
- pNetworkGateway4 :: Field
- pNetworkAddress6 :: Field
- pNetworkGateway6 :: Field
- pNetworkMacPrefix :: Field
- pNetworkAddRsvdIps :: Field
- pNetworkRemoveRsvdIps :: Field
- pNetworkMode :: Field
- pNetworkLink :: Field
- pAdminStateSource :: Field
- pNetworkVlan :: Field
- pEnabledDataCollectors :: Field
- pDataCollectorInterval :: Field
- pNodeSslCerts :: Field
- pSshKeyBits :: Field
- pSshKeyType :: Field
- pRenewSshKeys :: Field
- pNodeSetup :: Field
- pVerifyClutter :: Field
- pLongSleep :: Field
Helper functions and types
booleanField :: String -> Field Source #
Build a boolean field.
defaultFalse :: String -> Field Source #
Default a field to False
.
defaultTrue :: String -> Field Source #
Default a field to True
.
stringField :: String -> Field Source #
An alias for a String
field.
optionalStringField :: String -> Field Source #
An alias for an optional string field.
optionalNEStringField :: String -> Field Source #
An alias for an optional non-empty string field.
forceNonNeg :: (Num a, Ord a, Show a) => a -> NonNegative a Source #
Function to force a non-negative value, without returning via a monad. This is needed for, and should be used only in the case of forcing constants. In case the constant is wrong (< 0), this will become a runtime error.
Disks
Disk index type (embedding constraints on the index value via a smart constructor).
DiskIndex | |
|
mkDiskIndex :: MonadFail m => Int -> m DiskIndex Source #
Smart constructor for DiskIndex
.
I* param types
data DiskAccess Source #
Type holding disk access modes.
Instances
diskAccessFromRaw :: forall m. (Monad m, MonadFail m) => String -> m DiskAccess Source #
diskAccessToRaw :: DiskAccess -> String Source #
data INicParams Source #
NIC modification definition.
INicParams | |
|
Instances
loadINicParams :: JSValue -> Result INicParams Source #
saveINicParams :: INicParams -> JSValue Source #
data IDiskParams Source #
Disk modification definition.
IDiskParams | |
|
Instances
loadIDiskParams :: JSValue -> Result IDiskParams Source #
saveIDiskParams :: IDiskParams -> JSValue Source #
data RecreateDisksInfo Source #
Disk changes type for OpInstanceRecreateDisks. This is a bit strange, because the type in Python is something like Either [DiskIndex] [DiskChanges], but we can't represent the type of an empty list in JSON, so we have to add a custom case for the empty list.
RecreateDisksAll | |
RecreateDisksIndices (NonEmpty DiskIndex) | |
RecreateDisksParams (NonEmpty (DiskIndex, IDiskParams)) |
Instances
readRecreateDisks :: JSValue -> Result RecreateDisksInfo Source #
data DdmOldChanges Source #
Simple type for old-style ddm changes.
Instances
readDdmOldChanges :: JSValue -> Result DdmOldChanges Source #
data SetParamsMods a Source #
Instance disk or nic modifications.
SetParamsEmpty | |
SetParamsDeprecated (NonEmpty (DdmOldChanges, a)) | |
SetParamsNew (NonEmpty (DdmFull, Int, a)) | |
SetParamsNewName (NonEmpty (DdmFull, String, a)) |
Instances
readSetParams :: JSON a => JSValue -> Result (SetParamsMods a) Source #
Custom deserialiser for SetParamsMods
.
data ExportTarget Source #
Custom type for target_node parameter of OpBackupExport, which varies depending on mode. FIXME: this uses an [JSValue] since we don't care about individual rows (just like the Python code tests). But the proper type could be parsed if we wanted.
Instances
Eq ExportTarget # | |
Defined in Ganeti.OpParams (==) :: ExportTarget -> ExportTarget -> Bool (/=) :: ExportTarget -> ExportTarget -> Bool | |
Ord ExportTarget # | |
Defined in Ganeti.OpParams compare :: ExportTarget -> ExportTarget -> Ordering (<) :: ExportTarget -> ExportTarget -> Bool (<=) :: ExportTarget -> ExportTarget -> Bool (>) :: ExportTarget -> ExportTarget -> Bool (>=) :: ExportTarget -> ExportTarget -> Bool max :: ExportTarget -> ExportTarget -> ExportTarget min :: ExportTarget -> ExportTarget -> ExportTarget | |
Show ExportTarget # | |
Defined in Ganeti.OpParams showsPrec :: Int -> ExportTarget -> ShowS show :: ExportTarget -> String showList :: [ExportTarget] -> ShowS | |
JSON ExportTarget # | |
Defined in Ganeti.OpParams readJSON :: JSValue -> Result ExportTarget showJSON :: ExportTarget -> JSValue readJSONs :: JSValue -> Result [ExportTarget] showJSONs :: [ExportTarget] -> JSValue | |
Arbitrary ExportTarget | |
Defined in Test.Ganeti.OpCodes arbitrary :: Gen ExportTarget shrink :: ExportTarget -> [ExportTarget] |
readExportTarget :: JSValue -> Result ExportTarget Source #
Custom reader for ExportTarget
.
Common opcode parameters
pDebugLevel :: Field Source #
pOpPriority :: Field Source #
pSequential :: Field Source #
Parameters
pErrorCodes :: Field Source #
pSkipChecks :: Field Source #
pGroupName :: Field Source #
pInstances :: Field Source #
pDiskState :: Field Source #
pClusterFileStorageDir :: Field Source #
Cluster-wide default directory for storing file-backed disks.
pClusterSharedFileStorageDir :: Field Source #
Cluster-wide default directory for storing shared-file-backed disks.
pClusterGlusterStorageDir :: Field Source #
Cluster-wide default directory for storing Gluster-backed disks.
pZeroingImage :: Field Source #
The OS to use when zeroing instance disks.
pCompressionTools :: Field Source #
The additional tools that can be used to compress data in transit
pRemoveUids :: Field Source #
pModifyEtcHosts :: Field Source #
Whether to modify and keep in sync the etchosts
files of nodes.
pPreallocWipeDisks :: Field Source #
Whether to wipe disks before allocating them to instances.
pNicParams :: Field Source #
pDrbdHelper :: Field Source #
pReservedLvs :: Field Source #
pQueryWhat :: Field Source #
pUseLocking :: Field Source #
pQueryFields :: Field Source #
pQueryFilter :: Field Source #
pNodeNames :: Field Source #
pNodeUuids :: Field Source #
pOobCommand :: Field Source #
pOobTimeout :: Field Source #
pPowerDelay :: Field Source #
pPrimaryIp :: Field Source #
pSecondaryIp :: Field Source #
pNodeGroup :: Field Source #
pVmCapable :: Field Source #
pStorageType :: Field Source #
pStorageName :: Field Source #
pAutoPromote :: Field Source #
pIallocator :: Field Source #
pRemoteNode :: Field Source #
pWaitForSync :: Field Source #
pNameCheck :: Field Source #
pInstDisks :: Field Source #
pExtParams :: Field Source #
pFileDriver :: Field Source #
pHypervisor :: Field Source #
pNoInstall :: Field Source #
pPrimaryNode :: Field Source #
pSrcNodeUuid :: Field Source #
pForthcoming :: Field Source #
pShutdownTimeout' :: Field Source #
Another name for the shutdown timeout, because we like to be inconsistent.
pNoRemember :: Field Source #
pRebootType :: Field Source #
pRuntimeMem :: Field Source #
pDiskIndex :: Field Source #
pExportMode :: Field Source #
pX509KeyName :: Field Source #
pX509DestCA :: Field Source #
pTagsObject :: Field Source #
pDelayRepeat :: Field Source #
pJQueueFail :: Field Source #
pNetworkName :: Field Source #
pNetworkMode :: Field Source #
pNetworkLink :: Field Source #
pNetworkVlan :: Field Source #
pSshKeyBits :: Field Source #
pSshKeyType :: Field Source #
pNodeSetup :: Field Source #
pLongSleep :: Field Source #