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

Accessing base identity from API

ian.barrere
Level 1
Level 1

Hi,

 

We have a hierarchical identity scheme like this:

 

  identity device-role {
    description "the role a device serves in the network";
  }
 identity aggregation {
    base device-role;
  }
  identity local-aggr-router {
    base aggregation;
  }

We would like to be able to determine the base, or any other level in the hierarchy of a device with the role "local-aggr-router", for example in a programmatic manner (maapi, ideally).

Does anybody know if it's possible to determine in code, for example, that a device tagged only with "local-aggr-router" identity is based on "aggregation" which is in turn based on "device-role"?

 

1 Reply 1

u.avsec
Spotlight
Spotlight

Hey

I haven't worked with a practical example of identity but looking at the YANG RFC it seems to me that this functions like typedef, if you have a derivate you don't really see that in maapi.

 

Perhaps try with maagic path and log dir() of the node to see what is possible on that object. Something like this:

print(root.path.to.node.dir())

And see if anything tasty pops up.

Polls
AI-powered tools for network troubleshooting are likely to be part of everyone’s workflow sooner or later. What is the single biggest challenge or concern you see with adopting these tools in your organization?