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

NED-ID old style syntax

ngrgur
Level 1
Level 1

I am planning an upgrade of NSO platform from 4.7 to 5.3.

Newer version of NSO is interpreting NED as: device.device_type.cli.ned_id = cisco-ios-cli-6.33:cisco-ios-cli-6.33

However we have a lot of packages and services developed with check for old style NED id:

device.device_type.cli.ned_id = 'ios-id:cisco-ios'

(without specified version).

 

Is there a way to represent old style NED id on NSO 5.3?

 

Here is the reference from the NED yang file (tailf-ned-cisco-ios-meta.yang

augment "/ncs:devices/ncs:device/ncs:ned-settings" {
// Different 'when' expressions used when building for NSOs with and without CDM support.
// The NED build system will automatically 'uncomment' the right one.
//
// CDM style syntax
//when "derived-from(../ncs:device-type/ncs:cli/ncs:ned-id,'family:cisco-ios-cli')";
//
// Old style syntax:
//when "../ncs:device-type/ncs:cli/ncs:ned-id = 'ios-id:cisco-ios'";
uses cisco-ios-ned-settings-grouping;
}
}

 

Regards,

Nikola

 

1 Reply 1

hniska
Cisco Employee
Cisco Employee

you could use the xpath function derived-from, something like 

 

import _ncs

_ncs.maapi.xpath_eval_expr(m.msock, trans.th, 'derived-from-or-self(/ncs:devices/device[name="ce0"]/device-type/cli/ned-id,"cisco-ios-cli:cisco-ios-cli")', None,'')