-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1398 from minefuto/junos_get_vlans
Add get_vlans for Junos
- Loading branch information
Showing
11 changed files
with
374 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
test/junos/mocked_data/test_get_vlans/bridge_domain/expected_result.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"10": { | ||
"name": "VLAN10", | ||
"interfaces": [ | ||
"ge-2/0/1.0", | ||
"ge-2/0/2.0", | ||
"ge-2/0/3.0" | ||
] | ||
}, | ||
"2": { | ||
"name": "VLAN2", | ||
"interfaces": [ | ||
"ge-2/0/1.0" | ||
] | ||
}, | ||
"300": { | ||
"name": "VLAN300", | ||
"interfaces": [] | ||
}, | ||
"4000": { | ||
"name": "VLAN4000", | ||
"interfaces": [ | ||
"xe-1/0/0.0", | ||
"xe-1/2/0.0" | ||
] | ||
}, | ||
"4001": { | ||
"name": "VLAN4001", | ||
"interfaces": [] | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
test/junos/mocked_data/test_get_vlans/bridge_domain/facts.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
personality: MX | ||
switch_style: BRIDGE_DOMAIN |
35 changes: 35 additions & 0 deletions
35
test/junos/mocked_data/test_get_vlans/bridge_domain/get-bridge-instance-information.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<l2ald-bridge-instance-information> | ||
<l2ald-bridge-instance-group> | ||
<l2rtb-brief-summary/> | ||
<l2rtb-name>default-switch</l2rtb-name> | ||
<l2rtb-bridging-domain>VLAN10</l2rtb-bridging-domain> | ||
<l2rtb-bridge-vlan>10</l2rtb-bridge-vlan> | ||
<l2rtb-interface-name>ge-2/0/1.0</l2rtb-interface-name> | ||
<l2rtb-interface-name>ge-2/0/2.0</l2rtb-interface-name> | ||
<l2rtb-interface-name>ge-2/0/3.0</l2rtb-interface-name> | ||
</l2ald-bridge-instance-group> | ||
<l2ald-bridge-instance-group> | ||
<l2rtb-name>default-switch</l2rtb-name> | ||
<l2rtb-bridging-domain>VLAN2</l2rtb-bridging-domain> | ||
<l2rtb-bridge-vlan>2</l2rtb-bridge-vlan> | ||
<l2rtb-interface-name>ge-2/0/1.0</l2rtb-interface-name> | ||
</l2ald-bridge-instance-group> | ||
<l2ald-bridge-instance-group> | ||
<l2rtb-name>default-switch</l2rtb-name> | ||
<l2rtb-bridging-domain>VLAN300</l2rtb-bridging-domain> | ||
<l2rtb-bridge-vlan>300</l2rtb-bridge-vlan> | ||
<l2rtb-interface-name/> | ||
</l2ald-bridge-instance-group> | ||
<l2ald-bridge-instance-group> | ||
<l2rtb-name>default-switch</l2rtb-name> | ||
<l2rtb-bridging-domain>VLAN4000</l2rtb-bridging-domain> | ||
<l2rtb-bridge-vlan>4000</l2rtb-bridge-vlan> | ||
<l2rtb-interface-name>xe-1/0/0.0</l2rtb-interface-name> | ||
<l2rtb-interface-name>xe-1/2/0.0</l2rtb-interface-name> | ||
</l2ald-bridge-instance-group> | ||
<l2ald-bridge-instance-group> | ||
<l2rtb-name>default-switch</l2rtb-name> | ||
<l2rtb-bridging-domain>VLAN4001</l2rtb-bridging-domain> | ||
<l2rtb-bridge-vlan>4001</l2rtb-bridge-vlan> | ||
</l2ald-bridge-instance-group> | ||
</l2ald-bridge-instance-information> |
33 changes: 33 additions & 0 deletions
33
test/junos/mocked_data/test_get_vlans/vlan/expected_result.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"10": { | ||
"name": "VLAN10", | ||
"interfaces": [ | ||
"ge-0/0/1.0", | ||
"ge-0/0/2.0", | ||
"ge-0/0/3.0" | ||
] | ||
}, | ||
"2": { | ||
"name": "VLAN2", | ||
"interfaces": [ | ||
"ge-0/0/1.0" | ||
] | ||
}, | ||
"300": { | ||
"name": "VLAN300", | ||
"interfaces": [] | ||
}, | ||
"4000": { | ||
"name": "VLAN4000", | ||
"interfaces": [ | ||
"ge-0/0/4.0", | ||
"ge-0/0/5.0" | ||
] | ||
}, | ||
"0": { | ||
"name": "default", | ||
"interfaces": [ | ||
"ge-0/0/0.0" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
personality: SWITCH | ||
switch_style: VLAN |
114 changes: 114 additions & 0 deletions
114
test/junos/mocked_data/test_get_vlans/vlan/get-vlan-information.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<vlan-information> | ||
<vlan-terse/> | ||
<vlan> | ||
<vlan-instance>0</vlan-instance> | ||
<vlan-name>VLAN10</vlan-name> | ||
<vlan-create-time>Fri Mar 12 11:32:21 2021 | ||
</vlan-create-time> | ||
<vlan-status>Enabled</vlan-status> | ||
<vlan-owner>static</vlan-owner> | ||
<vlan-tag>10</vlan-tag> | ||
<vlan-tag-string>10</vlan-tag-string> | ||
<vlan-index>53</vlan-index> | ||
<vlan-protocol-port>Port Mode</vlan-protocol-port> | ||
<vlan-members-count>3</vlan-members-count> | ||
<vlan-members-upcount>1</vlan-members-upcount> | ||
<vlan-detail> | ||
<vlan-member-list> | ||
<vlan-member> | ||
<vlan-member-interface>ge-0/0/1.0*</vlan-member-interface> | ||
</vlan-member> | ||
<vlan-member> | ||
<vlan-member-interface>ge-0/0/2.0</vlan-member-interface> | ||
</vlan-member> | ||
<vlan-member> | ||
<vlan-member-interface>ge-0/0/3.0</vlan-member-interface> | ||
</vlan-member> | ||
</vlan-member-list> | ||
</vlan-detail> | ||
</vlan> | ||
<vlan> | ||
<vlan-instance>0</vlan-instance> | ||
<vlan-name>VLAN2</vlan-name> | ||
<vlan-create-time>Fri Mar 12 11:32:21 2021 | ||
</vlan-create-time> | ||
<vlan-status>Enabled</vlan-status> | ||
<vlan-owner>static</vlan-owner> | ||
<vlan-tag>2</vlan-tag> | ||
<vlan-tag-string>2</vlan-tag-string> | ||
<vlan-index>54</vlan-index> | ||
<vlan-protocol-port>Port Mode</vlan-protocol-port> | ||
<vlan-members-count>1</vlan-members-count> | ||
<vlan-members-upcount>1</vlan-members-upcount> | ||
<vlan-detail> | ||
<vlan-member-list> | ||
<vlan-member> | ||
<vlan-member-interface>ge-0/0/1.0*</vlan-member-interface> | ||
</vlan-member> | ||
</vlan-member-list> | ||
</vlan-detail> | ||
</vlan> | ||
<vlan> | ||
<vlan-instance>0</vlan-instance> | ||
<vlan-name>VLAN300</vlan-name> | ||
<vlan-create-time>Fri Mar 12 11:32:21 2021 | ||
</vlan-create-time> | ||
<vlan-status>Enabled</vlan-status> | ||
<vlan-owner>static</vlan-owner> | ||
<vlan-tag>300</vlan-tag> | ||
<vlan-tag-string>300</vlan-tag-string> | ||
<vlan-index>55</vlan-index> | ||
<vlan-protocol-port>Port Mode</vlan-protocol-port> | ||
<vlan-detail> | ||
<vlan-member-list> | ||
<vlan-member> | ||
<vlan-member-interface>None</vlan-member-interface> | ||
</vlan-member> | ||
</vlan-member-list> | ||
</vlan-detail> | ||
</vlan> | ||
<vlan> | ||
<vlan-instance>0</vlan-instance> | ||
<vlan-name>VLAN4000</vlan-name> | ||
<vlan-create-time>Fri Mar 12 11:32:21 2021 | ||
</vlan-create-time> | ||
<vlan-status>Enabled</vlan-status> | ||
<vlan-owner>static</vlan-owner> | ||
<vlan-tag>4000</vlan-tag> | ||
<vlan-tag-string>4000</vlan-tag-string> | ||
<vlan-index>56</vlan-index> | ||
<vlan-protocol-port>Port Mode</vlan-protocol-port> | ||
<vlan-members-count>2</vlan-members-count> | ||
<vlan-members-upcount>0</vlan-members-upcount> | ||
<vlan-detail> | ||
<vlan-member-list> | ||
<vlan-member> | ||
<vlan-member-interface>ge-0/0/4.0</vlan-member-interface> | ||
</vlan-member> | ||
<vlan-member> | ||
<vlan-member-interface>ge-0/0/5.0</vlan-member-interface> | ||
</vlan-member> | ||
</vlan-member-list> | ||
</vlan-detail> | ||
</vlan> | ||
<vlan> | ||
<vlan-instance>0</vlan-instance> | ||
<vlan-name>default</vlan-name> | ||
<vlan-create-time>Fri Dec 25 07:14:42 2020 | ||
</vlan-create-time> | ||
<vlan-status>Enabled</vlan-status> | ||
<vlan-owner>static</vlan-owner> | ||
<vlan-tag>0</vlan-tag> | ||
<vlan-index>2</vlan-index> | ||
<vlan-protocol-port>Port Mode</vlan-protocol-port> | ||
<vlan-members-count>1</vlan-members-count> | ||
<vlan-members-upcount>1</vlan-members-upcount> | ||
<vlan-detail> | ||
<vlan-member-list> | ||
<vlan-member> | ||
<vlan-member-interface>ge-0/0/0.0*</vlan-member-interface> | ||
</vlan-member> | ||
</vlan-member-list> | ||
</vlan-detail> | ||
</vlan> | ||
</vlan-information> |
33 changes: 33 additions & 0 deletions
33
test/junos/mocked_data/test_get_vlans/vlan_l2ng/expected_result.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"10": { | ||
"name": "VLAN10", | ||
"interfaces": [ | ||
"xe-0/0/1.0", | ||
"xe-0/0/2.0", | ||
"xe-0/0/3.0" | ||
] | ||
}, | ||
"2": { | ||
"name": "VLAN2", | ||
"interfaces": [ | ||
"xe-0/0/1.0" | ||
] | ||
}, | ||
"300": { | ||
"name": "VLAN300", | ||
"interfaces": [] | ||
}, | ||
"4000": { | ||
"name": "VLAN4000", | ||
"interfaces": [ | ||
"xe-0/0/4.0", | ||
"xe-0/0/5.0" | ||
] | ||
}, | ||
"1": { | ||
"name": "default", | ||
"interfaces": [ | ||
"xe-0/0/0.0" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
personality: SWITCH | ||
switch_style: VLAN_L2NG |
52 changes: 52 additions & 0 deletions
52
test/junos/mocked_data/test_get_vlans/vlan_l2ng/get-vlan-information.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<vlan-information> | ||
<l2ng-l2ald-vlan-instance-group> | ||
<l2ng-l2rtb-brief-summary/> | ||
<l2ng-l2rtb-name>default-switch</l2ng-l2rtb-name> | ||
<l2ng-l2rtb-vlan-name>VLAN10</l2ng-l2rtb-vlan-name> | ||
<l2ng-l2rtb-vlan-tag>10</l2ng-l2rtb-vlan-tag> | ||
<l2ng-l2rtb-vlan-member> | ||
<l2ng-l2rtb-vlan-member-interface>xe-0/0/1.0</l2ng-l2rtb-vlan-member-interface> | ||
</l2ng-l2rtb-vlan-member> | ||
<l2ng-l2rtb-vlan-member> | ||
<l2ng-l2rtb-vlan-member-interface>xe-0/0/2.0*</l2ng-l2rtb-vlan-member-interface> | ||
</l2ng-l2rtb-vlan-member> | ||
<l2ng-l2rtb-vlan-member> | ||
<l2ng-l2rtb-vlan-member-interface>xe-0/0/3.0*</l2ng-l2rtb-vlan-member-interface> | ||
</l2ng-l2rtb-vlan-member> | ||
</l2ng-l2ald-vlan-instance-group> | ||
<l2ng-l2ald-vlan-instance-group> | ||
<l2ng-l2rtb-name>default-switch</l2ng-l2rtb-name> | ||
<l2ng-l2rtb-vlan-name>VLAN2</l2ng-l2rtb-vlan-name> | ||
<l2ng-l2rtb-vlan-tag>2</l2ng-l2rtb-vlan-tag> | ||
<l2ng-l2rtb-vlan-member> | ||
<l2ng-l2rtb-vlan-member-interface>xe-0/0/1.0</l2ng-l2rtb-vlan-member-interface> | ||
</l2ng-l2rtb-vlan-member> | ||
</l2ng-l2ald-vlan-instance-group> | ||
<l2ng-l2ald-vlan-instance-group> | ||
<l2ng-l2rtb-name>default-switch</l2ng-l2rtb-name> | ||
<l2ng-l2rtb-vlan-name>VLAN300</l2ng-l2rtb-vlan-name> | ||
<l2ng-l2rtb-vlan-tag>300</l2ng-l2rtb-vlan-tag> | ||
<l2ng-l2rtb-vlan-member> | ||
<l2ng-l2rtb-vlan-member-interface/> | ||
</l2ng-l2rtb-vlan-member> | ||
</l2ng-l2ald-vlan-instance-group> | ||
<l2ng-l2ald-vlan-instance-group> | ||
<l2ng-l2rtb-name>default-switch</l2ng-l2rtb-name> | ||
<l2ng-l2rtb-vlan-name>VLAN4000</l2ng-l2rtb-vlan-name> | ||
<l2ng-l2rtb-vlan-tag>4000</l2ng-l2rtb-vlan-tag> | ||
<l2ng-l2rtb-vlan-member> | ||
<l2ng-l2rtb-vlan-member-interface>xe-0/0/4.0*</l2ng-l2rtb-vlan-member-interface> | ||
</l2ng-l2rtb-vlan-member> | ||
<l2ng-l2rtb-vlan-member> | ||
<l2ng-l2rtb-vlan-member-interface>xe-0/0/5.0*</l2ng-l2rtb-vlan-member-interface> | ||
</l2ng-l2rtb-vlan-member> | ||
</l2ng-l2ald-vlan-instance-group> | ||
<l2ng-l2ald-vlan-instance-group> | ||
<l2ng-l2rtb-name>default-switch</l2ng-l2rtb-name> | ||
<l2ng-l2rtb-vlan-name>default</l2ng-l2rtb-vlan-name> | ||
<l2ng-l2rtb-vlan-tag>1</l2ng-l2rtb-vlan-tag> | ||
<l2ng-l2rtb-vlan-member> | ||
<l2ng-l2rtb-vlan-member-interface>xe-0/0/0.0</l2ng-l2rtb-vlan-member-interface> | ||
</l2ng-l2rtb-vlan-member> | ||
</l2ng-l2ald-vlan-instance-group> | ||
</vlan-information> |