ganeti-htoolsSource codeContentsIndex
Ganeti.Objects
Contents
NIC definitions
Disk definitions
Instance definitions
Node definitions
NodeGroup definitions
Cluster definitions
ConfigData definitions
Description

Implementation of the Ganeti config objects.

Some object fields are not implemented yet, and as such they are commented out below.

Synopsis
data NICMode
= NMBridged
| NMRouted
nICModeFromRaw :: forall m[a1166]. Monad m[a1166] => String -> m[a1166] NICMode
nICModeToRaw :: NICMode -> String
data PartialNICParams = PartialNICParams {
nicpModeP :: Maybe NICMode
nicpLinkP :: Maybe String
}
data FilledNICParams = FilledNICParams {
nicpMode :: NICMode
nicpLink :: String
}
fillNICParams :: FilledNICParams -> PartialNICParams -> FilledNICParams
loadPartialNICParams :: JSValue -> Result PartialNICParams
savePartialNICParams :: PartialNICParams -> JSValue
toDictPartialNICParams :: PartialNICParams -> [(String, JSValue)]
loadFilledNICParams :: JSValue -> Result FilledNICParams
saveFilledNICParams :: FilledNICParams -> JSValue
toDictFilledNICParams :: FilledNICParams -> [(String, JSValue)]
data PartialNIC = PartialNIC {
nicMac :: String
nicIp :: Maybe String
nicNicparams :: PartialNICParams
}
loadPartialNIC :: JSValue -> Result PartialNIC
savePartialNIC :: PartialNIC -> JSValue
toDictPartialNIC :: PartialNIC -> [(String, JSValue)]
data DiskMode
= DiskRdOnly
| DiskRdWr
diskModeFromRaw :: forall m[a11sX]. Monad m[a11sX] => String -> m[a11sX] DiskMode
diskModeToRaw :: DiskMode -> String
data DiskType
= LD_LV
| LD_DRBD8
| LD_FILE
| LD_BLOCKDEV
| LD_RADOS
diskTypeFromRaw :: forall m[a11zo]. Monad m[a11zo] => String -> m[a11zo] DiskType
diskTypeToRaw :: DiskType -> String
data FileDriver
= FileLoop
| FileBlktap
fileDriverFromRaw :: forall m[a11FA]. Monad m[a11FA] => String -> m[a11FA] FileDriver
fileDriverToRaw :: FileDriver -> String
data BlockDriver = BlockDrvManual
blockDriverFromRaw :: forall m[a11KZ]. Monad m[a11KZ] => String -> m[a11KZ] BlockDriver
blockDriverToRaw :: BlockDriver -> String
devType :: String
data DiskLogicalId
= LIDPlain String String
| LIDDrbd8 String String Int Int Int String
| LIDFile FileDriver String
| LIDBlockDev BlockDriver String
| LIDRados String String
lidDiskType :: DiskLogicalId -> DiskType
lidEncodeType :: DiskLogicalId -> [(String, JSValue)]
encodeDLId :: DiskLogicalId -> JSValue
encodeFullDLId :: DiskLogicalId -> (JSValue, [(String, JSValue)])
decodeDLId :: [(String, JSValue)] -> JSValue -> Result DiskLogicalId
data Disk = Disk {
diskLogicalId :: DiskLogicalId
diskChildren :: [Disk]
diskIvName :: String
diskSize :: Int
diskMode :: DiskMode
}
loadDisk :: JSValue -> Result Disk
saveDisk :: Disk -> JSValue
toDictDisk :: Disk -> [(String, JSValue)]
data DiskTemplate
= DTDiskless
| DTFile
| DTSharedFile
| DTPlain
| DTBlock
| DTDrbd8
diskTemplateFromRaw :: forall m[a12eb]. Monad m[a12eb] => String -> m[a12eb] DiskTemplate
diskTemplateToRaw :: DiskTemplate -> String
data AdminState
= AdminOffline
| AdminDown
| AdminUp
adminStateFromRaw :: forall m[a12kO]. Monad m[a12kO] => String -> m[a12kO] AdminState
adminStateToRaw :: AdminState -> String
data PartialBEParams = PartialBEParams {
bepMinmemP :: Maybe Int
bepMaxmemP :: Maybe Int
bepVcpusP :: Maybe Int
bepAutoBalanceP :: Maybe Bool
}
data FilledBEParams = FilledBEParams {
bepMinmem :: Int
bepMaxmem :: Int
bepVcpus :: Int
bepAutoBalance :: Bool
}
fillBEParams :: FilledBEParams -> PartialBEParams -> FilledBEParams
loadPartialBEParams :: JSValue -> Result PartialBEParams
savePartialBEParams :: PartialBEParams -> JSValue
toDictPartialBEParams :: PartialBEParams -> [(String, JSValue)]
loadFilledBEParams :: JSValue -> Result FilledBEParams
saveFilledBEParams :: FilledBEParams -> JSValue
toDictFilledBEParams :: FilledBEParams -> [(String, JSValue)]
data Instance = Instance {
instName :: String
instPrimaryNode :: String
instOs :: String
instHypervisor :: String
instBeparams :: PartialBEParams
instAdminState :: AdminState
instNics :: [PartialNIC]
instDisks :: [Disk]
instDiskTemplate :: DiskTemplate
instNetworkPort :: Maybe Int
instCtime :: Double
instMtime :: Double
instUuid :: String
instSerial :: Int
}
loadInstance :: JSValue -> Result Instance
saveInstance :: Instance -> JSValue
toDictInstance :: Instance -> [(String, JSValue)]
data PartialNDParams = PartialNDParams {
ndpOobProgramP :: Maybe String
}
data FilledNDParams = FilledNDParams {
ndpOobProgram :: String
}
fillNDParams :: FilledNDParams -> PartialNDParams -> FilledNDParams
loadPartialNDParams :: JSValue -> Result PartialNDParams
savePartialNDParams :: PartialNDParams -> JSValue
toDictPartialNDParams :: PartialNDParams -> [(String, JSValue)]
loadFilledNDParams :: JSValue -> Result FilledNDParams
saveFilledNDParams :: FilledNDParams -> JSValue
toDictFilledNDParams :: FilledNDParams -> [(String, JSValue)]
data Node = Node {
nodeName :: String
nodePrimaryIp :: String
nodeSecondaryIp :: String
nodeMasterCandidate :: Bool
nodeOffline :: Bool
nodeDrained :: Bool
nodeGroup :: String
nodeMasterCapable :: Bool
nodeVmCapable :: Bool
nodePowered :: Bool
nodeCtime :: Double
nodeMtime :: Double
nodeUuid :: String
nodeSerial :: Int
}
loadNode :: JSValue -> Result Node
saveNode :: Node -> JSValue
toDictNode :: Node -> [(String, JSValue)]
data AllocPolicy
= AllocPreferred
| AllocLastResort
| AllocUnallocable
allocPolicyFromRaw :: forall m[a13pZ]. Monad m[a13pZ] => String -> m[a13pZ] AllocPolicy
allocPolicyToRaw :: AllocPolicy -> String
data NodeGroup = NodeGroup {
groupName :: String
groupMembers :: [String]
groupAllocPolicy :: AllocPolicy
groupCtime :: Double
groupMtime :: Double
groupUuid :: String
groupSerial :: Int
}
loadNodeGroup :: JSValue -> Result NodeGroup
saveNodeGroup :: NodeGroup -> JSValue
toDictNodeGroup :: NodeGroup -> [(String, JSValue)]
data Cluster = Cluster {
clusterRsahostkeypub :: String
clusterHighestUsedPort :: Int
clusterTcpudpPortPool :: [Int]
clusterMacPrefix :: String
clusterVolumeGroupName :: String
clusterReservedLvs :: [String]
clusterMasterNode :: String
clusterMasterIp :: String
clusterMasterNetdev :: String
clusterClusterName :: String
clusterFileStorageDir :: String
clusterEnabledHypervisors :: [String]
clusterBeparams :: Container FilledBEParams
clusterNicparams :: Container FilledNICParams
clusterCandidatePoolSize :: Int
clusterModifyEtcHosts :: Bool
clusterModifySshSetup :: Bool
clusterMaintainNodeHealth :: Bool
clusterUidPool :: [Int]
clusterDefaultIallocator :: String
clusterHiddenOs :: [String]
clusterBlacklistedOs :: [String]
clusterPrimaryIpFamily :: Int
clusterPreallocWipeDisks :: Bool
clusterSerial :: Int
}
loadCluster :: JSValue -> Result Cluster
saveCluster :: Cluster -> JSValue
toDictCluster :: Cluster -> [(String, JSValue)]
data ConfigData = ConfigData {
configVersion :: Int
configCluster :: Cluster
configNodes :: Container Node
configNodegroups :: Container NodeGroup
configInstances :: Container Instance
configSerial :: Int
}
loadConfigData :: JSValue -> Result ConfigData
saveConfigData :: ConfigData -> JSValue
toDictConfigData :: ConfigData -> [(String, JSValue)]
NIC definitions
data NICMode Source
Constructors
NMBridged
NMRouted
nICModeFromRaw :: forall m[a1166]. Monad m[a1166] => String -> m[a1166] NICModeSource
nICModeToRaw :: NICMode -> StringSource
data PartialNICParams Source
Constructors
PartialNICParams
nicpModeP :: Maybe NICMode
nicpLinkP :: Maybe String
data FilledNICParams Source
Constructors
FilledNICParams
nicpMode :: NICMode
nicpLink :: String
fillNICParams :: FilledNICParams -> PartialNICParams -> FilledNICParamsSource
loadPartialNICParams :: JSValue -> Result PartialNICParamsSource
savePartialNICParams :: PartialNICParams -> JSValueSource
toDictPartialNICParams :: PartialNICParams -> [(String, JSValue)]Source
loadFilledNICParams :: JSValue -> Result FilledNICParamsSource
saveFilledNICParams :: FilledNICParams -> JSValueSource
toDictFilledNICParams :: FilledNICParams -> [(String, JSValue)]Source
data PartialNIC Source
Constructors
PartialNIC
nicMac :: String
nicIp :: Maybe String
nicNicparams :: PartialNICParams
loadPartialNIC :: JSValue -> Result PartialNICSource
savePartialNIC :: PartialNIC -> JSValueSource
toDictPartialNIC :: PartialNIC -> [(String, JSValue)]Source
Disk definitions
data DiskMode Source
Constructors
DiskRdOnly
DiskRdWr
diskModeFromRaw :: forall m[a11sX]. Monad m[a11sX] => String -> m[a11sX] DiskModeSource
diskModeToRaw :: DiskMode -> StringSource
data DiskType Source
Constructors
LD_LV
LD_DRBD8
LD_FILE
LD_BLOCKDEV
LD_RADOS
diskTypeFromRaw :: forall m[a11zo]. Monad m[a11zo] => String -> m[a11zo] DiskTypeSource
diskTypeToRaw :: DiskType -> StringSource
data FileDriver Source
The file driver type.
Constructors
FileLoop
FileBlktap
fileDriverFromRaw :: forall m[a11FA]. Monad m[a11FA] => String -> m[a11FA] FileDriverSource
fileDriverToRaw :: FileDriver -> StringSource
data BlockDriver Source
The persistent block driver type. Currently only one type is allowed.
Constructors
BlockDrvManual
blockDriverFromRaw :: forall m[a11KZ]. Monad m[a11KZ] => String -> m[a11KZ] BlockDriverSource
blockDriverToRaw :: BlockDriver -> StringSource
devType :: StringSource
Constant for the dev_type key entry in the disk config.
data DiskLogicalId Source
The disk configuration type. This includes the disk type itself, for a more complete consistency. Note that since in the Python code-base there's no authoritative place where we document the logical id, this is probably a good reference point.
Constructors
LIDPlain String StringVolume group, logical volume
LIDDrbd8 String String Int Int Int StringNodeA, NodeB, Port, MinorA, MinorB, Secret
LIDFile FileDriver StringDriver, path
LIDBlockDev BlockDriver StringDriver, path (must be under /dev)
LIDRados String StringUnused, path
lidDiskType :: DiskLogicalId -> DiskTypeSource
Mapping from a logical id to a disk type.
lidEncodeType :: DiskLogicalId -> [(String, JSValue)]Source
Builds the extra disk_type field for a given logical id.
encodeDLId :: DiskLogicalId -> JSValueSource
Custom encoder for DiskLogicalId (logical id only).
encodeFullDLId :: DiskLogicalId -> (JSValue, [(String, JSValue)])Source
Custom encoder for DiskLogicalId, composing both the logical id and the extra disk_type field.
decodeDLId :: [(String, JSValue)] -> JSValue -> Result DiskLogicalIdSource
Custom decoder for DiskLogicalId. This is manual for now, since we don't have yet automation for separate-key style fields.
data Disk Source

