Safe Haskell | Safe-Infered |
---|
Implementation of the Ganeti network objects.
This is does not (yet) cover all methods that are provided in the corresponding python implementation (network.py).
- ip4BaseAddr :: Ip4Network -> Ip4Address
- ipv4NumHosts :: Integral n => n -> Integer
- ipv4NetworkMinNumHosts :: Integer
- ipv4NetworkMaxNumHosts :: Integer
- data PoolPart
- = PoolInstances
- | PoolExt
- addressPoolIso :: Iso' AddressPool BitArray
- poolLens :: PoolPart -> Lens' Network (Maybe AddressPool)
- poolArrayLens :: PoolPart -> Lens' Network (Maybe BitArray)
- netIpv4NumHosts :: Network -> Integer
- newPoolArray :: (MonadError e m, FromString e) => Network -> m BitArray
- newPool :: (MonadError e m, FromString e) => Network -> m AddressPool
- orNewPool :: (MonadError e m, FromString e) => Network -> Maybe AddressPool -> m AddressPool
- withPool :: (MonadError e m, FromString e) => PoolPart -> (Network -> BitArray -> m (a, BitArray)) -> StateT Network m a
- withPool_ :: (MonadError e m, FromString e) => PoolPart -> (Network -> BitArray -> m BitArray) -> Network -> m Network
- readPool :: PoolPart -> Network -> Maybe BitArray
- readPoolE :: (MonadError e m, FromString e) => PoolPart -> Network -> m BitArray
- readAllE :: (MonadError e m, FromString e) => Network -> m BitArray
- reservations :: Network -> Maybe BitArray
- extReservations :: Network -> Maybe BitArray
- allReservations :: Network -> Maybe BitArray
- getReservedCount :: Network -> Int
- getFreeCount :: Network -> Int
- isFull :: Network -> Bool
- getMap :: Network -> String
- addrIndex :: (MonadError e m, FromString e) => Ip4Address -> Network -> m Int
- addrAt :: (MonadError e m, FromString e) => Int -> Network -> m Ip4Address
- isReserved :: (MonadError e m, FromString e) => PoolPart -> Ip4Address -> Network -> m Bool
- reserve :: (MonadError e m, FromString e) => PoolPart -> Ip4Address -> Network -> m Network
- release :: (MonadError e m, FromString e) => PoolPart -> Ip4Address -> Network -> m Network
- findFree :: (MonadError e m, FromString e) => (Ip4Address -> Bool) -> Network -> m (Maybe Ip4Address)
Documentation
ipv4NumHosts :: Integral n => n -> IntegerSource
ipv4NetworkMinNumHosts :: IntegerSource
ipv4NetworkMaxNumHosts :: IntegerSource
addressPoolIso :: Iso' AddressPool BitArraySource
poolLens :: PoolPart -> Lens' Network (Maybe AddressPool)Source
poolArrayLens :: PoolPart -> Lens' Network (Maybe BitArray)Source
netIpv4NumHosts :: Network -> IntegerSource
newPoolArray :: (MonadError e m, FromString e) => Network -> m BitArraySource
newPool :: (MonadError e m, FromString e) => Network -> m AddressPoolSource
orNewPool :: (MonadError e m, FromString e) => Network -> Maybe AddressPool -> m AddressPoolSource
withPool :: (MonadError e m, FromString e) => PoolPart -> (Network -> BitArray -> m (a, BitArray)) -> StateT Network m aSource
withPool_ :: (MonadError e m, FromString e) => PoolPart -> (Network -> BitArray -> m BitArray) -> Network -> m NetworkSource
readAllE :: (MonadError e m, FromString e) => Network -> m BitArraySource
reservations :: Network -> Maybe BitArraySource
extReservations :: Network -> Maybe BitArraySource
allReservations :: Network -> Maybe BitArraySource
Get a bit vector of all reservations (internal and external) combined.
getReservedCount :: Network -> IntSource
Get the count of reserved addresses.
getFreeCount :: Network -> IntSource
Get the count of free addresses.
getMap :: Network -> StringSource
Return a textual representation of the network's occupation status.
Functions used for manipulating the reservations
addrIndex :: (MonadError e m, FromString e) => Ip4Address -> Network -> m IntSource
addrAt :: (MonadError e m, FromString e) => Int -> Network -> m Ip4AddressSource
isReserved :: (MonadError e m, FromString e) => PoolPart -> Ip4Address -> Network -> m BoolSource
Checks if a given address is reserved. Fails if the address isn't in the network range.
reserve :: (MonadError e m, FromString e) => PoolPart -> Ip4Address -> Network -> m NetworkSource
Marks an address as used.
release :: (MonadError e m, FromString e) => PoolPart -> Ip4Address -> Network -> m NetworkSource
Marks an address as unused.
findFree :: (MonadError e m, FromString e) => (Ip4Address -> Bool) -> Network -> m (Maybe Ip4Address)Source
Get the first free address in the network that satisfies a given predicate.