cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1326
Views
5
Helpful
2
Replies

if-ned-greater-than

sfloresk
Cisco Employee
Cisco Employee

Hello,

Creating a service template, I can specify what version of the driver I would like to use via "if-ned-id" - Is there an option to have a "greater-than" operation for NED versions in the XML templates?

Thank you

1 Accepted Solution

Accepted Solutions

vleijon
Cisco Employee
Cisco Employee

No, you can however list multiple ned-ids after the tag, and use a final else-branch as a catch all. 

 

But no greater-than or less-than. It could be an interesting feature suggestion to allow more operations on the ned-id. (There are some technical challenges, a ned-id is not strictly ordered, but maybe it could be interpreted as a string).

View solution in original post

2 Replies 2

vleijon
Cisco Employee
Cisco Employee

No, you can however list multiple ned-ids after the tag, and use a final else-branch as a catch all. 

 

But no greater-than or less-than. It could be an interesting feature suggestion to allow more operations on the ned-id. (There are some technical challenges, a ned-id is not strictly ordered, but maybe it could be interpreted as a string).

I would also add that an alternative is to use native XPath functions. At the end of the day, the ned-id is accessible via its path: /devices/device[name='Node-1']/device-type/cli/ned-id

So, you can get the version like this:
admin@ncs% xpath eval substring-after(substring-after(/devices/device[name='Node-1']/device-type/cli/ned-id,'cisco-iosxr-cli-'),'cli-')
7.24
[ok][2020-10-28 23:37:55]

[edit]
admin@ncs%

Then, you can apply your comparison (either to lower or bigger diggits)

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: