Skip to content

Commit 6cd4db8

Browse files
updated network topology
1 parent abd89d2 commit 6cd4db8

10 files changed

Lines changed: 735 additions & 366 deletions

File tree

classes/softlayer_account/index.xml

Lines changed: 81 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,15 @@ class example():
612612
def main(self):
613613

614614
mask = """
615-
mask[attachedNetworkGateway[publicVlan,privateVlan],hardware[fullyQualifiedDomainName],
616-
network,networkSpace,primaryRouter[hostname],primarySubnet,subnets[networkIdentifier],virtualGuests[fullyQualifiedDomainName]
615+
mask[
616+
attachedNetworkGateway[publicVlan,privateVlan],
617+
hardware[fullyQualifiedDomainName,frontendNetworkComponents[uplinkComponent], backendNetworkComponents[uplinkComponent]],
618+
network,
619+
networkSpace,
620+
primaryRouter[hostname],
621+
primarySubnet,
622+
subnets[networkIdentifier],
623+
virtualGuests[fullyQualifiedDomainName]
617624
]
618625
"""
619626
orderedVlans = {}
@@ -667,80 +674,114 @@ class example():
667674
if len(orderedVlans[dc][router][vlan][vlanInner]['hardware']):
668675
print("\t\t\t ==SERVERS==")
669676
for hardware in orderedVlans[dc][router][vlan][vlanInner]['hardware']:
670-
print("\t\t\t\t%s" % hardware['fullyQualifiedDomainName'])
677+
self.printServer(hardware)
671678
if len(orderedVlans[dc][router][vlan][vlanInner]['virtualGuests']):
672679
print("\t\t\t ==VIRTUAL SERVERS==")
673680
for virtualGuest in orderedVlans[dc][router][vlan][vlanInner]['virtualGuests']:
674-
print("\t\t\t\t%s" % virtualGuest['fullyQualifiedDomainName'])
681+
self.printServer(virtualGuest)
675682
if len(orderedVlans[dc][router][vlan][vlanInner]['subnets']):
676683
print("\t\t\t ==SUBNETS==")
677684
for subnet in orderedVlans[dc][router][vlan][vlanInner]['subnets']:
678685
print("\t\t\t\t%s" % subnet['networkIdentifier'])
679686
else:
680687
print("\t\tVLAN: %s" % vlan )
681-
682688
if len(orderedVlans[dc][router][vlan]['hardware']):
683689
print("\t\t ==SERVERS==")
684690
for hardware in orderedVlans[dc][router][vlan]['hardware']:
685-
print("\t\t\t%s" % hardware['fullyQualifiedDomainName'])
691+
self.printServer(hardware)
686692
if len(orderedVlans[dc][router][vlan]['virtualGuests']):
687693
print("\t\t ==VIRTUAL SERVERS==")
688694
for vm in orderedVlans[dc][router][vlan]['virtualGuests']:
689-
print("\t\t\t%s" % vm['fullyQualifiedDomainName'])
695+
self.printServer(vm)
690696
if len(orderedVlans[dc][router][vlan]['subnets']):
691697
print("\t\t ==SUBNETS==")
692698
for subnet in orderedVlans[dc][router][vlan]['subnets']:
693699
print("\t\t\t%s" % subnet['networkIdentifier'])
694700

701+
def printServer(self, server):
702+
print("\t\t\t%s" % server['fullyQualifiedDomainName'])
703+
# pp(server)
704+
if 'frontendNetworkComponents' in server:
705+
for eth in server['frontendNetworkComponents']:
706+
switch = eth['uplinkComponent']['hardware']['hostname']
707+
switch_port = eth['uplinkComponent']['port']
708+
print("\t\t\t\teth%s => %s:%s " % (eth['port'],switch,switch_port))
709+
if 'backendNetworkComponents' in server:
710+
for eth in server['backendNetworkComponents']:
711+
switch = eth['uplinkComponent']['hardware']['hostname']
712+
switch_port = eth['uplinkComponent']['port']
713+
print("\t\t\t\teth%s => %s:%s " % (eth['port'],switch,switch_port))
714+
695715

696716
if __name__ == "__main__":
697717
main = example()
698718
main.main()
699-
700719
</code></pre>
701720

702721
<p>Example Output:</p>
703722

