insalata.builder package

Submodules

insalata.builder.Builder module

class insalata.builder.Builder.Builder(builderConfPath, logger)

Bases: object

addConfigNameDisk(config, disk)
addConfigNameHost(config, host)
addConfigNameNetwork(config, network)
addDisk(config, disk, host)
boot(config, host)
bootAndNamed(config, host)
bootUnnamed(config, host)
configureCpus(config, host)
configureDhcp(config, service)
configureDns(config, service)
configureFirewall(config, host)
configureInterface(config, interface)
configureMemory(config, host)
configureMtu(config, interface)
configureNetwork(config, interface)
configureRate(config, interface)
configureRouting(config, host)
configureService(config, service)
createHost(config, host)
createInterface(config, interface)
createNetwork(config, network)
deleteHost(config, host)
findFunction(objId, forAction, forHypervisor=None, forTemplate=None, forService=None)

Search for a function that solves the given action for an object that specifies a certain hypervisor, template or service.

Parameters:
  • objId (str) – The global ID of the affected object.
  • forAction (str) – The name of the action to find a function for.
  • forHypervisor (str) – The name of the action to find a function for.
  • forTemplate (str) – A list of template properties to find a function for.
  • forService (str) – The name of the service to find a function for.
Returns:

A reference to a function that can be called based on the given parameters.

Return type:

function

loadFunctions(packageName)

Import all functions of all functions of a module, recursively, including subpackages

Parameters:packageName (str) – Name of the package to load functions of.
Returns:A dictionary with all functions under the given main module.
Return type:dict[str, types.Function]
name(config, host)
reboot(config, host)
rebootAndNamed(config, host)
removeDisk(config, disk)
removeHost(config, host)
removeInterface(config, interface)
removeNetwork(config, network)
shutdown(config, host)
unconfigureInterface(config, interface)

insalata.builder.decorator module

insalata.builder.decorator.builderFor(action, hypervisor=None, template=None, service=None)

This decorator is used to supply metadata for functions which is then used to find suitable methods during building just by these properties.

Parameters:
  • action (str) – Name of the generic step/action (see planner) that this function implements
  • hypervisor – Name of the hypervisor that this function can be used for
  • template – A list of template properties this function is suitable for (e.g. OS, certain software)
  • service – Production or type of the service that this function can be used for
Returns:

The deocorated input function with the given attribute values

Return type:

function

Module contents