ganeti

Safe HaskellNone

Ganeti.Objects

Contents

Description

Implementation of the Ganeti config objects.

Synopsis

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

Constructors

Ip4Address Word8 Word8 Word8 Word8 

Instances

Eq Ip4Address 
Ord Ip4Address 
Show Ip4Address 
IsString Ip4Address

IsString instance for Ip4Address, to help write the tests.

Arbitrary Ip4Address 
JSON Ip4Address 

mkIp4Address :: (Word8, Word8, Word8, Word8) -> Ip4AddressSource

readIp4Address :: (Applicative m, Monad m) => String -> m Ip4AddressSource

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.

Constructors

Ip4Network 

Fields

ip4netAddr :: Ip4Address
 
ip4netMask :: Word8
 

Instances

Eq Ip4Network 
Show Ip4Network 
Arbitrary Ip4Network 
JSON Ip4Network

JSON instance for Ip4Network.

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.

Constructors

AddressPool 

Instances

Eq AddressPool 
Ord AddressPool 
Show AddressPool 
Arbitrary AddressPool 
JSON AddressPool 

Ganeti "network" config object.

loadNetwork :: JSValue -> Result NetworkSource

Datacollector definitions

type MicroSeconds = IntegerSource

data DataCollectorConfig Source

The configuration regarding a single data collector.

Instances

IPolicy definitions

data PartialISpecParams Source

Constructors

PartialISpecParams 

Fields

ispecMemorySizeP :: Maybe Int
 
ispecDiskSizeP :: Maybe Int
 
ispecDiskCountP :: Maybe Int
 
ispecCpuCountP :: Maybe Int
 
ispecNicCountP :: Maybe Int
 
ispecSpindleUseP :: Maybe Int
 

Instances

data PartialIPolicy Source

Custom partial ipolicy. This is not built via buildParam since it has a special 2-level inheritance mode.

Instances

Eq PartialIPolicy 
Show PartialIPolicy 
Arbitrary PartialIPolicy

FIXME: This generates completely random data, without normal validation rules.

JSON PartialIPolicy 
ArrayObject PartialIPolicy 
DictObject PartialIPolicy 
PartialParams FilledIPolicy PartialIPolicy

Custom filler for the ipolicy types.

data FilledIPolicy Source

Custom filled ipolicy. This is not built via buildParam since it has a special 2-level inheritance mode.

Node definitions

data PartialNDParams Source

Constructors

PartialNDParams 

Fields

ndpOobProgramP :: Maybe String
 
ndpSpindleCountP :: Maybe Int
 
ndpExclusiveStorageP :: Maybe Bool
 
ndpOvsP :: Maybe Bool
 
ndpOvsNameP :: Maybe String
 
ndpOvsLinkP :: Maybe String
 
ndpSshPortP :: Maybe Int
 
ndpCpuSpeedP :: Maybe Double
 

type DiskState = Container JSValueSource

loadNode :: JSValue -> Result NodeSource

saveNode :: Node -> JSValueSource

NodeGroup definitions

type GroupDiskParams = Container DiskParamsSource

The cluster/group disk parameters type.

loadNodeGroup :: JSValue -> Result NodeGroupSource

Job scheduler filtering definitions

data FilterAction Source

Actions that can be performed when a filter matches.

Constructors

Accept 
Pause 
Reject 
Continue 
RateLimit Int 

Instances

loadFilterRule :: JSValue -> Result FilterRuleSource

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.

data IpFamily Source

IP family type

Constructors

IpFamilyV4 
IpFamilyV6 

Instances

Bounded IpFamily 
Enum IpFamily 
Eq IpFamily 
Ord IpFamily 
Show IpFamily 
Arbitrary IpFamily 
JSON IpFamily 

ipFamilyFromRaw :: forall m. Monad m => Int -> m IpFamilySource

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 ClusterOsParams = Container OsParamsSource

Cluster OsParams.

type UidRange = (Int, Int)Source

A low-high UID ranges.

type UidPool = [UidRange]Source

Cluster UID Pool, list (low, high) UID ranges.

type IAllocatorParams = Container JSValueSource

The iallocator parameters type.

Cluster definitions

data Cluster Source

Constructors

Cluster 

Fields

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 :: HypervisorState
 
clusterDiskStateStatic :: DiskState
 
clusterEnabledDiskTemplates :: [DiskTemplate]
 
clusterCandidateCerts :: CandidateCertificates
 
clusterMaxRunningJobs :: Int
 
clusterMaxTrackedJobs :: Int
 
clusterInstallImage :: String
 
clusterInstanceCommunicationNetwork :: String
 
clusterZeroingImage :: String
 
clusterCompressionTools :: [String]
 
clusterEnabledUserShutdown :: Bool
 
clusterDataCollectors :: Container DataCollectorConfig
 
clusterCtime :: ClockTime
 
clusterMtime :: ClockTime
 
clusterUuid :: String
 
clusterSerial :: Int
 
clusterTags :: TagSet
 

loadCluster :: JSValue -> Result ClusterSource

ConfigData definitions

loadConfigData :: JSValue -> Result ConfigDataSource

Master network parameters