Subject: [netmod] Usage of rpc under container or list statement

From: Kedar Gaonkar <[email-masked]>
Date: Sun, 21 Jul 2013 15:20:05 -0700

Greetings,

Can I have an rpc statement under a container or a list? RFC 6020 doesn’t
mention ‘rpc’ under section 7.5.2 (container substatements) or 7.8.1 (list
substatements).

In my data model, I have a list defined for access points. The key for this
list is the mac-address of access point. Along with all the leaves, I
wanted to define an rpc under this list that enables or disables the LED of
access-point. Since this rpc has meaning only for access-points, I was
wondering if I could logically group it under the list, or is it mandatory
that all rpcs have to be defined globally outside of containers?

container access_point {

                config false;

                list ap {

                                key “mac_address”;

                                leaf mac_address  { type yang:mac-address; }

                                <some-other-leaves..>

                                rpc set_led {

                                                config false;

                                                input {

                                                                leaf on {
type boolean; }

                                                }

                                }

                }

}

Thanks,
Kedar