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

Is it possible to read YANG extension data with Python API

Diddi
Level 1
Level 1

I'm writing an NSO Action that will recursively walk a bunch of services and make changes/decisions based on the values found in leafs.

However, I don't want the action to walk NSO internal structures such as the "private" container added by ncs:service-data grouping. This is because there are leafs in there that look exactly like the ones I want to modify, and I don't want to modify NSO internal data for obvious reasons. Taking the "private" container as an example, it's using extension ncs:ncs-service-private and being able to skip walking the container based on this fact would be ideal. Is there a way to see if a container is using this (and other) extensions with the Python API?

Based on some massive guess work and head scratching reading the docs I was hoping the CsNodeInfo.meta_data() method could provide this information, but no matter how I use this I always get "None" as a result.

The action is currently based on maagic and the node._children.get_children() to walk down the tree and get the CsNodeInfo among a few other things but I'm happy to use whatever part of the API that works. 

Any ideas?

Thanks

1 Reply 1

u.avsec
Spotlight
Spotlight

Maybe printing node name and filtering it could be done but then, what if you have a service "private" nodes you want to use for sure.

I would say, print path as string (xyz._path) and have filters based on xpaths that shouldn't be drilled into.