<network-instances xmlns="http://openconfig.net/yang/network-instance">
    <network-instance>
        <name>{{name}}</name>
        <protocols>
            <protocol{% if operation is defined %} xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="{{operation}}"{% endif %}>
                <identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:{{identifier}}</identifier>
                <name>{{protocol_name}}</name>
                {% if operation is not defined or operation != 'delete' %}
                <config>
                    <identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:{{identifier}}</identifier>
                    <name>{{protocol_name}}</name>
                </config>
                {% if identifier=='BGP' %}
                <bgp>
                    <global>
                        <config>
                            <as>{{as}}</as>
                            <router-id>{{router_id}}</router-id>
                        </config>
                    </global>
                </bgp>
                {% endif %}
                {% endif %}
            </protocol>
        </protocols>
        {% if operation is not defined or operation != 'delete' %}

        <tables>
            <table>
                <protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:{{identifier}}</protocol>
                <address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
                <config>
                    <protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:{{identifier}}</protocol>
                    <address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
                </config>
            </table>
        </tables>
        {% endif %}
    </network-instance>
</network-instances>
