cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
297
Views
0
Helpful
2
Replies
Highlighted
Beginner

List Key Element duplication

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

Everyone's tags (1)
2 REPLIES 2
Cisco Employee

Re: List Key Element duplication

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

Beginner

Re: List Key Element duplication

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

Regards,

Bmork

 

Everyone's tags (1)