Network diagram/topology YAML file

node's name is mandatory. Should be in IP-address format. To change it to any other value - use label.

visualization' options: full option list


nodes:
    10.10.10.2:  # Name of node. Mandatory
        # Tags of node. Any key (type string): value (str, int, float, dictionary, list) pairs. Optional
        vendor: Juniper
        role: router
        ha_role: primary
        location: dc1
        # visualization' options
        label: 10.10.10.2-R2
        size: 15
        color: red
    10.10.10.3:
        ha_role: secondary
        location: dc1
    10.10.10.6:

src, dst is mandatory

cost is optional. Default is 1. Equal to OSPF/IS-IS cost.

directed is optional. Default is false.


edges:
    # use directed: true, otherwise all edges will be treated as undirected
    - dst: 10.10.10.2
      src: 10.10.10.3
      cost: 1     # default value
    - dst: 10.10.10.3
      src: 10.10.10.6
      # Tags of edge. Any key (type string): value (str, int, float, dictionary, list) pairs. Optional
      bw: 1000
      isp: verizon
      media: fiber

Copy/paste this test topology to the input window above

nodes:
  10.10.10.1:
  10.10.10.2:
  10.10.10.3:
  10.10.10.4:
  10.10.10.5:
  10.10.10.6:
edges:
- src: 10.10.10.1
  dst: 10.10.10.2
- src: 10.10.10.1
  dst: 10.10.10.3
- src: 10.10.10.2
  dst: 10.10.10.4
- src: 10.10.10.2
  dst: 10.10.10.4
- src: 10.10.10.2
  dst: 10.10.10.3
- src: 10.10.10.3
  dst: 10.10.10.5
- src: 10.10.10.5
  dst: 10.10.10.4
- src: 10.10.10.4
  dst: 10.10.10.6
- src: 10.10.10.5
  dst: 10.10.10.6

Copy/paste this test topology to the input window above

nodes:
 10.10.10.1:
  label: 10.10.10.1
  location: dc1
 10.10.10.2:
  ha_role: primary
  label: 10.10.10.2
  location: dc1
  size: 15
 10.10.10.3:
  ha_role: secondary
  label: 10.10.10.3
  location: dc1
 10.10.10.4:
  ha_role: primary
  label: 10.10.10.4
  location: dc2
  size: 15
 10.10.10.5:
  ha_role: secondary
  label: 10.10.10.5label
  location: dc2
 10.10.10.6:
  label: 10.10.10.6
  location: dc2
edges:
- src: 10.10.10.1
  dst: 10.10.10.2
  bw: 1000
  directed: true
  media: copper
- src: 10.10.10.2
  dst: 10.10.10.1
  bw: 1000
  directed: true
  media: copper
- src: 10.10.10.1
  dst: 10.10.10.3
  bw: 1000
  directed: true
  media: copper
- src: 10.10.10.3
  dst: 10.10.10.1
  bw: 1000
  directed: true
  media: copper
- src: 10.10.10.2
  dst: 10.10.10.4
  bw: 100
  cost: 100
  directed: true
  isp: att
  media: copper
- src: 10.10.10.4
  dst: 10.10.10.2
  bw: 100
  directed: true
  isp: att
  media: copper
- src: 10.10.10.4
  dst: 10.10.10.2
  bw: 1000
  directed: true
  isp: verizon
  media: fiber
- src: 10.10.10.2
  dst: 10.10.10.4
  bw: 1000
  directed: true
  isp: verizon
  media: fiber
- src: 10.10.10.3
  dst: 10.10.10.2
  bw: 1000
  directed: true
  media: copper
- src: 10.10.10.2
  dst: 10.10.10.3
  bw: 1000
  directed: true
  media: copper
- src: 10.10.10.3
  dst: 10.10.10.5
  bw: 100
  directed: true
  isp: virgin
  media: fiber
- src: 10.10.10.5
  dst: 10.10.10.3
  bw: 100
  directed: true
  isp: virgin
  media: fiber