704723
<pre><code>DC: sjc03
705724
Router: bcr02a
706-
VLAN: 904
725+
VLAN: 1253
726+
==SERVERS==
727+
jd-centos-6-5.secore.com
728+
eth1 => fcs421a.sr01.sjc03:19
729+
eth3 => fcs421b.sr01.sjc03:19
730+
eth0 => bcs421a.sr01.sjc03:19
731+
eth0 => bms421.sr01.sjc03:19
732+
eth2 => bcs421b.sr01.sjc03:19
707733
==VIRTUAL SERVERS==
708-
jrh-jump.poc.engineering
734+
CW-SJC.softlayer.com
709735
==SUBNETS==
710-
10.168.140.0
711-
Router: bcr01a
712-
GATEWAY VLAN: 1436
713-
VLAN: 1440
736+
10.168.30.0
737+
10.168.174.128
738+
10.168.174.192
739+
GATEWAY VLAN: 1310
740+
VLAN: 1288
714741
==SERVERS==
715-
jd-test-5600-srv.secore.com
716-
jd-cos-testing-sjc03.secore.com
742+
kramvcs-esx0.vmonic.local
743+
eth1 => fcs422a.sr01.sjc03:37
744+
eth3 => fcs422b.sr01.sjc03:37
745+
eth0 => bcs422a.sr01.sjc03:37
746+
eth0 => bms422.sr01.sjc03:37
747+
eth2 => bcs422b.sr01.sjc03:37
748+
kramvcs-esx1.vmonic.local
749+
eth1 => fcs422a.sr01.sjc03:40
750+
eth3 => fcs422b.sr01.sjc03:40
751+
eth0 => bcs422a.sr01.sjc03:40
752+
eth0 => bms422.sr01.sjc03:40
753+
eth2 => bcs422b.sr01.sjc03:40
754+
==VIRTUAL SERVERS==
755+
kramjump.seteam.net
756+
kramvcsveeam.vmonic.local
757+
zerto.kramVCS.vmonic.local
717758
==SUBNETS==
718-
10.161.111.64
719-
==SERVERS==
720-
jd-5600-test.secore.com
721-
==SUBNETS==
722-
10.161.110.0
723-
Router: fcr02a
724-
VLAN: 857
725-
==VIRTUAL SERVERS==
726-
jrh-jump.poc.engineering
727-
==SUBNETS==
728-
169.44.183.224
729-
Router: fcr01a
730-
VLAN: 1296
731-
==SERVERS==
732-
jd-test-5600-srv.secore.com
733-
jd-cos-testing-sjc03.secore.com
734-
==SUBNETS==
735-
169.45.115.16
736-
2607:f0d0:2601:00cc:0000:0000:0000:0000
737-
VLAN: 1273
759+
10.168.117.128
760+
10.168.137.128
761+
10.168.212.128
762+
10.168.212.192
763+
10.169.200.64
738764
==SERVERS==
739-
jd-5600-test.secore.com
765+
jd-5600-1u-test-2.secore.com
766+
eth1 => fcs377a.sr01.sjc03:11
767+
eth3 => fcs377b.sr01.sjc03:11
768+
eth0 => bcs377a.sr01.sjc03:11
769+
eth0 => bms377.sr01.sjc03:11
770+
eth2 => bcs377b.sr01.sjc03:11
771+
jd-5600-test-sjc03-2.secore.com
772+
eth1 => fcs487a.sr01.sjc03:20
773+
eth3 => fcs487b.sr01.sjc03:20
774+
eth0 => bcs487a.sr01.sjc03:20
775+
eth0 => bms487.sr01.sjc03:20
776+
eth2 => bcs487b.sr01.sjc03:20
777+
jd-5600-1u-test-1.secore.com
778+
eth1 => fcs390a.sr01.sjc03:6
779+
eth3 => fcs390b.sr01.sjc03:6
780+
eth0 => bcs390a.sr01.sjc03:6
781+
eth0 => bms390.sr01.sjc03:6
782+
eth2 => bcs390b.sr01.sjc03:6
740783
==SUBNETS==
741-
169.44.136.64
742-
2607:f0d0:2601:0065:0000:0000:0000:0000
743-
2607:f0d0:2601:00ac:0000:0000:0000:0000
784+
10.168.63.0
744785
</code></pre>
745786
</description>
746787
</item>

classes/softlayer_network_gateway/index.xml

Lines changed: 81 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,15 @@ class example():
3030
def main(self):
3131

