cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1348
Views
0
Helpful
2
Replies

List Key Element duplication

bjronmork
Level 1
Level 1

Hi Expert,

Can we add a PE router twice in a single service; as I think under list device is selected as key; so, it stopping...is there any procedure to add same device multiple time; as after adding router, configurations of each link are different from each other.

 

    list link {
        tailf:info "Attachment Circuits";
        key "device";
        leaf device {
          tailf:info "PE Router";
          mandatory true;
          type leafref {
            path "/ncs:devices/ncs:device/ncs:name";
          }
        }
   

dup-error.png

 

Regards,

BMork

2 Replies 2

lmanor
Cisco Employee
Cisco Employee

So, it looks like you would like multiple links for the same device...

The list that you have specified - link - is keyed by the device so you will only be able to have 1 link per device key.

 

You could either have a list - say links - keyed by the device only which could have multiple link definitions within or, more likely if variable # links, the list is keyed by both the device _and_ a link identifier - say link-id..

 

    list link {
        tailf:info "Attachment Circuits";
        key "device link-id";
        leaf device {
          tailf:info "PE Router";
          mandatory true;
          type leafref {
            path "/ncs:devices/ncs:device/ncs:name";
          }
}
link link-id {
type string; //or more restrictive type }
...

-Larry

Thanks Imanor, but is there any way to generate linkid automatically? managed by system without user input...

Regards,

Bmork

 

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?