cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
815
Views
10
Helpful
2
Replies

NSO multiple devices in one XML template

Hello,

 
Is it possible to deploy different configs via Python and suing only one XML template?
 
XML:
 
?xml version="1.0"?>
<config-template xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name>{$device}</name>
<config>
<vrf xmlns="urn:ios">
<definition>
<name>{$vrf}</name>
<description>testvrf</description>
<rd>{$loopback}:{$vrf}</rd>
<route-target>
<export>
<asn-ip>111:{$vrf}</asn-ip>
</export>
<import>
<asn-ip>111:{$vrf}</asn-ip>
</import>
</route-target>
</definition>
</vrf>
</config>
</device>
</devices>
</config-template>
1 Accepted Solution

Accepted Solutions

cealves
Cisco Employee
Cisco Employee

Hello, you can put same configurations on same xml template, you just need to specify the namespace with the attribute xmlns.

For example for ios-xr you would use: xmlns="http://tail-f.com/ned/cisco-ios-xr"
And for Junos you would use: xmlns="http://xml.juniper.net/xnm/1.1/xnm"

This is just an example. But if you want to see it working you can take a look at NSO examples at:
/examples.ncs/getting-started/developing-with-ncs/17-mpls-vpn-python/packages/l3vpn/templates

The l3vpn-pe.xml template is a good one.

View solution in original post

2 Replies 2

cealves
Cisco Employee
Cisco Employee

Hello, you can put same configurations on same xml template, you just need to specify the namespace with the attribute xmlns.

For example for ios-xr you would use: xmlns="http://tail-f.com/ned/cisco-ios-xr"
And for Junos you would use: xmlns="http://xml.juniper.net/xnm/1.1/xnm"

This is just an example. But if you want to see it working you can take a look at NSO examples at:
/examples.ncs/getting-started/developing-with-ncs/17-mpls-vpn-python/packages/l3vpn/templates

The l3vpn-pe.xml template is a good one.

thank you so much i really appreciate it