Skip to content

Commit 383c22b

Browse files
authored
updated topology format with node name (#10)
1 parent 19dced8 commit 383c22b

File tree

6 files changed

+61
-61
lines changed

6 files changed

+61
-61
lines changed

Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ links:
9797
- [["spine1", "et2"], ["leaf1", "et1"]]
9898
- [["leaf1", "et3"], ["host10", "et0"]]
9999
nodes:
100-
spine1:
100+
- name: spine1
101101
mac: 00:1c:73:c0:c6:01
102102
ipaddress: 192.168.0.10
103103
hosts:
104-
host10:
104+
- name: host10
105105
ipaddress: 10.0.12.11
106106
mask: 255.255.255.0
107107
gateway: 10.0.12.1

build/topo-builder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,13 +404,13 @@ def main(args):
404404
pS("INFO", "Examining devices for topology")
405405
if hosts:
406406
for _container_node in (nodes + hosts):
407-
_node_name = list(_container_node.keys())[0]
407+
_node_name = _container_node['name']
408408
_container_uid = getDevID()
409409
CEOS_IDS.append(_container_uid)
410410
CEOS_MAPPER[_node_name] = _container_uid
411411
else:
412412
for _container_node in nodes:
413-
_node_name = list(_container_node.keys())[0]
413+
_node_name = _container_node['name']
414414
_container_uid = getDevID()
415415
CEOS_IDS.append(_container_uid)
416416
CEOS_MAPPER[_node_name] = _container_uid
@@ -427,13 +427,13 @@ def main(args):
427427
_node_ip = _node['ip_addr']
428428
except KeyError:
429429
_node_ip = ""
430-
_node_name = list(_node.keys())[0]
430+
_node_name = _node['name']
431431
CEOS[_node_name] = CEOS_NODE(_node_name, _node_ip, mgmt_mac, _node['mac'], CEOS_LINKS[_node_name], _tag, ceos_image)
432432
DEVICE_INFO.append(f"# {_node_name} = {CEOS[_node_name].tag}{CEOS[_node_name].dev_id}\n")
433433
# Load Host nodes specific information
434434
if hosts:
435435
for _host in hosts:
436-
_host_name = list(_host.keys())[0]
436+
_host_name = _host['name']
437437
HOSTS[_host_name] = HOST_NODE(_host_name, _host['ip_addr'], _host['mask'], _host['gateway'], CEOS_LINKS[_host_name], _tag, host_image)
438438
DEVICE_INFO.append(f"# {_host_name} = {HOSTS[_host_name].tag}{HOSTS[_host_name].dev_id}\n")
439439
# Check for output directory

examples/topologies/atd.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,21 @@ links:
4040
- [["leaf4", "et5"], ["host2", "et4"]]
4141
- [["leaf4", "et6"], ["host2", "et6"]]
4242
nodes:
43-
- spine1:
43+
- name: spine1
4444
mac: 00:1c:73:f0:c6:01
45-
- spine2:
45+
- name: spine2
4646
mac: 00:1c:73:f1:c6:01
47-
- leaf1:
47+
- name: leaf1
4848
mac: 00:1c:73:f2:c6:01
49-
- leaf2:
49+
- name: leaf2
5050
mac: 00:1c:73:f3:c6:01
51-
- leaf3:
51+
- name: leaf3
5252
mac: 00:1c:73:f4:c6:01
53-
- leaf4:
53+
- name: leaf4
5454
mac: 00:1c:73:f5:c6:01
55-
- host1:
55+
- name: host1
5656
mac: 00:1c:73:f7:c6:01
57-
- host2:
57+
- name: host2
5858
mac: 00:1c:73:f8:c6:01
5959
hosts:
6060
iperf:

examples/topologies/l2.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,43 +38,43 @@ links:
3838
- [["leaf3", "et4"], ["host31", "et0"]]
3939

4040
nodes:
41-
- spine1:
41+
- name: spine1
4242
mac: 00:1c:73:b0:c6:01
4343
ip_addr: 192.168.50.21
44-
- spine2:
44+
- name: spine2
4545
mac: 00:1c:73:b1:c6:01
4646
ip_addr: 192.168.50.22
47-
- leaf1:
47+
- name: leaf1
4848
mac: 00:1c:73:b2:c6:01
4949
ip_addr: 192.168.50.23
50-
- leaf2:
50+
- name: leaf2
5151
mac: 00:1c:73:b3:c6:01
5252
ip_addr: 192.168.50.24
53-
- leaf3:
53+
- name: leaf3
5454
mac: 00:1c:73:b4:c6:01
5555
ip_addr: 192.168.50.25
5656
hosts:
57-
- host10:
57+
- name: host10
5858
ip_addr: 10.0.12.11
5959
mask: 255.255.255.0
6060
gateway: 10.0.12.1
61-
- host11:
61+
- name: host11
6262
ip_addr: 10.0.13.11
6363
mask: 255.255.255.0
6464
gateway: 10.0.13.1
65-
- host20:
65+
- name: host20
6666
ip_addr: 10.0.12.21
6767
mask: 255.255.255.0
6868
gateway: 10.0.12.1
69-
- host21:
69+
- name: host21
7070
ip_addr: 10.0.13.21
7171
mask: 255.255.255.0
7272
gateway: 10.0.13.1
73-
- host30:
73+
- name: host30
7474
ip_addr: 10.0.12.31
7575
mask: 255.255.255.0
7676
gateway: 10.0.12.1
77-
- host31:
77+
- name: host31
7878
ip_addr: 10.0.13.31
7979
mask: 255.255.255.0
8080
gateway: 10.0.13.1

examples/topologies/l3.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,58 +51,58 @@ links:
5151
- [["brdr1", "et1"], ["brdr2", "et1"]]
5252

5353
nodes:
54-
- spine1:
54+
- name: spine1
5555
mac: 00:1c:73:c0:c6:01
5656
ip_addr: 192.168.50.31
57-
- spine2:
57+
- name: spine2
5858
mac: 00:1c:73:c1:c6:01
5959
ip_addr: 192.168.50.32
60-
- leaf11:
60+
- name: leaf11
6161
mac: 00:1c:73:c2:c6:01
6262
ip_addr: 192.168.50.33
63-
- leaf12:
63+
- name: leaf12
6464
mac: 00:1c:73:c3:c6:01
6565
ip_addr: 192.168.50.34
66-
- leaf21:
66+
- name: leaf21
6767
mac: 00:1c:73:c4:c6:01
6868
ip_addr: 192.168.50.35
69-
- leaf22:
69+
- name: leaf22
7070
mac: 00:1c:73:c5:c6:01
7171
ip_addr: 192.168.50.36
72-
- leaf31:
72+
- name: leaf31
7373
mac: 00:1c:73:c6:c6:01
7474
ip_addr: 192.168.50.37
75-
- leaf32:
75+
- name: leaf32
7676
mac: 00:1c:73:c7:c6:01
7777
ip_addr: 192.168.50.38
78-
- brdr1:
78+
- name: brdr1
7979
mac: 00:1c:73:c8:c6:01
8080
ip_addr: 192.168.50.39
81-
- brdr2:
81+
- name: brdr2
8282
mac: 00:1c:73:c9:c6:01
8383
ip_addr: 192.168.50.40
8484
hosts:
85-
- host11:
85+
- name: host11
8686
ip_addr: 192.168.12.11
8787
mask: 255.255.255.0
8888
gateway: 192.168.12.1
89-
- host12:
89+
- name: host12
9090
ip_addr: 192.168.13.11
9191
mask: 255.255.255.0
9292
gateway: 192.168.13.1
93-
- host21:
93+
- name: host21
9494
ip_addr: 192.168.12.21
9595
mask: 255.255.255.0
9696
gateway: 192.168.12.1
97-
- host22:
97+
- name: host22
9898
ip_addr: 192.168.13.21
9999
mask: 255.255.255.0
100100
gateway: 192.168.13.1
101-
- host31:
101+
- name: host31
102102
ip_addr: 192.168.12.31
103103
mask: 255.255.255.0
104104
gateway: 192.168.12.1
105-
- host32:
105+
- name: host32
106106
ip_addr: 192.168.13.31
107107
mask: 255.255.255.0
108108
gateway: 192.168.13.1

examples/topologies/ratd.yaml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,45 +48,45 @@ links:
4848
- [["eos12", "et1"], ["eos13", "et2"]]
4949

5050
nodes:
51-
- eos1:
51+
- name: eos1
5252
mac: 00:1c:73:d0:c6:01
53-
- eos2:
53+
- name: eos2
5454
mac: 00:1c:73:d1:c6:01
55-
- eos3:
55+
- name: eos3
5656
mac: 00:1c:73:d2:c6:01
57-
- eos4:
57+
- name: eos4
5858
mac: 00:1c:73:d3:c6:01
59-
- eos5:
59+
- name: eos5
6060
mac: 00:1c:73:d4:c6:01
61-
- eos6:
61+
- name: eos6
6262
mac: 00:1c:73:d5:c6:01
63-
- eos7:
63+
- name: eos7
6464
mac: 00:1c:73:d6:c6:01
65-
- eos8:
65+
- name: eos8
6666
mac: 00:1c:73:d7:c6:01
67-
- eos9:
67+
- name: eos9
6868
mac: 00:1c:73:d8:c6:01
69-
- eos10:
69+
- name: eos10
7070
mac: 00:1c:73:d9:c6:01
71-
- eos11:
71+
- name: eos11
7272
mac: 00:1c:73:e0:c6:01
73-
- eos12:
73+
- name: eos12
7474
mac: 00:1c:73:e1:c6:01
75-
- eos13:
75+
- name: eos13
7676
mac: 00:1c:73:e2:c6:01
77-
- eos14:
77+
- name: eos14
7878
mac: 00:1c:73:e3:c6:01
79-
- eos15:
79+
- name: eos15
8080
mac: 00:1c:73:e4:c6:01
81-
- eos16:
81+
- name: eos16
8282
mac: 00:1c:73:d5:c6:01
83-
- eos17:
83+
- name: eos17
8484
mac: 00:1c:73:e6:c6:01
85-
- eos18:
85+
- name: eos18
8686
mac: 00:1c:73:e7:c6:01
87-
- eos19:
87+
- name: eos19
8888
mac: 00:1c:73:e8:c6:01
89-
- eos20:
89+
- name: eos20
9090
mac: 00:1c:73:e9:c6:01
9191
hosts:
9292
iperf:

0 commit comments

Comments
 (0)