Safe Haskell | None |
---|
Implementation of the Ganeti config objects.
- fillDict :: Ord k => Map k v -> Map k v -> [k] -> Map k v
- data Ip4Address = Ip4Address Word8 Word8 Word8 Word8
- mkIp4Address :: (Word8, Word8, Word8, Word8) -> Ip4Address
- readIp4Address :: (Applicative m, Monad m) => String -> m Ip4Address
- ip4AddressToList :: Ip4Address -> [Word8]
- ip4AddressToNumber :: Ip4Address -> Integer
- ip4AddressFromNumber :: Integer -> Ip4Address
- nextIp4Address :: Ip4Address -> Ip4Address
- data Ip4Network = Ip4Network {
- ip4netAddr :: Ip4Address
- ip4netMask :: Word8
- mkIp4Network :: Ip4Address -> Word8 -> Ip4Network
- newtype AddressPool = AddressPool {}
- data Network = Network {
- networkName :: NonEmptyString
- networkMacPrefix :: Maybe String
- networkNetwork :: Ip4Network
- networkNetwork6 :: Maybe String
- networkGateway :: Maybe Ip4Address
- networkGateway6 :: Maybe String
- networkReservations :: Maybe AddressPool
- networkExtReservations :: Maybe AddressPool
- networkUuid :: ByteString
- networkCtime :: ClockTime
- networkMtime :: ClockTime
- networkSerial :: Int
- networkTags :: TagSet
- loadNetwork :: JSValue -> Result Network
- saveNetwork :: Network -> JSValue
- type MicroSeconds = Integer
- data DataCollectorConfig = DataCollectorConfig {}
- loadDataCollectorConfig :: JSValue -> Result DataCollectorConfig
- saveDataCollectorConfig :: DataCollectorConfig -> JSValue
- data FilledISpecParams = FilledISpecParams {
- ispecMemorySize :: Int
- ispecDiskSize :: Int
- ispecDiskCount :: Int
- ispecCpuCount :: Int
- ispecNicCount :: Int
- ispecSpindleUse :: Int
- data PartialISpecParams = PartialISpecParams {
- ispecMemorySizeP :: Maybe Int
- ispecDiskSizeP :: Maybe Int
- ispecDiskCountP :: Maybe Int
- ispecCpuCountP :: Maybe Int
- ispecNicCountP :: Maybe Int
- ispecSpindleUseP :: Maybe Int
- allISpecParamFields :: [String]
- loadPartialISpecParams :: JSValue -> Result PartialISpecParams
- savePartialISpecParams :: PartialISpecParams -> JSValue
- loadFilledISpecParams :: JSValue -> Result FilledISpecParams
- saveFilledISpecParams :: FilledISpecParams -> JSValue
- data MinMaxISpecs = MinMaxISpecs {}
- loadMinMaxISpecs :: JSValue -> Result MinMaxISpecs
- saveMinMaxISpecs :: MinMaxISpecs -> JSValue
- data PartialIPolicy = PartialIPolicy {
- ipolicyMinMaxISpecsP :: Maybe [MinMaxISpecs]
- ipolicyStdSpecP :: Maybe PartialISpecParams
- ipolicySpindleRatioP :: Maybe Double
- ipolicyMemoryRatioP :: Maybe Double
- ipolicyVcpuRatioP :: Maybe Double
- ipolicyDiskTemplatesP :: Maybe [DiskTemplate]
- loadPartialIPolicy :: JSValue -> Result PartialIPolicy
- savePartialIPolicy :: PartialIPolicy -> JSValue
- data FilledIPolicy = FilledIPolicy {
- ipolicyMinMaxISpecs :: [MinMaxISpecs]
- ipolicyStdSpec :: FilledISpecParams
- ipolicySpindleRatio :: Double
- ipolicyMemoryRatio :: Double
- ipolicyVcpuRatio :: Double
- ipolicyDiskTemplates :: [DiskTemplate]
- loadFilledIPolicy :: JSValue -> Result FilledIPolicy
- saveFilledIPolicy :: FilledIPolicy -> JSValue
- type DiskState = Container JSValue
- data FilledNDParams = FilledNDParams {
- ndpOobProgram :: String
- ndpSpindleCount :: Int
- ndpExclusiveStorage :: Bool
- ndpOvs :: Bool
- ndpOvsName :: String
- ndpOvsLink :: String
- ndpSshPort :: Int
- ndpCpuSpeed :: Double
- data PartialNDParams = PartialNDParams {
- ndpOobProgramP :: Maybe String
- ndpSpindleCountP :: Maybe Int
- ndpExclusiveStorageP :: Maybe Bool
- ndpOvsP :: Maybe Bool
- ndpOvsNameP :: Maybe String
- ndpOvsLinkP :: Maybe String
- ndpSshPortP :: Maybe Int
- ndpCpuSpeedP :: Maybe Double
- allNDParamFields :: [String]
- loadPartialNDParams :: JSValue -> Result PartialNDParams
- savePartialNDParams :: PartialNDParams -> JSValue
- loadFilledNDParams :: JSValue -> Result FilledNDParams
- saveFilledNDParams :: FilledNDParams -> JSValue
- data Node = Node {
- nodeName :: String
- nodePrimaryIp :: String
- nodeSecondaryIp :: String
- nodeMasterCandidate :: Bool
- nodeOffline :: Bool
- nodeDrained :: Bool
- nodeGroup :: String
- nodeMasterCapable :: Bool
- nodeVmCapable :: Bool
- nodeNdparams :: PartialNDParams
- nodePowered :: Bool
- nodeHvStateStatic :: PartialHvState
- nodeDiskStateStatic :: DiskState
- nodeCtime :: ClockTime
- nodeMtime :: ClockTime
- nodeUuid :: ByteString
- nodeSerial :: Int
- nodeTags :: TagSet
- loadNode :: JSValue -> Result Node
- saveNode :: Node -> JSValue
- type GroupDiskParams = Container DiskParams
- type Networks = Container PartialNicParams
- data NodeGroup = NodeGroup {
- groupName :: String
- groupMembers :: [String]
- groupNdparams :: PartialNDParams
- groupAllocPolicy :: AllocPolicy
- groupIpolicy :: PartialIPolicy
- groupDiskparams :: GroupDiskParams
- groupNetworks :: Networks
- groupHvStateStatic :: PartialHvState
- groupDiskStateStatic :: DiskState
- groupCtime :: ClockTime
- groupMtime :: ClockTime
- groupUuid :: ByteString
- groupSerial :: Int
- groupTags :: TagSet
- loadNodeGroup :: JSValue -> Result NodeGroup
- saveNodeGroup :: NodeGroup -> JSValue
- data FilterAction
- data FilterPredicate
- = FPJobId (Filter FilterField)
- | FPOpCode (Filter FilterField)
- | FPReason (Filter FilterField)
- data FilterRule = FilterRule {
- frWatermark :: JobId
- frPriority :: NonNegative Int
- frPredicates :: [FilterPredicate]
- frAction :: FilterAction
- frReasonTrail :: ReasonTrail
- frUuid :: ByteString
- loadFilterRule :: JSValue -> Result FilterRule
- saveFilterRule :: FilterRule -> JSValue
- filterRuleOrder :: FilterRule -> FilterRule -> Ordering
- data IpFamily
- = IpFamilyV4
- | IpFamilyV6
- ipFamilyFromRaw :: forall m. Monad m => Int -> m IpFamily
- ipFamilyToRaw :: IpFamily -> Int
- ipFamilyToVersion :: IpFamily -> Int
- type ClusterHvParams = GenericContainer Hypervisor HvParams
- type OsHvParams = Container ClusterHvParams
- type ClusterBeParams = Container FilledBeParams
- type ClusterOsParams = Container OsParams
- type ClusterOsParamsPrivate = Container (Private OsParams)
- type ClusterNicParams = Container FilledNicParams
- type UidRange = (Int, Int)
- formatUidRange :: UidRange -> String
- type UidPool = [UidRange]
- type IAllocatorParams = Container JSValue
- type CandidateCertificates = Container String
- data Cluster = Cluster {
- clusterRsahostkeypub :: String
- clusterDsahostkeypub :: Maybe String
- clusterHighestUsedPort :: Int
- clusterTcpudpPortPool :: [Int]
- clusterMacPrefix :: String
- clusterVolumeGroupName :: Maybe String
- clusterReservedLvs :: [String]
- clusterDrbdUsermodeHelper :: Maybe String
- clusterMasterNode :: String
- clusterMasterIp :: String
- clusterMasterNetdev :: String
- clusterMasterNetmask :: Int
- clusterUseExternalMipScript :: Bool
- clusterClusterName :: String
- clusterFileStorageDir :: String
- clusterSharedFileStorageDir :: String
- clusterGlusterStorageDir :: String
- clusterEnabledHypervisors :: [Hypervisor]
- clusterHvparams :: ClusterHvParams
- clusterOsHvp :: OsHvParams
- clusterBeparams :: ClusterBeParams
- clusterOsparams :: ClusterOsParams
- clusterOsparamsPrivateCluster :: ClusterOsParamsPrivate
- clusterNicparams :: ClusterNicParams
- clusterNdparams :: FilledNDParams
- clusterDiskparams :: GroupDiskParams
- clusterCandidatePoolSize :: Int
- clusterModifyEtcHosts :: Bool
- clusterModifySshSetup :: Bool
- clusterMaintainNodeHealth :: Bool
- clusterUidPool :: UidPool
- clusterDefaultIallocator :: String
- clusterDefaultIallocatorParams :: IAllocatorParams
- clusterHiddenOs :: [String]
- clusterBlacklistedOs :: [String]
- clusterPrimaryIpFamily :: IpFamily
- clusterPreallocWipeDisks :: Bool
- clusterIpolicy :: FilledIPolicy
- clusterHvStateStatic :: FilledHvState
- clusterDiskStateStatic :: DiskState
- clusterEnabledDiskTemplates :: [DiskTemplate]
- clusterCandidateCerts :: CandidateCertificates
- clusterMaxRunningJobs :: Int
- clusterMaxTrackedJobs :: Int
- clusterInstallImage :: String
- clusterInstanceCommunicationNetwork :: String
- clusterZeroingImage :: String
- clusterCompressionTools :: [String]
- clusterEnabledUserShutdown :: Bool
- clusterDataCollectors :: Container DataCollectorConfig
- clusterDiagnoseDataCollectorFilename :: String
- clusterSshKeyType :: SshKeyType
- clusterSshKeyBits :: Int
- clusterCtime :: ClockTime
- clusterMtime :: ClockTime
- clusterUuid :: ByteString
- clusterSerial :: Int
- clusterTags :: TagSet
- loadCluster :: JSValue -> Result Cluster
- saveCluster :: Cluster -> JSValue
- data ConfigData = ConfigData {
- configVersion :: Int
- configCluster :: Cluster
- configNodes :: Container Node
- configNodegroups :: Container NodeGroup
- configInstances :: Container Instance
- configNetworks :: Container Network
- configDisks :: Container Disk
- configFilters :: Container FilterRule
- configMaintenance :: MaintenanceData
- configCtime :: ClockTime
- configMtime :: ClockTime
- configSerial :: Int
- loadConfigData :: JSValue -> Result ConfigData
- saveConfigData :: ConfigData -> JSValue
- data MasterNetworkParameters = MasterNetworkParameters {
- masterNetworkParametersUuid :: String
- masterNetworkParametersIp :: String
- masterNetworkParametersNetmask :: Int
- masterNetworkParametersNetdev :: String
- masterNetworkParametersIpFamily :: IpFamily
- loadMasterNetworkParameters :: JSValue -> Result MasterNetworkParameters
- saveMasterNetworkParameters :: MasterNetworkParameters -> JSValue
Generic definitions
fillDict :: Ord k => Map k v -> Map k v -> [k] -> Map k vSource
Fills one map with keys from the other map, if not already existing. Mirrors objects.py:FillDict.
Network definitions
Ipv4 types
data Ip4Address Source
Ip4Address Word8 Word8 Word8 Word8 |
Eq Ip4Address | |
Ord Ip4Address | |
Show Ip4Address | |
IsString Ip4Address | IsString instance for |
JSON Ip4Address | |
Arbitrary Ip4Address |
mkIp4Address :: (Word8, Word8, Word8, Word8) -> Ip4AddressSource
readIp4Address :: (Applicative m, Monad m) => String -> m Ip4AddressSource
ip4AddressToList :: Ip4Address -> [Word8]Source
ip4AddressToNumber :: Ip4Address -> IntegerSource
Converts an address into its ordinal number. This is needed for indexing IP adresses in reservation pools.
ip4AddressFromNumber :: Integer -> Ip4AddressSource
Converts a number into an address. This is needed for indexing IP adresses in reservation pools.
data Ip4Network Source
Custom type for an IPv4 network.
Ip4Network | |
|
Eq Ip4Network | |
Show Ip4Network | |
JSON Ip4Network | JSON instance for |
Arbitrary Ip4Network |
mkIp4Network :: Ip4Address -> Word8 -> Ip4NetworkSource
Address pools
newtype AddressPool Source
Currently address pools just wrap a reservation BitArray
.
In future, Network
might be extended to include several address pools
and address pools might include their own ranges of addresses.
Eq AddressPool | |
Ord AddressPool | |
Show AddressPool | |
JSON AddressPool | |
Arbitrary AddressPool |
Ganeti "network" config object.
Network | |
|
loadNetwork :: JSValue -> Result NetworkSource
saveNetwork :: Network -> JSValueSource
Datacollector definitions
type MicroSeconds = IntegerSource
data DataCollectorConfig Source
The configuration regarding a single data collector.
Eq DataCollectorConfig | |
Show DataCollectorConfig | |
Monoid DataCollectorConfig | Central default values of the data collector config. |
JSON DataCollectorConfig | |
ArrayObject DataCollectorConfig | |
DictObject DataCollectorConfig | |
Arbitrary (Container DataCollectorConfig) |
loadDataCollectorConfig :: JSValue -> Result DataCollectorConfigSource
saveDataCollectorConfig :: DataCollectorConfig -> JSValueSource
IPolicy definitions
data FilledISpecParams Source
FilledISpecParams | |
|
data PartialISpecParams Source
PartialISpecParams | |
|
Eq PartialISpecParams | |
Show PartialISpecParams | |
Monoid PartialISpecParams | |
JSON PartialISpecParams | |
ArrayObject PartialISpecParams | |
DictObject PartialISpecParams | |
Arbitrary PartialISpecParams | FIXME: This generates completely random data, without normal validation rules. |
PartialParams FilledISpecParams PartialISpecParams |
allISpecParamFields :: [String]Source
loadPartialISpecParams :: JSValue -> Result PartialISpecParamsSource
savePartialISpecParams :: PartialISpecParams -> JSValueSource
loadFilledISpecParams :: JSValue -> Result FilledISpecParamsSource
saveFilledISpecParams :: FilledISpecParams -> JSValueSource
data MinMaxISpecs Source
Eq MinMaxISpecs | |
Show MinMaxISpecs | |
JSON MinMaxISpecs | |
ArrayObject MinMaxISpecs | |
DictObject MinMaxISpecs | |
Arbitrary MinMaxISpecs |
loadMinMaxISpecs :: JSValue -> Result MinMaxISpecsSource
saveMinMaxISpecs :: MinMaxISpecs -> JSValueSource
data PartialIPolicy Source
Custom partial ipolicy. This is not built via buildParam since it has a special 2-level inheritance mode.
PartialIPolicy | |
|
Eq PartialIPolicy | |
Show PartialIPolicy | |
JSON PartialIPolicy | |
ArrayObject PartialIPolicy | |
DictObject PartialIPolicy | |
Arbitrary PartialIPolicy | FIXME: This generates completely random data, without normal validation rules. |
PartialParams FilledIPolicy PartialIPolicy | Custom filler for the ipolicy types. |
loadPartialIPolicy :: JSValue -> Result PartialIPolicySource
savePartialIPolicy :: PartialIPolicy -> JSValueSource
data FilledIPolicy Source
Custom filled ipolicy. This is not built via buildParam since it has a special 2-level inheritance mode.
FilledIPolicy | |
|
Eq FilledIPolicy | |
Show FilledIPolicy | |
JSON FilledIPolicy | |
ArrayObject FilledIPolicy | |
DictObject FilledIPolicy | |
Arbitrary FilledIPolicy | |
PartialParams FilledIPolicy PartialIPolicy | Custom filler for the ipolicy types. |
loadFilledIPolicy :: JSValue -> Result FilledIPolicySource
saveFilledIPolicy :: FilledIPolicy -> JSValueSource
Node definitions
data FilledNDParams Source
FilledNDParams | |
|
data PartialNDParams Source
PartialNDParams | |
|
allNDParamFields :: [String]Source
loadPartialNDParams :: JSValue -> Result PartialNDParamsSource
savePartialNDParams :: PartialNDParams -> JSValueSource
loadFilledNDParams :: JSValue -> Result FilledNDParamsSource
saveFilledNDParams :: FilledNDParams -> JSValueSource
Node | |
|
NodeGroup definitions
type GroupDiskParams = Container DiskParamsSource
The cluster/group disk parameters type.
NodeGroup | |
|
loadNodeGroup :: JSValue -> Result NodeGroupSource
saveNodeGroup :: NodeGroup -> JSValueSource
Job scheduler filtering definitions
data FilterAction Source
Actions that can be performed when a filter matches.
Eq FilterAction | |
Ord FilterAction | |
Show FilterAction | |
JSON FilterAction | |
Arbitrary FilterAction |
data FilterPredicate Source
Eq FilterPredicate | |
Ord FilterPredicate | |
Show FilterPredicate | |
JSON FilterPredicate | |
Arbitrary FilterPredicate |
data FilterRule Source
FilterRule | |
|
Eq FilterRule | |
Ord FilterRule | |
Show FilterRule | |
JSON FilterRule | |
ArrayObject FilterRule | |
DictObject FilterRule | |
UuidObject FilterRule | |
Arbitrary FilterRule |
loadFilterRule :: JSValue -> Result FilterRuleSource
saveFilterRule :: FilterRule -> JSValueSource
filterRuleOrder :: FilterRule -> FilterRule -> OrderingSource
Order in which filter rules are evaluated, according to
`doc/design-optables.rst`.
For FilterRule
fields not specified as important for the order,
we choose an arbitrary ordering effect (after the ones from the spec).
The Ord
instance for FilterRule
agrees with this function.
Yet it is recommended to use this function instead of compare
to be
explicit that the spec order is used.
IP family type
ipFamilyFromRaw :: forall m. Monad m => Int -> m IpFamilySource
ipFamilyToRaw :: IpFamily -> IntSource
ipFamilyToVersion :: IpFamily -> IntSource
Conversion from IP family to IP version. This is needed because Python uses both, depending on context.
type ClusterHvParams = GenericContainer Hypervisor HvParamsSource
Cluster HvParams (hvtype to hvparams mapping).
type OsHvParams = Container ClusterHvParamsSource
Cluster Os-HvParams (os to hvparams mapping).
type ClusterBeParams = Container FilledBeParamsSource
Cluser BeParams.
type ClusterOsParams = Container OsParamsSource
Cluster OsParams.
type ClusterNicParams = Container FilledNicParamsSource
Cluster NicParams.
formatUidRange :: UidRange -> StringSource
type IAllocatorParams = Container JSValueSource
The iallocator parameters type.
type CandidateCertificates = Container StringSource
Cluster definitions
loadCluster :: JSValue -> Result ClusterSource
saveCluster :: Cluster -> JSValueSource
ConfigData definitions
data ConfigData Source
ConfigData | |
|
loadConfigData :: JSValue -> Result ConfigDataSource
saveConfigData :: ConfigData -> JSValueSource
Master network parameters
data MasterNetworkParameters Source
MasterNetworkParameters | |
|
loadMasterNetworkParameters :: JSValue -> Result MasterNetworkParametersSource
saveMasterNetworkParameters :: MasterNetworkParameters -> JSValueSource