11-08-2019 10:57 AM
I am developing a service to configure an interface on cisco ncs switch (runs ios-xr)
The configuration looks like this:
interface Loopback0 ipv4 address 'masked' ipv6 address 'masked' ! interface Bundle-Ether1 description << Bundle-Ether 1 >> mtu 9180 ipv6 nd suppress-ra ipv6 enable load-interval 30 ipv4 address 'masked' ipv6 address 'masked' ! interface HundredGigE0/0/1/0 description << Bundle-Ether1 >> bundle id 1 mode active shutdown ! interface Bundle-Ether2 description << Bundle-Ether 2 >> mtu 9180 ipv6 nd suppress-ra ipv6 enable load-interval 30 ipv4 address 'masked' ipv6 address 'masked' ! interface TenGigE0/0/0/0 description << channel1-bundle-Ether2 >> bundle id 2 mode active ! interface TenGigE0/0/0/1 shutdown !
The yang model looks like this:
list my_interface { tailf:info "my interface setup"; key "device interface"; uses ncs:service-data; ncs:servicepoint my_interface-servicepoint; leaf device { tailf:info "Device name"; type leafref { path "/ncs:devices/ncs:device/ncs:name"; } } leaf interface { tailf:info "Interface name"; type string; } leaf description { tailf:info "Mandatory description field"; type string; mandatory true; } leaf v4-address { tailf:info "IPv4 address of the interface"; type inet:ipv4-address; } leaf v4-mask { tailf:info "IPv4 subnet mask"; type inet:ipv4-address; } leaf v6-address { tailf:info "IPv6 address of the interface"; type inet:ipv6-address; } leaf v6-mask { tailf:info "IPv6 subnet mask"; type inet:ipv6-address; } } }
Am on the right track that I can create leaf objects for the attributes I need per the configuration?
11-08-2019 11:32 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide