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.
- 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 :: Monad m => Int -> m DiskIndex
- data DiskAccess
- diskAccessFromRaw :: forall m. Monad 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 -> FieldSource
defaultFalse :: String -> FieldSource
defaultTrue :: String -> FieldSource
stringField :: String -> FieldSource
optionalStringField :: String -> FieldSource
optionalNEStringField :: String -> FieldSource
forceNonNeg :: (Num a, Ord a, Show a) => a -> NonNegative aSource
Disks
Disk index type (embedding constraints on the index value via a smart constructor).
DiskIndex | |
|
mkDiskIndex :: Monad m => Int -> m DiskIndexSource
Smart constructor for DiskIndex
.
I* param types
data DiskAccess Source
Type holding disk access modes.
Bounded DiskAccess | |
Enum DiskAccess | |
Eq DiskAccess | |
Ord DiskAccess | |
Show DiskAccess | |
Arbitrary DiskAccess | |
JSON DiskAccess |
diskAccessFromRaw :: forall m. Monad m => String -> m DiskAccessSource
diskAccessToRaw :: DiskAccess -> StringSource
data INicParams Source
NIC modification definition.
INicParams | |
|
Eq INicParams | |
Ord INicParams | |
Show INicParams | |
Arbitrary INicParams | |
JSON INicParams | |
ArrayObject INicParams | |
DictObject INicParams | |
PyValue INicParams |
loadINicParams :: JSValue -> Result INicParamsSource
saveINicParams :: INicParams -> JSValueSource
data IDiskParams Source
Disk modification definition.
IDiskParams | |
|
Eq IDiskParams | |
Ord IDiskParams | |
Show IDiskParams | |
Arbitrary IDiskParams | |
JSON IDiskParams | |
ArrayObject IDiskParams | |
DictObject IDiskParams | |
PyValue IDiskParams |
loadIDiskParams :: JSValue -> Result IDiskParamsSource
saveIDiskParams :: IDiskParams -> JSValueSource
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)) |
Eq RecreateDisksInfo | |
Ord RecreateDisksInfo | |
Show RecreateDisksInfo | |
Arbitrary RecreateDisksInfo | |
JSON RecreateDisksInfo | |
PyValue RecreateDisksInfo |
readRecreateDisks :: JSValue -> Result RecreateDisksInfoSource
data DdmOldChanges Source
Simple type for old-style ddm changes.
Eq DdmOldChanges | |
Ord DdmOldChanges | |
Show DdmOldChanges | |
Arbitrary DdmOldChanges | |
JSON DdmOldChanges |
readDdmOldChanges :: JSValue -> Result DdmOldChangesSource
data SetParamsMods a Source
Instance disk or nic modifications.
SetParamsEmpty | |
SetParamsDeprecated (NonEmpty (DdmOldChanges, a)) | |
SetParamsNew (NonEmpty (DdmFull, Int, a)) | |
SetParamsNewName (NonEmpty (DdmFull, String, a)) |
Eq a => Eq (SetParamsMods a) | |
Ord a => Ord (SetParamsMods a) | |
Show a => Show (SetParamsMods a) | |
Arbitrary a => Arbitrary (SetParamsMods a) | |
JSON a => JSON (SetParamsMods a) | |
PyValue a => PyValue (SetParamsMods a) |
readSetParams :: JSON a => JSValue -> Result (SetParamsMods a)Source
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.
Eq ExportTarget | |
Ord ExportTarget | |
Show ExportTarget | |
Arbitrary ExportTarget | |
JSON ExportTarget |
readExportTarget :: JSValue -> Result ExportTargetSource
Common opcode parameters
Parameters
pClusterFileStorageDir :: FieldSource
Cluster-wide default directory for storing file-backed disks.
pClusterSharedFileStorageDir :: FieldSource
Cluster-wide default directory for storing shared-file-backed disks.
pClusterGlusterStorageDir :: FieldSource
Cluster-wide default directory for storing Gluster-backed disks.
The OS to use when zeroing instance disks.
pCompressionTools :: FieldSource
The additional tools that can be used to compress data in transit
pModifyEtcHosts :: FieldSource
Whether to modify and keep in sync the etchosts
files of nodes.
pPreallocWipeDisks :: FieldSource
Whether to wipe disks before allocating them to instances.
pShutdownTimeout' :: FieldSource
Another name for the shutdown timeout, because we like to be inconsistent.