<interfaces xmlns="http://openconfig.net/yang/interfaces" 
            xmlns:oc-ip="http://openconfig.net/yang/interfaces/ip" >
    <interface>
        <name>{{name}}</name>
        <config>
            <name>{{name}}</name>
            <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:{{type}}</type>
            {% if mtu is defined %}<mtu>{{mtu}}</mtu>{% endif%}
            <enabled>true</enabled>
        </config>
        <subinterfaces>
            <subinterface>
                <index>{{index}}</index>
                <config>
                    <index>{{index}}</index>
                    <description>{{description}}</description>
                    {% if vendor=="ADVA" and vlan_id is not defined %}
                    <untagged-allowed xmlns="http://www.advaoptical.com/cim/adva-dnos-oc-interfaces">true</untagged-allowed>
                    {% endif%}
                </config>
                {% if vlan_id is defined %}
                <vlan xmlns="http://openconfig.net/yang/vlan">
                    <match>
                        <single-tagged>
                            <config>
                                <vlan-id>{{vlan_id}}</vlan-id>
                            </config>
                        </single-tagged>
                    </match>
                </vlan>
                {% endif %}
                {% if address_ip is defined %}
                <oc-ip:ipv4>
                    <oc-ip:addresses>
                        <oc-ip:address>
                            <oc-ip:ip>{{address_ip}}</oc-ip:ip>
                            <oc-ip:config>
                                <oc-ip:ip>{{address_ip}}</oc-ip:ip>
                                <oc-ip:prefix-length>{{address_prefix}}</oc-ip:prefix-length>
                            </oc-ip:config>
                        </oc-ip:address>
                    </oc-ip:addresses>
                </oc-ip:ipv4>
                {% endif %}
            </subinterface>
        </subinterfaces>
    </interface>
</interfaces>
