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

From: Kedar Gaonkar <[email-masked]>
Date: Wed, 17 Jul 2013 13:48:57 -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

---

From: "Romascanu, Dan (Dan)" <[email-masked]>
Date: Sun, 21 Jul 2013 12:27:44 +0000

Hi Kedar,

We are not using this mail list for a number of years. Actually I thought that it was closed until your message arrived. I suggest that you send your message again to [email-masked]<mailto:[email-masked]>.

Regards,

Dan

From: [email-masked] [mailto:[email-masked]] On Behalf Of Kedar Gaonkar
Sent: Wednesday, July 17, 2013 11:49 PM
To: [email-masked]
Subject: [YANG] Usage of rpc under container or list statement

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";

                                <some-other-leaves..>

                                rpc set_led {
                                                config false;
                                                input {
                                                                leaf on { type boolean; }
                                                }
                                }
                }
}

Thanks,
Kedar