Disk data structure.

This is declared manually as it's a recursive structure, and our TH code currently can't build it.

Constructors
Disk
diskLogicalId :: DiskLogicalId
diskChildren :: [Disk]
diskIvName :: String
diskSize :: Int
diskMode :: DiskMode
loadDisk :: JSValue -> Result DiskSource
saveDisk :: Disk -> JSValueSource
toDictDisk :: Disk -> [(String, JSValue)]Source
Instance definitions
data DiskTemplate Source
Instance disk template type. **Copied from HTools/Types.hs**
Constructors
DTDiskless
DTFile
DTSharedFile
DTPlain
DTBlock
DTDrbd8
diskTemplateFromRaw :: forall m[a12eb]. Monad m[a12eb] => String -> m[a12eb] DiskTemplateSource
diskTemplateToRaw :: DiskTemplate -> StringSource
data AdminState Source
Constructors
AdminOffline
AdminDown
AdminUp
adminStateFromRaw :: forall m[a12kO]. Monad m[a12kO] => String -> m[a12kO] AdminStateSource
adminStateToRaw :: AdminState -> StringSource
data PartialBEParams Source
Constructors
PartialBEParams
bepMinmemP :: Maybe Int
bepMaxmemP :: Maybe Int
bepVcpusP :: Maybe Int
bepAutoBalanceP :: Maybe Bool
data FilledBEParams Source
Constructors
FilledBEParams
bepMinmem :: Int
bepMaxmem :: Int
bepVcpus :: Int
bepAutoBalance :: Bool
fillBEParams :: FilledBEParams -> PartialBEParams -> FilledBEParamsSource
loadPartialBEParams :: JSValue -> Result PartialBEParamsSource
savePartialBEParams :: PartialBEParams -> JSValueSource
toDictPartialBEParams :: PartialBEParams -> [(String, JSValue)]Source
loadFilledBEParams :: JSValue -> Result FilledBEParamsSource
saveFilledBEParams :: FilledBEParams -> JSValueSource
toDictFilledBEParams :: FilledBEParams -> [(String, JSValue)]Source
data Instance Source
Constructors
Instance
instName :: String
instPrimaryNode :: String
instOs :: String
instHypervisor :: String
instBeparams :: PartialBEParams
instAdminState :: AdminState
instNics :: [PartialNIC]
instDisks :: [Disk]
instDiskTemplate :: DiskTemplate
instNetworkPort :: Maybe Int
instCtime :: Double
instMtime :: Double
instUuid :: String
instSerial :: Int
loadInstance :: JSValue -> Result InstanceSource
saveInstance :: Instance -> JSValueSource
toDictInstance :: Instance -> [(String, JSValue)]Source
Node definitions
data PartialNDParams Source
Constructors
PartialNDParams
ndpOobProgramP :: Maybe String
data FilledNDParams Source
Constructors
FilledNDParams
ndpOobProgram :: String
fillNDParams :: FilledNDParams -> PartialNDParams -> FilledNDParamsSource
loadPartialNDParams :: JSValue -> Result PartialNDParamsSource
savePartialNDParams :: PartialNDParams -> JSValueSource
toDictPartialNDParams :: PartialNDParams -> [(String, JSValue)]Source
loadFilledNDParams :: JSValue -> Result FilledNDParamsSource
saveFilledNDParams :: FilledNDParams -> JSValueSource
toDictFilledNDParams :: FilledNDParams -> [(String, JSValue)]Source
data Node Source
Constructors
Node
nodeName :: String
nodePrimaryIp :: String
nodeSecondaryIp :: String
nodeMasterCandidate :: Bool
nodeOffline :: Bool
nodeDrained :: Bool
nodeGroup :: String
nodeMasterCapable :: Bool
nodeVmCapable :: Bool
nodePowered :: Bool
nodeCtime :: Double
nodeMtime :: Double
nodeUuid :: String
nodeSerial :: Int
loadNode :: JSValue -> Result NodeSource
saveNode :: Node -> JSValueSource
toDictNode :: Node -> [(String, JSValue)]Source
NodeGroup definitions
data AllocPolicy Source

