Class Nodes
source code
Represents a collection of machines ("nodes")
This class is used to load descriptions of nodes from an XML file.
These nodes can appear in two places: in a site description (which, in
turn, is loaded by the Site class) or in a lease's resource requirements
(describing what nodes, with what resources, are required by the
lease).
Nodes are stored as one or more "node sets". Each node set
has nodes with the exact same resources. So, for example, a lease
requiring 100 nodes (all identical, except 50 have 1024MB of memory and
the other 50 have 512MB of memory) doesn't need to enumerate all 100
nodes. Instead, it just has to describe the two "node sets"
(indicating that there are 50 nodes of one type and 50 of the other). See
the Haizea documentation for more details on the XML format.
Like the Site class, this class is distinct from the ResourcePool
class, even though they both represent a "collection of nodes".
See the Site class documentation for more details.
|
|
|
|
|
get_all_nodes(self)
Returns a dictionary mapping individual nodes to capacities |
source code
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|
Inherited from object :
__class__
|
Constructor.
Arguments: node_sets -- A list of (n,c) pairs (where n is the number
of nodes in the set and c is a Capacity object; all nodes in the set have
capacity c).
- Overrides:
object.__init__
|
from_xml_element(cls,
nodes_element)
Class Method
| source code
|
Constructs a node collection from an ElementTree element.
See the Haizea documentation for details on the <nodes> XML
format.
Argument: element -- Element object containing a
"<nodes>" element.
|
Returns an ElementTree XML representation of the nodes
See the Haizea documentation for details on the lease XML format.
|
Adds a new resource to all the nodes
Argument: name -- Name of the resource type amounts -- A list with the
amounts of the resource to add to each node. If the resource is
single-instance, then this will just be a list with a single element. If
multi-instance, each element of the list represent the amount of an
instance of the resource.
|