@@ -612,8 +612,15 @@ class example():
612612 def main(self):
613613
614614 mask = & quot;& quot;& quot;
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 & quot;& quot;& quot;
619626 orderedVlans = {}
@@ -667,80 +674,114 @@ class example():
667674 if len(orderedVlans[dc][router][vlan][vlanInner][' hardware' ]):
668675 print(& quot;\t\t\t ==SERVERS==& quot;)
669676 for hardware in orderedVlans[dc][router][vlan][vlanInner][' hardware' ]:
670- print( & quot;\t\t\t\t%s & quot; % hardware[ ' fullyQualifiedDomainName ' ] )
677+ self.printServer( hardware)
671678 if len(orderedVlans[dc][router][vlan][vlanInner][' virtualGuests' ]):
672679 print(& quot;\t\t\t ==VIRTUAL SERVERS==& quot;)
673680 for virtualGuest in orderedVlans[dc][router][vlan][vlanInner][' virtualGuests' ]:
674- print( & quot;\t\t\t\t%s & quot; % virtualGuest[ ' fullyQualifiedDomainName ' ] )
681+ self.printServer( virtualGuest)
675682 if len(orderedVlans[dc][router][vlan][vlanInner][' subnets' ]):
676683 print(& quot;\t\t\t ==SUBNETS==& quot;)
677684 for subnet in orderedVlans[dc][router][vlan][vlanInner][' subnets' ]:
678685 print(& quot;\t\t\t\t%s& quot; % subnet[' networkIdentifier' ])
679686 else:
680687 print(& quot;\t\tVLAN: %s& quot; % vlan )
681-
682688 if len(orderedVlans[dc][router][vlan][' hardware' ]):
683689 print(& quot;\t\t ==SERVERS==& quot;)
684690 for hardware in orderedVlans[dc][router][vlan][' hardware' ]:
685- print( & quot;\t\t\t%s & quot; % hardware[ ' fullyQualifiedDomainName ' ] )
691+ self.printServer( hardware)
686692 if len(orderedVlans[dc][router][vlan][' virtualGuests' ]):
687693 print(& quot;\t\t ==VIRTUAL SERVERS==& quot;)
688694 for vm in orderedVlans[dc][router][vlan][' virtualGuests' ]:
689- print( & quot;\t\t\t%s & quot; % vm[ ' fullyQualifiedDomainName ' ] )
695+ self.printServer(vm )
690696 if len(orderedVlans[dc][router][vlan][' subnets' ]):
691697 print(& quot;\t\t ==SUBNETS==& quot;)
692698 for subnet in orderedVlans[dc][router][vlan][' subnets' ]:
693699 print(& quot;\t\t\t%s& quot; % subnet[' networkIdentifier' ])
694700
701+ def printServer(self, server):
702+ print(& quot;\t\t\t%s& quot; % 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(& quot;\t\t\t\teth%s =& gt; %s:%s & quot; % (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(& quot;\t\t\t\teth%s =& gt; %s:%s & quot; % (eth[' port' ],switch,switch_port))
714+
695715
696716if __name__ == & quot;__main__& quot;:
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 =& gt; fcs421a.sr01.sjc03:19
729+ eth3 =& gt; fcs421b.sr01.sjc03:19
730+ eth0 =& gt; bcs421a.sr01.sjc03:19
731+ eth0 =& gt; bms421.sr01.sjc03:19
732+ eth2 =& gt; 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 =& gt; fcs422a.sr01.sjc03:37
744+ eth3 =& gt; fcs422b.sr01.sjc03:37
745+ eth0 =& gt; bcs422a.sr01.sjc03:37
746+ eth0 =& gt; bms422.sr01.sjc03:37
747+ eth2 =& gt; bcs422b.sr01.sjc03:37
748+ kramvcs-esx1.vmonic.local
749+ eth1 =& gt; fcs422a.sr01.sjc03:40
750+ eth3 =& gt; fcs422b.sr01.sjc03:40
751+ eth0 =& gt; bcs422a.sr01.sjc03:40
752+ eth0 =& gt; bms422.sr01.sjc03:40
753+ eth2 =& gt; 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 =& gt; fcs377a.sr01.sjc03:11
767+ eth3 =& gt; fcs377b.sr01.sjc03:11
768+ eth0 =& gt; bcs377a.sr01.sjc03:11
769+ eth0 =& gt; bms377.sr01.sjc03:11
770+ eth2 =& gt; bcs377b.sr01.sjc03:11
771+ jd-5600-test-sjc03-2.secore.com
772+ eth1 =& gt; fcs487a.sr01.sjc03:20
773+ eth3 =& gt; fcs487b.sr01.sjc03:20
774+ eth0 =& gt; bcs487a.sr01.sjc03:20
775+ eth0 =& gt; bms487.sr01.sjc03:20
776+ eth2 =& gt; bcs487b.sr01.sjc03:20
777+ jd-5600-1u-test-1.secore.com
778+ eth1 =& gt; fcs390a.sr01.sjc03:6
779+ eth3 =& gt; fcs390b.sr01.sjc03:6
780+ eth0 =& gt; bcs390a.sr01.sjc03:6
781+ eth0 =& gt; bms390.sr01.sjc03:6
782+ eth2 =& gt; 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 >
0 commit comments