Package ganeti :: Module network :: Class AddressPool
[hide private]
[frames] | no frames]

Class AddressPool

source code


Address pool class, wrapping an objects.Network object.

This class provides methods to manipulate address pools, backed by objects.Network objects.

Instance Methods [hide private]
 
__init__(self, network)
Initialize a new IPv4 address pool from an objects.Network object.
source code
 
Contains(self, address) source code
 
_GetAddrIndex(self, address) source code
 
Update(self)
Write address pools back to the network object.
source code
 
_Mark(self, address, value=True, external=False) source code
 
_GetSize(self) source code
 
all_reservations(self)
Return a combined map of internal and external reservations.
source code
 
Validate(self) source code
 
IsFull(self)
Check whether the network is full.
source code
 
GetReservedCount(self)
Get the count of reserved addresses.
source code
 
GetFreeCount(self)
Get the count of unused addresses.
source code
 
GetMap(self)
Return a textual representation of the network's occupation status.
source code
 
IsReserved(self, address)
Checks if the given IP is reserved.
source code
 
Reserve(self, address, external=False)
Mark an address as used.
source code
 
Release(self, address, external=False)
Release a given address reservation.
source code
 
GetFreeAddress(self)
Returns the first available address.
source code
 
GenerateFree(self)
Returns the first free address of the network.
source code
 
GetExternalReservations(self)
Returns a list of all externally reserved addresses.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
InitializeNetwork(cls, net)
Initialize an objects.Network object.
source code
Class Variables [hide private]
  FREE = bitarray("0")
  RESERVED = bitarray("1")
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, network)
(Constructor)

source code 

Initialize a new IPv4 address pool from an objects.Network object.

Parameters:
  • network (objects.Network) - the network object from which the pool will be generated
Overrides: object.__init__

all_reservations(self)

source code 

Return a combined map of internal and external reservations.

Decorators:
  • @property

GenerateFree(self)

source code 

Returns the first free address of the network.

Raises:

InitializeNetwork(cls, net)
Class Method

source code 

Initialize an objects.Network object.

Reserve the network, broadcast and gateway IP addresses.