cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
282
Views
1
Helpful
2
Replies

How to add prefix to prefix-set inline using xml template from NSO

Maksim12
Level 1
Level 1

Hello,

I'm trying to use NSO template to to add prefix to prefix-set without querying original config of prefix-set.

I tried different tags  insert="after", insert="first", insert="last", merge but they all erase original prefix-set.

I guess I'm looking for inline equivalent command.

 

 <devices xmlns="http://tail-f.com/ns/ncs">
      <device>
        <name>ROUTER_NAME</name>
        <config tags="merge">
          <prefix-set xmlns="http://tail-f.com/ned/cisco-ios-xr">
            <name>PREFIX_LIST_NAME</name>
            <set insert="after" value="10.0.0.0/30">
              <value>10.1.0.0/30</value>
            </set>
          </prefix-set>
        </config>
      </device>
    </devices>
  <?end?>
1 Accepted Solution

Accepted Solutions

huayyang
Cisco Employee
Cisco Employee

can you elaborate on your expectation and your observation?

/prefix-set/set is an ordered-by-user list, how to work with such lists is documented https://developer.cisco.com/docs/nso/guides/#!templates/operations-on-ordered-lists-and-leaf-lists, does it help?

 

 

 

View solution in original post

2 Replies 2

huayyang
Cisco Employee
Cisco Employee

can you elaborate on your expectation and your observation?

/prefix-set/set is an ordered-by-user list, how to work with such lists is documented https://developer.cisco.com/docs/nso/guides/#!templates/operations-on-ordered-lists-and-leaf-lists, does it help?

 

 

 

rogaglia
Cisco Employee
Cisco Employee

Maybe you can add a "commit dry-run" to explain the NSO behavior and your expected behavior?