I'm trying to build L2VPN service in which we need to allow a range of vlans in the customer side. The configuration is as follow:
device {
name ME0
data interface GigabitEthernet0/2
no switchport
service instance 2 ethernet
encapsulation dot1q 2-10,60
bridge-domain 2
exit
no shutdown
exit
}
The xml template is as follow:
result-xml <devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name>ME0</name>
<config>
<interface xmlns="urn:ios">
<GigabitEthernet>
<name>0/2</name>
<service>
<instance>
<id>2</id>
<ethernet/>
<encapsulation>
<dot1q>
<id>2</id>
<id>3</id>
<id>4</id>
<id>5</id>
<id>6</id>
<id>7</id>
<id>8</id>
<id>9</id>
<id>10</id>
<id>60</id>
</dot1q>
</encapsulation>
<bridge-domain>
<bridge-id>2</bridge-id>
</bridge-domain>
</instance>
</service>
</GigabitEthernet>
</interface>
</config>
</device>
</devices>
The question is how to orchestrate this range of vlans and how to translate the output of vlan range from yang model into xml file.
Note that in this service, the customer will enter the first and the last vlan and NSO will configure this range under the interface.
Thank you.