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).
- data AddressPool = AddressPool {
- network :: Network
- reservations :: Vector Bool
- extReservations :: Vector Bool
- createAddressPool :: Network -> Maybe AddressPool
- networkIsValid :: Network -> Bool
- sameLength :: Maybe String -> Maybe String -> Bool
- maybeStr2BitVec :: Maybe String -> Vector Bool
- bitStringToBitVector :: String -> Vector Bool
- allReservations :: AddressPool -> Vector Bool
- getReservedCount :: AddressPool -> Int
- getFreeCount :: AddressPool -> Int
- isFull :: AddressPool -> Bool
- getMap :: AddressPool -> String
Documentation
data AddressPool Source
An address pool, holding a network plus internal and external reservations.
AddressPool | |
|
Show AddressPool | |
Arbitrary AddressPool |
createAddressPool :: Network -> Maybe AddressPoolSource
Create an address pool from a network.
networkIsValid :: Network -> BoolSource
Checks the consistency of the network object. So far, only checks the length of the reservation strings.
sameLength :: Maybe String -> Maybe String -> BoolSource
maybeStr2BitVec :: Maybe String -> Vector BoolSource
bitStringToBitVector :: String -> Vector BoolSource
Converts a string to a bit vector. The character '0' is interpreted
as False
, all others as True
.
allReservations :: AddressPool -> Vector BoolSource
Get a bit vector of all reservations (internal and external) combined.
getReservedCount :: AddressPool -> IntSource
Get the count of reserved addresses.
getFreeCount :: AddressPool -> IntSource
Get the count of free addresses.
isFull :: AddressPool -> BoolSource
Check whether the network is full.
getMap :: AddressPool -> StringSource
Return a textual representation of the network's occupation status.