07-05-2022 05:40 PM
So if I have a set of southbound-locked devices in the CDB, how can I use them when testing service configuration? Currently, I get an error indicating:
07-06-2022 02:44 AM - edited 07-06-2022 02:49 AM
You can look up what kind of capabilities a typical device you are adding has and add those capabilities yourself. Doesn't have to be all the capabilities, just the ones necessary to allow configuration of the device.
Then afterwards when you do first sync-to/from actual capabilities will be synced. So this is not breaking anything (as much as I know).
Example capabilities that I use to fake a device:
CISCO_XE: Set[str] = {
'http://tail-f.com/ns/ncs-ned/cli-allow-abbrev-keys',
'http://tail-f.com/ns/ncs-ned/show-partial?path-format=key-path',
'http://tail-f.com/ns/ncs-ned/show-stats-path',
'urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=trim',
'urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08&module=ietf-interfaces',
'urn:ietf:params:xml:ns:yang:ietf-ip?revision=2014-06-16&module=ietf-ip',
'urn:ios?revision=2021-02-11&module=tailf-ned-cisco-ios',
'urn:ios-stats?revision=2021-02-11&module=tailf-ned-cisco-ios-stats',
}
CISCO_XR: Set[str] = {
'http://tail-f.com/ned/cisco-ios-xr?revision=2020-02-21&module=tailf-ned-cisco-ios-xr',
'http://tail-f.com/ned/cisco-ios-xr-stats?revision=2020-02-21&module=tailf-ned-cisco-ios-xr-stats',
'http://tail-f.com/ns/ncs-ned/cli-allow-abbrev-keys',
'http://tail-f.com/ns/ncs-ned/show-partial?path-format=cmd-path-modes-only',
'http://tail-f.com/ns/ncs-ned/show-stats-path',
'urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=trim',
'urn:ietf:params:xml:ns:yang:ietf-interfaces?revision=2014-05-08&module=ietf-interfaces',
'urn:ietf:params:xml:ns:yang:ietf-ip?revision=2014-06-16&module=ietf-ip',
}
Be careful though to not configure something that doesn't exist on the actual device since after you pull something like this off all you are interacting with is pure device model. This means interface Ge 100000/2020202020/202020202/38437893274 is possible but clearly won't be on the device.
07-06-2022 05:33 AM
Well, how is this configured in NSO? From the error I get, this is operational data.
admin@ncs(config)# load merge test_capability.xml
Loading.
Error: on line 5: object is not writable: /ncs:devices/ncs:device[ncs:name='SDPRouter1']/ncs:capability
root@nso-0:/# cat test_capability.xml
<config xmlns="http://tail-f.com/ns/config/1.0">
<devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name>SDPRouter1</name>
<capability>
<uri>http://tail-f.com/ns/ncs-ned/cli-allow-abbrev-keys</uri>
</capability>
<capability>
<uri>http://tail-f.com/ns/ncs-ned/show-partial?path-format=key-path</uri>
</capability>
<capability>
<uri>http://tail-f.com/ns/ncs-ned/show-stats-path</uri>
</capability>
<capability>
<uri>urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=trim</uri>
</capability>
<capability>
<uri>urn:ietf:params:xml:ns:yang:ietf-interfaces</uri>
<revision>2014-05-08</revision>
<module>ietf-interfaces</module>
</capability>
<capability>
<uri>urn:ietf:params:xml:ns:yang:ietf-ip</uri>
<revision>2014-06-16</revision>
<module>ietf-ip</module>
</capability>
<capability>
<uri>urn:ios</uri>
<revision>2022-03-18</revision>
<module>tailf-ned-cisco-ios</module>
</capability>
<capability>
<uri>urn:ios-stats</uri>
<revision>2022-03-18</revision>
<module>tailf-ned-cisco-ios-stats</module>
</capability>
</device>
</devices>
</config>
07-06-2022 01:07 PM
If you are doing it via CLI: devices device test add-capability uri
08-05-2022 02:26 PM
Just to add here that there are two other ways to configure capabilities, you can copy them from a capability profile or from another device:
admin@lower-nso-1> request devices device ex0 copy-capabilities from-
Possible completions:
from-device from-profile
Copying from a working device is particularly useful. So, if you have another device of the same NED that is working, you can just copy its capabilities.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide