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 NonEmptyString
- inicBridge :: Maybe NonEmptyString
- loadINicParams :: JSValue -> Result INicParams
- saveINicParams :: INicParams -> JSValue
- toDictINicParams :: INicParams -> [(String, JSValue)]
- data IDiskParams = IDiskParams {
- idiskSize :: Maybe Int
- idiskMode :: Maybe DiskAccess
- idiskAdopt :: Maybe NonEmptyString
- idiskVg :: Maybe NonEmptyString
- idiskMetavg :: Maybe NonEmptyString
- idiskName :: Maybe NonEmptyString
- loadIDiskParams :: JSValue -> Result IDiskParams
- saveIDiskParams :: IDiskParams -> JSValue
- toDictIDiskParams :: IDiskParams -> [(String, 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))
- 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
- pOptGroupName :: Field
- pGroupName :: Field
- pHotplug :: Field
- pHotplugIfPossible :: Field
- pInstances :: Field
- pOutputFields :: Field
- pName :: Field
- pForce :: Field
- pHvState :: Field
- pDiskState :: Field
- pClusterFileStorageDir :: Field
- pClusterSharedFileStorageDir :: Field
- pVgName :: Field
- pEnabledHypervisors :: Field
- pClusterHvParams :: Field
- pClusterBeParams :: Field
- pOsHvp :: Field
- pClusterOsParams :: Field
- pDiskParams :: Field
- pCandidatePoolSize :: Field
- pUidPool :: Field
- pAddUids :: Field
- pRemoveUids :: Field
- pMaintainNodeHealth :: Field
- pModifyEtcHosts :: Field
- pPreallocWipeDisks :: Field
- pNicParams :: Field
- pIpolicy :: Field
- pDrbdHelper :: Field
- pDefaultIAllocator :: Field
- pMasterNetdev :: Field
- pMasterNetmask :: Field
- pReservedLvs :: Field
- pHiddenOs :: Field
- pBlacklistedOs :: Field
- pUseExternalMipScript :: Field
- pEnabledDiskTemplates :: 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
- pStorageTypeOptional :: Field
- pStorageName :: Field
- pStorageChanges :: Field
- pIgnoreConsistency :: 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
- pInstanceName :: Field
- pForceVariant :: Field
- pWaitForSync :: Field
- pNameCheck :: Field
- pInstBeParams :: Field
- pInstDisks :: Field
- pDiskTemplate :: 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
- pPrimaryNode :: Field
- pPrimaryNodeUuid :: Field
- pSecondaryNode :: Field
- pSecondaryNodeUuid :: Field
- pSourceHandshake :: Field
- pSourceInstance :: Field
- pSourceShutdownTimeout :: Field
- pSourceX509Ca :: Field
- pSrcNode :: Field
- pSrcNodeUuid :: Field
- pSrcPath :: Field
- pStartInstance :: Field
- pInstTags :: Field
- pMultiAllocInstances :: Field
- pOpportunisticLocking :: Field
- pInstanceUuid :: Field
- pTempOsParams :: 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
- 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
- pTagsObject :: Field
- pTagsName :: Field
- pTagsList :: Field
- pTagSearchPattern :: Field
- pDelayDuration :: Field
- pDelayOnMaster :: Field
- pDelayOnNodes :: Field
- pDelayOnNodeUuids :: Field
- pDelayRepeat :: 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
- pNetworkVlan :: 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 | |
Show INicParams | |
Arbitrary INicParams | |
JSON INicParams | |
PyValue INicParams |
loadINicParams :: JSValue -> Result INicParamsSource
saveINicParams :: INicParams -> JSValueSource
toDictINicParams :: INicParams -> [(String, JSValue)]Source
data IDiskParams Source
Disk modification definition. FIXME: disksize should be VTYPE_UNIT.
IDiskParams | |
|
Eq IDiskParams | |
Show IDiskParams | |
Arbitrary IDiskParams | |
JSON IDiskParams | |
PyValue IDiskParams |
loadIDiskParams :: JSValue -> Result IDiskParamsSource
saveIDiskParams :: IDiskParams -> JSValueSource
toDictIDiskParams :: IDiskParams -> [(String, 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)) |
Eq 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 | |
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)) |
Eq a => Eq (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 | |
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.
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.