UML
This section demonstrate how the infrastructure is built. This section goes
into quite a bit of details, and is a suplement to help reading the actual
source code of Genie
.
Base
The infrastructure base classes are setup like this.
The following APIs are used to control the topology of the Testbed.
Base for all Genie objects, contains
__init__
and__repr__
.Base for all Genie
conf
objects. Contains__init__
which is setting all extrakwargs
to the object. instantiates the__instances
dictionary which contains a weakref to all the Genie objects.testbed
property is defined at this level.Contains
build_config
andbuild_unconfig
functions which are decorated via@lookup('os', 'context')
. This enables abstraction based ondevice.os
anddevice.context
forconf
objects when either of these two methods are calledContains default methods for all future features objects.
Base class for all Device-based feature object. What to when it is added, removed and so on.
Base class for all Interface-based feature object. What to when it is added,removed and so on.
Base class for all Link-based feature object. What to when it is added,removed and so on.
Contains all the APIs to manipulate a
link
, and to addfeatures
to it.Contains all the APIs to manipulate the
testbed
, add topology objects to it and alsofeatures
.Contains all the APIs to manipulate a
device
, and to addfeatures
to it.Contains all the APIs to manipulate an
interfaces
, and to addfeatures
to it.
The following APIs are used to control the way the user interact with the objects attributes, and the structured objects.
Base object which allows to inherits attributes from parent object. Overwrites
__setattr__, `__getattr__
, and__delattr__
. Can also verify if a particular attribute is inherited.Base class fo subattributes classes. It addeds testbed property.
Go through the API doc for this one, cannot be sum up in a few lines.
Implementation of a KeyedSubattributes for a particular devices.
Implementation of a KeyedSubattributes for a particular interfaces.