<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>{{identifier}}</identifier>
                <name>{{protocol_name}}</name>
                {% if operation is not defined or operation != 'delete' %}
                <config>
                    <identifier>{{identifier}}</identifier>
                    <name>{{protocol_name}}</name>
                    <enabled>true</enabled>
                </config>
                {% if identifier=='BGP' %}
                <bgp>
                    <global>
                        <config>
                            <as>{{as}}</as>
                        </config>
                    </global>
                </bgp>
                {% endif %}
                {% endif %}
            </protocol>
        </protocols>
    </network-instance>
</network-instances>
