Skip to content
Snippets Groups Projects
Commit 476fd720 authored by PabloArmingolRobles's avatar PabloArmingolRobles
Browse files

L2-VPN

parent 23b42b08
No related branches found
No related tags found
2 merge requests!54Release 2.0.0,!4Compute component:
...@@ -37,6 +37,10 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: ...@@ -37,6 +37,10 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]:
#interface_type = xml_interface.find('oci:config/oci:type', namespaces=NAMESPACES) #interface_type = xml_interface.find('oci:config/oci:type', namespaces=NAMESPACES)
#add_value_from_tag(interface, 'type', interface_type) #add_value_from_tag(interface, 'type', interface_type)
interface_type = xml_interface.find('oci:config/oci:type', namespaces=NAMESPACES)
interface_type.text = interface_type.text.replace('ianaift:','')
add_value_from_tag(interface, 'type', interface_type)
interface_mtu = xml_interface.find('oci:config/oci:mtu', namespaces=NAMESPACES) interface_mtu = xml_interface.find('oci:config/oci:mtu', namespaces=NAMESPACES)
add_value_from_tag(interface, 'mtu', interface_mtu, cast=int) add_value_from_tag(interface, 'mtu', interface_mtu, cast=int)
...@@ -50,6 +54,8 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]: ...@@ -50,6 +54,8 @@ def parse(xml_data : ET.Element) -> List[Tuple[str, Dict[str, Any]]]:
add_value_from_tag(subinterface, 'name', interface_name) add_value_from_tag(subinterface, 'name', interface_name)
add_value_from_tag(subinterface, 'mtu', interface_mtu) add_value_from_tag(subinterface, 'mtu', interface_mtu)
add_value_from_tag(subinterface, 'type', interface_type)
subinterface_index = xml_subinterface.find('oci:index', namespaces=NAMESPACES) subinterface_index = xml_subinterface.find('oci:index', namespaces=NAMESPACES)
if subinterface_index is None or subinterface_index.text is None: continue if subinterface_index is None or subinterface_index.text is None: continue
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<name>{{name}}</name> <name>{{name}}</name>
<config> <config>
<name>{{name}}</name> <name>{{name}}</name>
<type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:l3ipvlan</type> <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:{{type}}</type>
<mtu>{{mtu}}</mtu> {% if mtu is defined %}<mtu>{{mtu}}</mtu>{% endif%}
<enabled>true</enabled> <enabled>true</enabled>
</config> </config>
<subinterfaces> <subinterfaces>
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
</single-tagged> </single-tagged>
</match> </match>
</vlan> </vlan>
{% if address_ip is defined %}
<oc-ip:ipv4> <oc-ip:ipv4>
<oc-ip:addresses> <oc-ip:addresses>
<oc-ip:address> <oc-ip:address>
...@@ -35,7 +36,7 @@ ...@@ -35,7 +36,7 @@
</oc-ip:address> </oc-ip:address>
</oc-ip:addresses> </oc-ip:addresses>
</oc-ip:ipv4> </oc-ip:ipv4>
{% endif%}
</subinterface> </subinterface>
</subinterfaces> </subinterfaces>
</interface> </interface>
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<config> <config>
<name>{{name}}</name> <name>{{name}}</name>
<type xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:{{type}}</type> <type xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:{{type}}</type>
{% if type=='L3VRF' %}
{% if description is defined %}<description>{{description}}</description>{% endif %} {% if description is defined %}<description>{{description}}</description>{% endif %}
{% if router_id is defined %}<router-id>{{router_id}}</router-id>{% endif %} {% if router_id is defined %}<router-id>{{router_id}}</router-id>{% endif %}
<route-distinguisher>{{route_distinguisher}}</route-distinguisher> <route-distinguisher>{{route_distinguisher}}</route-distinguisher>
...@@ -16,6 +17,26 @@ ...@@ -16,6 +17,26 @@
<label-allocation-mode xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:INSTANCE_LABEL</label-allocation-mode> <label-allocation-mode xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:INSTANCE_LABEL</label-allocation-mode>
</config> </config>
</encapsulation> </encapsulation>
{% endif %}
{% if type=='L2VSI' %}
{% if description is defined %}<description>{{description}}</description>{% endif %}
<enabled>false</enabled>
<mtu>1500</mtu>
</config>
<encapsulation>
<config>
<encapsulation-type xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:MPLS</encapsulation-type>
</config>
</encapsulation>
<fdb>
<config>
<mac-learning>true</mac-learning>
<maximum-entries>1000</maximum-entries>
<mac-aging-time>300</mac-aging-time>
</config>
</fdb>
{% endif %}
{% endif %} {% endif %}
</network-instance> </network-instance>
</network-instances> </network-instances>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment