cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
25
Views
1
Helpful
2
Replies
Cisco Employee

Filtering device according to its platform in service yang model

 

Hi all,

 

 

In a service yang file, I want to create a selection for a device name leaf that will only show devices of certain platforms (“show devices device platform model” for all devices starts with the same constant string).

 

Is this possible? What syntax should achieve this?

 

 

All my effort ended in compilation errors: “bad argument value …., should be of type path-arg”

 

 

Thanks,

 

Yftach

 

Everyone's tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Cisco Employee

Re: Filtering device according to its platform in service yang model

 

Thank you Roque!

 

 

The must statement indeed gave the clue.

 

 

This is how I filtered it:

 

 

leaf nid {

 

                    tailf:info "nid name for this endpoint";

 

                    must "/ncs:devices/ncs:device[ncs:name=current()/../nid]/ncs:platform[ncs:name='telcosystems-binox']/ncs:name";

 

                    type leafref {

 

                        path "/ncs:devices/ncs:device/ncs:name";

 

                    }

 

                }

 

 

Appears to be working as expected.

 

 

Thanks,

 

Yftach

 

View solution in original post

2 REPLIES 2
Highlighted
Cisco Employee

Re: Filtering device according to its platform in service yang model

 

Hi,

 

 

This code works for device-group membership. You could simply change it for platform.

 

 

Regards,

 

Roque

 

Highlighted
Cisco Employee

Re: Filtering device according to its platform in service yang model

 

Thank you Roque!

 

 

The must statement indeed gave the clue.

 

 

This is how I filtered it:

 

 

leaf nid {

 

                    tailf:info "nid name for this endpoint";

 

                    must "/ncs:devices/ncs:device[ncs:name=current()/../nid]/ncs:platform[ncs:name='telcosystems-binox']/ncs:name";

 

                    type leafref {

 

                        path "/ncs:devices/ncs:device/ncs:name";

 

                    }

 

                }

 

 

Appears to be working as expected.

 

 

Thanks,

 

Yftach

 

View solution in original post

This widget could not be displayed.