open-switch / opx-nas-interface

https://openswitch.net
2 stars 13 forks source link

VRF get-handler #45

Closed GarrickHe closed 6 years ago

GarrickHe commented 6 years ago

Signed-off-by: Garrick He garrick_he@dell.com

GarrickHe commented 6 years ago

Unit-test:

root@OPX:~# opx-config-vrf --create --vrf blue Configuration Successful... root@OPX:~# opx-config-vrf --show Key: 1.292.44.2883617.2883612.2883613. ni/network-instances/network-instance/name = blue Key: 1.292.44.2883617.2883612.2883613. ni/network-instances/network-instance/name = default root@OPX:~# opx-config-vrf --create --vrf red Configuration Successful... root@OPX:~# opx-config-vrf --show Key: 1.292.44.2883617.2883612.2883613. ni/network-instances/network-instance/name = red Key: 1.292.44.2883617.2883612.2883613. ni/network-instances/network-instance/name = blue Key: 1.292.44.2883617.2883612.2883613. ni/network-instances/network-instance/name = default root@OPX:~# root@OPX:~# opx-config-vrf --create --vrf green --port e101-001-0,e101-004-0 Configuration Successful... Configuration Successful... Configuration Successful... root@OPX:~# opx-config-vrf --show Key: 1.292.44.2883617.2883612.2883613. ni/network-instances/network-instance/name = green Key: 1.292.44.2883617.2883612.2883613. ni/network-instances/network-instance/name = red Key: 1.292.44.2883617.2883612.2883613. ni/network-instances/network-instance/name = blue Key: 1.292.44.2883617.2883612.2883613. ni/network-instances/network-instance/name = default root@OPX:~# opx-config-vrf --delete --vrf blue Configuration Successful... root@OPX:~# opx-config-vrf --show Key: 1.292.44.2883617.2883612.2883613. ni/network-instances/network-instance/name = green Key: 1.292.44.2883617.2883612.2883613. ni/network-instances/network-instance/name = red Key: 1.292.44.2883617.2883612.2883613. ni/network-instances/network-instance/name = default root@OPX:~# root@OPX:~# root@OPX:~# root@OPX:~# cps_set_oid.py -oper create ni/network-instances ni/network-instances/network-instance/name="management" Success Key: 1.292.19136521. ni/network-instances/network-instance/name = management cps/object-group/return-code = 0 root@OPX:~# cps_set_oid.py -oper create ni/network-instances ni/network-instances/network-instance/name="data1" Success Key: 1.292.19136521. ni/network-instances/network-instance/name = data1 cps/object-group/return-code = 0 root@OPX:~# root@OPX:~# root@OPX:~# cps_get_oid.py -qua target ni/network-instances

============1.292.44.2883617.2883612.2883613.========== ni/network-instances/network-instance/name = management

ni/network-instances/network-instance/name = green

ni/network-instances/network-instance/name = red

ni/network-instances/network-instance/name = default

root@OPX:~# cps_get_oid.py -qua target ni/network-instances ni/network-instances/network-instance/name="management"

============1.292.44.2883617.2883612.2883613.========== ni/network-instances/network-instance/name = management

root@OPX:~# cps_get_oid.py -qua target ni/network-instances ni/network-instances/network-instance/name="data1"

============1.292.44.2883617.2883612.2883613.========== ni/network-instances/network-instance/name = data1

root@OPX:~#

GarrickHe commented 6 years ago

Pull-request updated, HEAD is now b10963ab769f47111acde4465bcc2e81f6be9a34