The Group allocation policy type.

Note that the order of constructors is important as the automatic Ord instance will order them in the order they are defined, so when changing this data type be careful about the interaction with the desired sorting order.

FIXME: COPIED from Types.hs; we need to eliminate this duplication later

Constructors
AllocPreferred
AllocLastResort
AllocUnallocable
allocPolicyFromRaw :: forall m[a13pZ]. Monad m[a13pZ] => String -> m[a13pZ] AllocPolicySource
allocPolicyToRaw :: AllocPolicy -> StringSource
data NodeGroup Source
Constructors
NodeGroup
groupName :: String
groupMembers :: [String]
groupAllocPolicy :: AllocPolicy
groupCtime :: Double
groupMtime :: Double
groupUuid :: String
groupSerial :: Int
loadNodeGroup :: JSValue -> Result NodeGroupSource
saveNodeGroup :: NodeGroup -> JSValueSource
toDictNodeGroup :: NodeGroup -> [(String, JSValue)]Source
Cluster definitions
data Cluster Source
Constructors
Cluster
clusterRsahostkeypub :: String
clusterHighestUsedPort :: Int
clusterTcpudpPortPool :: [Int]
clusterMacPrefix :: String
clusterVolumeGroupName :: String
clusterReservedLvs :: [String]
clusterMasterNode :: String
clusterMasterIp :: String
clusterMasterNetdev :: String
clusterClusterName :: String
clusterFileStorageDir :: String
clusterEnabledHypervisors :: [String]
clusterBeparams :: Container FilledBEParams
clusterNicparams :: Container FilledNICParams
clusterCandidatePoolSize :: Int
clusterModifyEtcHosts :: Bool
clusterModifySshSetup :: Bool
clusterMaintainNodeHealth :: Bool
clusterUidPool :: [Int]
clusterDefaultIallocator :: String
clusterHiddenOs :: [String]
clusterBlacklistedOs :: [String]
clusterPrimaryIpFamily :: Int
clusterPreallocWipeDisks :: Bool
clusterSerial :: Int
loadCluster :: JSValue -> Result ClusterSource
saveCluster :: Cluster -> JSValueSource
toDictCluster :: Cluster -> [(String, JSValue)]Source
ConfigData definitions
data ConfigData Source
Constructors
ConfigData
configVersion :: Int
configCluster :: Cluster
configNodes :: Container Node
configNodegroups :: Container NodeGroup
configInstances :: Container Instance
configSerial :: Int
loadConfigData :: JSValue -> Result ConfigDataSource
saveConfigData :: ConfigData -> JSValueSource
toDictConfigData :: ConfigData -> [(String, JSValue)]Source
Produced by Haddock version 2.6.0