- src: 10.10.10.5
  dst: 10.10.10.4
  bw: 1000
  directed: true
  media: copper
- src: 10.10.10.4
  dst: 10.10.10.5
  bw: 1000
  directed: true
  media: copper
- src: 10.10.10.4
  dst: 10.10.10.6
  bw: 1000
  directed: true
  media: fiber
- src: 10.10.10.6
  dst: 10.10.10.4
  bw: 1000
  directed: true
  media: fiber
- src: 10.10.10.5
  dst: 10.10.10.6
  bw: 1000
  directed: true
  media: fiber
- src: 10.10.10.6
  dst: 10.10.10.5
  bw: 1000
  directed: true
  media: fiber

Query node by name


query_params = {'name': '10.10.10.2'}                                                           
r_get = requests.get(f'http://{TOPOLOGRAPH_HOST}:{TOPOLOGRAPH_PORT}/api/diagram/{graph_time}/nodes', auth=(_USERNAME, _PASSWORD), params=query_params)
r_get.json()
  [{'ha_role': 'primary', 'id': 1, 'label': '10.10.10.2', 'location': 'dc1', 'name': '10.10.10.2', 'size': 15}]

Query node by arbitrary tags. Get all nodes in location dc1


query_params = {'location': 'dc1'}                                                              
r_get = requests.get(f'http://{TOPOLOGRAPH_HOST}:{TOPOLOGRAPH_PORT}/api/diagram/{graph_time}/nodes', auth=(_USERNAME, _PASSWORD), params=query_params)
r_get.json()                                                                                    
[{'id': 0, 'label': '10.10.10.1', 'location': 'dc1', 'name': '10.10.10.1'}, 
{'ha_role': 'primary', 'id': 1, 'label': '10.10.10.2', 'location': 'dc1', 'name': '10.10.10.2', 'size': 15}, 
{'ha_role': 'secondary', 'id': 2, 'label': '10.10.10.3', 'location': 'dc1', 'name': '10.10.10.3'}]

Query node by arbitrary tags. Get all primary nodes in location dc1


query_params = {'location': 'dc1', 'ha_role': 'primary'}                                        
r_get = requests.get(f'http://{TOPOLOGRAPH_HOST}:{TOPOLOGRAPH_PORT}/api/diagram/{graph_time}/nodes', auth=(_USERNAME, _PASSWORD), params=query_params)
r_get.json()
[{'ha_role': 'primary', 'id': 1, 'label': '10.10.10.2', 'location': 'dc1', 'name': '10.10.10.2', 'size': 15}]

Query all edges between two nodes


query_params = {'src_node': '10.10.10.2', 'dst_node': '10.10.10.4'}                                                             
r_get = requests.get(f'http://{TOPOLOGRAPH_HOST}:{TOPOLOGRAPH_PORT}/api/diagram/{graph_time}/edges', auth=(_USERNAME, _PASSWORD), params=query_params)
r_get.json()                                                                                    
[{'bw': 100, 'dst': '10.10.10.4', 'id': 4, 'isp': 'att', 'media': 'copper', 'src': '10.10.10.2', 'cost': 100},
{'bw': 1000, 'dst': '10.10.10.4', 'id': 7, 'isp': 'verizon', 'media': 'fiber', 'src': '10.10.10.2', 'cost': 1}]

Query edge by arbitrary tags. Get all links between '10.10.10.2' and '10.10.10.4' from Verizon ISP


query_params = {'src_node': '10.10.10.2', 'dst_node': '10.10.10.4', 'isp': 'verizon'}                                        
r_get = requests.get(f'http://{TOPOLOGRAPH_HOST}:{TOPOLOGRAPH_PORT}/api/diagram/{graph_time}/nodes', auth=(_USERNAME, _PASSWORD), params=query_params)
r_get.json()
[{'bw': 1000, 'dst': '10.10.10.4', 'id': 7, 'isp': 'verizon', 'media': 'fiber', 'src': '10.10.10.2', 'cost': 1}]

Graph

Network reaction on applied changes

        
 
        
Topolograph 2.39