spydrnet.Definition.create_child

Definition.create_child(name=None, properties=None, reference=None)[source]

Create an instance to add to the definition, add it, and return the instance.

This functions calls the add_child funciton.

Parameters:
  • name - (str) the name of this instance properties - (dict) the dictionary which holds the

  • properties

Example

To create a child:

>>> definition = sdn.Definition()
>>> child_instance = definition.create_child()
>>> child_instance.name = "child_instance"
>>> child_instance.reference = reference_definition

To create a child with optional parameters

>>> child_instance = definition.create_child(name="child_instance",
                                             reference=reference_definition)

The reference of the instance is the definition that initialized this instance.