cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1444
Views
0
Helpful
1
Replies

Using when condition in XML template

gmathewk
Cisco Employee
Cisco Employee

Hi Team,

 

I am using NSO 4.6.1.3 and using this simple XML template

 

<config xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<?set HA = 'false'?>
<device>
<name>vishal</name>
<config>
<ip xmlns="urn:ios" >
<access-list when="{$HA = 'true'}">
<standard>
<std-named-acl>
<name>CSR</name>
<std-access-list-rule>
<rule>deny any</rule>
</std-access-list-rule>
</std-named-acl>
</standard>
</access-list>
</ip>
</config>
</device>
</devices>
</config>

 

When i perform a load merge i get the following error:

 

admin@ncs% load merge test.xml
Error: on line 8: unknown attribute: when in access-list

 

Any idea what could be wrong ?

1 Reply 1

lmanor
Cisco Employee
Cisco Employee

Hello,

 

the 'load merge <file>' command will directly merge the configuration contained in the xml file into the current CDB, the format of the xml file must match the yang schema. 

 

load (merge | override) (terminal | <file>)
Load configuration from file or terminal.
merge Merge content of file/terminal with current configuration.

 

I don't believe processing of the 'load merge' will consider 'xml template' style processing instructions (conditionals or looping statements) as would be done by the NSO template engine for a service config-templates.

 

-Larry

Polls
AI-powered tools for network troubleshooting are likely to be part of everyone’s workflow sooner or later. What is the single biggest challenge or concern you see with adopting these tools in your organization?