3232
mask = &amp;quot;&amp;quot;&amp;quot;
33-
mask[attachedNetworkGateway[publicVlan,privateVlan],hardware[fullyQualifiedDomainName],
34-
network,networkSpace,primaryRouter[hostname],primarySubnet,subnets[networkIdentifier],virtualGuests[fullyQualifiedDomainName]
33+
mask[
34+
attachedNetworkGateway[publicVlan,privateVlan],
35+
hardware[fullyQualifiedDomainName,frontendNetworkComponents[uplinkComponent], backendNetworkComponents[uplinkComponent]],
36+
network,
37+
networkSpace,
38+
primaryRouter[hostname],
39+
primarySubnet,
40+
subnets[networkIdentifier],
41+
virtualGuests[fullyQualifiedDomainName]
3542
]
3643
&amp;quot;&amp;quot;&amp;quot;
3744
orderedVlans = {}
@@ -85,80 +92,114 @@ class example():
8592
if len(orderedVlans[dc][router][vlan][vlanInner][&#39;hardware&#39;]):
8693
print(&amp;quot;\t\t\t ==SERVERS==&amp;quot;)
8794
for hardware in orderedVlans[dc][router][vlan][vlanInner][&#39;hardware&#39;]:
88-
print(&amp;quot;\t\t\t\t%s&amp;quot; % hardware[&#39;fullyQualifiedDomainName&#39;])
95+
self.printServer(hardware)
8996
if len(orderedVlans[dc][router][vlan][vlanInner][&#39;virtualGuests&#39;]):
9097
print(&amp;quot;\t\t\t ==VIRTUAL SERVERS==&amp;quot;)
9198
for virtualGuest in orderedVlans[dc][router][vlan][vlanInner][&#39;virtualGuests&#39;]:
92-
print(&amp;quot;\t\t\t\t%s&amp;quot; % virtualGuest[&#39;fullyQualifiedDomainName&#39;])
99+
self.printServer(virtualGuest)
93100
if len(orderedVlans[dc][router][vlan][vlanInner][&#39;subnets&#39;]):
94101
print(&amp;quot;\t\t\t ==SUBNETS==&amp;quot;)
95102
for subnet in orderedVlans[dc][router][vlan][vlanInner][&#39;subnets&#39;]:
96103
print(&amp;quot;\t\t\t\t%s&amp;quot; % subnet[&#39;networkIdentifier&#39;])
97104
else:
98105
print(&amp;quot;\t\tVLAN: %s&amp;quot; % vlan )
99-
100106
if len(orderedVlans[dc][router][vlan][&#39;hardware&#39;]):
101107
print(&amp;quot;\t\t ==SERVERS==&amp;quot;)
102108
for hardware in orderedVlans[dc][router][vlan][&#39;hardware&#39;]:
103-
print(&amp;quot;\t\t\t%s&amp;quot; % hardware[&#39;fullyQualifiedDomainName&#39;])
109+
self.printServer(hardware)
104110
if len(orderedVlans[dc][router][vlan][&#39;virtualGuests&#39;]):
105111
print(&amp;quot;\t\t ==VIRTUAL SERVERS==&amp;quot;)
106112
for vm in orderedVlans[dc][router][vlan][&#39;virtualGuests&#39;]:
107-
print(&amp;quot;\t\t\t%s&amp;quot; % vm[&#39;fullyQualifiedDomainName&#39;])
113+
self.printServer(vm)
108114
if len(orderedVlans[dc][router][vlan][&#39;subnets&#39;]):
109115
print(&amp;quot;\t\t ==SUBNETS==&amp;quot;)
110116
for subnet in orderedVlans[dc][router][vlan][&#39;subnets&#39;]:
111117
print(&amp;quot;\t\t\t%s&amp;quot; % subnet[&#39;networkIdentifier&#39;])
112118

119+
def printServer(self, server):
120+
print(&amp;quot;\t\t\t%s&amp;quot; % server[&#39;fullyQualifiedDomainName&#39;])
121+
# pp(server)
122+
if &#39;frontendNetworkComponents&#39; in server:
123+
for eth in server[&#39;frontendNetworkComponents&#39;]:
124+
switch = eth[&#39;uplinkComponent&#39;][&#39;hardware&#39;][&#39;hostname&#39;]
125+
switch_port = eth[&#39;uplinkComponent&#39;][&#39;port&#39;]
126+
print(&amp;quot;\t\t\t\teth%s =&amp;gt; %s:%s &amp;quot; % (eth[&#39;port&#39;],switch,switch_port))
127+
if &#39;backendNetworkComponents&#39; in server:
128+
for eth in server[&#39;backendNetworkComponents&#39;]:
129+
switch = eth[&#39;uplinkComponent&#39;][&#39;hardware&#39;][&#39;hostname&#39;]
130+
switch_port = eth[&#39;uplinkComponent&#39;][&#39;port&#39;]
131+
print(&amp;quot;\t\t\t\teth%s =&amp;gt; %s:%s &amp;quot; % (eth[&#39;port&#39;],switch,switch_port))
132+
113133

114134
if __name__ == &amp;quot;__main__&amp;quot;:
115135
main = example()
116136
main.main()
117-
118137
&lt;/code&gt;&lt;/pre&gt;
119138

120139
&lt;p&gt;Example Output:&lt;/p&gt;
121140

122141
&lt;pre&gt;&lt;code&gt;DC: sjc03
123142
Router: bcr02a
124-
VLAN: 904
143+
VLAN: 1253
144+
==SERVERS==
145+
jd-centos-6-5.secore.com
146+
eth1 =&amp;gt; fcs421a.sr01.sjc03:19
147+
eth3 =&amp;gt; fcs421b.sr01.sjc03:19
148+
eth0 =&amp;gt; bcs421a.sr01.sjc03:19
149+
eth0 =&amp;gt; bms421.sr01.sjc03:19
150+
eth2 =&amp;gt; bcs421b.sr01.sjc03:19
125151
==VIRTUAL SERVERS==
126-
jrh-jump.poc.engineering
152+
CW-SJC.softlayer.com
127153
==SUBNETS==
128-
10.168.140.0
129-
Router: bcr01a
130-
GATEWAY VLAN: 1436
131-
VLAN: 1440
154+
10.168.30.0
155+
10.168.174.128
156+
10.168.174.192
157+
GATEWAY VLAN: 1310
158+
VLAN: 1288
132159
==SERVERS==
133-
jd-test-5600-srv.secore.com
134-
jd-cos-testing-sjc03.secore.com
160+
kramvcs-esx0.vmonic.local
161+
eth1 =&amp;gt; fcs422a.sr01.sjc03:37
162+
eth3 =&amp;gt; fcs422b.sr01.sjc03:37
163+
eth0 =&amp;gt; bcs422a.sr01.sjc03:37
164+
eth0 =&amp;gt; bms422.sr01.sjc03:37
165+
eth2 =&amp;gt; bcs422b.sr01.sjc03:37
166+
kramvcs-esx1.vmonic.local
167+
eth1 =&amp;gt; fcs422a.sr01.sjc03:40
168+
eth3 =&amp;gt; fcs422b.sr01.sjc03:40
169+
eth0 =&amp;gt; bcs422a.sr01.sjc03:40
170+
eth0 =&amp;gt; bms422.sr01.sjc03:40
171+
eth2 =&amp;gt; bcs422b.sr01.sjc03:40
172+
==VIRTUAL SERVERS==
173+
kramjump.seteam.net
174+
kramvcsveeam.vmonic.local
175+
zerto.kramVCS.vmonic.local
135176
==SUBNETS==
136-
10.161.111.64
137-
==SERVERS==
138-
jd-5600-test.secore.com
139-
==SUBNETS==
140-
10.161.110.0
141-
Router: fcr02a
142-
VLAN: 857
143-
==VIRTUAL SERVERS==
144-
jrh-jump.poc.engineering
145-
==SUBNETS==
146-
169.44.183.224
147-
Router: fcr01a
148-
VLAN: 1296
149-
==SERVERS==
150-
jd-test-5600-srv.secore.com
151-
jd-cos-testing-sjc03.secore.com
152-
==SUBNETS==
153-
169.45.115.16
154-
2607:f0d0:2601:00cc:0000:0000:0000:0000
155-
VLAN: 1273
177+
10.168.117.128
178+
10.168.137.128
179+
10.168.212.128
180+
10.168.212.192
181+
10.169.200.64
156182
==SERVERS==
157-
jd-5600-test.secore.com
183+
jd-5600-1u-test-2.secore.com
184+
eth1 =&amp;gt; fcs377a.sr01.sjc03:11
185+
eth3 =&amp;gt; fcs377b.sr01.sjc03:11
186+
eth0 =&amp;gt; bcs377a.sr01.sjc03:11
187+
eth0 =&amp;gt; bms377.sr01.sjc03:11
188+
eth2 =&amp;gt; bcs377b.sr01.sjc03:11
189+
jd-5600-test-sjc03-2.secore.com
190+
eth1 =&amp;gt; fcs487a.sr01.sjc03:20
191+
eth3 =&amp;gt; fcs487b.sr01.sjc03:20
192+
eth0 =&amp;gt; bcs487a.sr01.sjc03:20
193+
eth0 =&amp;gt; bms487.sr01.sjc03:20
194+
eth2 =&amp;gt; bcs487b.sr01.sjc03:20
195+
jd-5600-1u-test-1.secore.com
196+
eth1 =&amp;gt; fcs390a.sr01.sjc03:6
197+
eth3 =&amp;gt; fcs390b.sr01.sjc03:6
198+
eth0 =&amp;gt; bcs390a.sr01.sjc03:6
199+
eth0 =&amp;gt; bms390.sr01.sjc03:6
200+
eth2 =&amp;gt; bcs390b.sr01.sjc03:6
158201
==SUBNETS==
159-
169.44.136.64
160-
2607:f0d0:2601:0065:0000:0000:0000:0000
161-
2607:f0d0:2601:00ac:0000:0000:0000:0000
202+
10.168.63.0
162203
&lt;/code&gt;&lt;/pre&gt;
163204
</description>
164205
</item>

0 commit comments

Comments
 (0)