gns3converter.topology

This module is for processing a topology

class gns3converter.topology.JSONTopology

Bases: builtins.object

v1.0 JSON Topology

get_qemus()

Get the maximum ID of the Qemu VMs

Returns:Maximum Qemu VM ID
Return type:int
get_topology()

Get the converted topology ready for JSON encoding

Returns:converted topology assembled into a single dict
Return type:dict
get_vboxes()

Get the maximum ID of the VBoxes

Returns:Maximum VBox ID
Return type:int
images

Returns the images

Returns:Topology images
Return type:list

Returns the links

Returns:Topology links
Return type:list
name

Returns the topology name

Returns:Topology name
Return type:None or str
nodes

Returns the nodes

Returns:topology nodes
Return type:list
notes

Returns the notes

Returns:Topology notes
Return type:list
servers

Returns the servers

Returns:Topology servers
Return type:list
shapes

Returns the shapes

Returns:Topology shapes
Return type:dict
class gns3converter.topology.LegacyTopology(sections, old_top)

Bases: builtins.object

Legacy Topology (pre-1.0)

Parameters:
add_artwork_item(instance, item)

Add an artwork item e.g. Shapes, Notes and Pixmaps

Parameters:
  • instance – Hypervisor instance
  • item – Item to add
add_conf_item(instance, item)

Add a hypervisor configuration item

Parameters:
  • instance – Hypervisor instance
  • item – Item to add
add_physical_item(instance, item)

Add a physical item e.g router, cloud etc

Parameters:
  • instance – Hypervisor instance
  • item – Item to add
add_qemu_path(instance)

Add the qemu path to the hypervisor conf data

Parameters:instance – Hypervisor instance
artwork

Return the Artwork dict

Returns:artwork dict
Return type:dict
static device_typename(item)

Convert the old names to new-style names and types

Parameters:item (str) – A device in the form of ‘TYPE NAME’
Returns:tuple containing device name and type details
hv_id

Return the Hypervisor ID

Returns:Hypervisor ID
Return type:int
nid

Return the node ID

Returns:Node ID
Return type:int
qemu_id

Return the Qemu VM ID :return: Qemu VM ID :rtype: int

vbox_id

Return the VBox ID :return: VBox ID :rtype: int