Safe Haskell | None |
---|
Ganeti.Network
Description
Implementation of the Ganeti network objects.
This is does not (yet) cover all methods that are provided in the corresponding python implementation (network.py).
Synopsis
- ip4BaseAddr :: Ip4Network -> Ip4Address
- data PoolPart
- netIpv4NumHosts :: Network -> Integer
- reservations :: Network -> Maybe BitArray
- extReservations :: Network -> Maybe BitArray
- allReservations :: Network -> Maybe BitArray
- getReservedCount :: Network -> Int
- getFreeCount :: Network -> Int
- isFull :: Network -> Bool
- getMap :: Network -> String
- isReserved :: (MonadError e m, Error e) => PoolPart -> Ip4Address -> Network -> m Bool
- reserve :: (MonadError e m, Error e) => PoolPart -> Ip4Address -> Network -> m Network
- release :: (MonadError e m, Error e) => PoolPart -> Ip4Address -> Network -> m Network
- findFree :: (MonadError e m, Error e) => (Ip4Address -> Bool) -> Network -> m (Maybe Ip4Address)
Documentation
ip4BaseAddr :: Ip4Network -> Ip4Address Source #
Constructors
PoolInstances | |
PoolExt |
netIpv4NumHosts :: Network -> Integer Source #
reservations :: Network -> Maybe BitArray Source #
extReservations :: Network -> Maybe BitArray Source #
allReservations :: Network -> Maybe BitArray Source #
Get a bit vector of all reservations (internal and external) combined.
getReservedCount :: Network -> Int Source #
Get the count of reserved addresses.
getFreeCount :: Network -> Int Source #
Get the count of free addresses.
getMap :: Network -> String Source #
Return a textual representation of the network's occupation status.
Functions used for manipulating the reservations
isReserved :: (MonadError e m, Error e) => PoolPart -> Ip4Address -> Network -> m Bool Source #
Checks if a given address is reserved. Fails if the address isn't in the network range.
reserve :: (MonadError e m, Error e) => PoolPart -> Ip4Address -> Network -> m Network Source #
Marks an address as used.
release :: (MonadError e m, Error e) => PoolPart -> Ip4Address -> Network -> m Network Source #
Marks an address as unused.
findFree :: (MonadError e m, Error e) => (Ip4Address -> Bool) -> Network -> m (Maybe Ip4Address) Source #
Get the first free address in the network that satisfies a given predicate.