[YANG] Usage of rpc under container or list statement

Kedar Gaonkar <kedargaonkar@gmail.com> Wed, 17 July 2013 20:49 UTC

Return-Path: <kedargaonkar@gmail.com>
X-Original-To: yang@ietfa.amsl.com
Delivered-To: yang@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 782F521F9D30 for <yang@ietfa.amsl.com>; Wed, 17 Jul 2013 13:49:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.643
X-Spam-Level:
X-Spam-Status: No, score=0.643 tagged_above=-999 required=5 tests=[BAYES_05=-1.11, HTML_MESSAGE=0.001, MIME_BASE64_TEXT=1.753, NO_RELAYS=-0.001]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WmR0bQiwzl9x for <yang@ietfa.amsl.com>; Wed, 17 Jul 2013 13:49:01 -0700 (PDT)
Received: from mail-ea0-x230.google.com (mail-ea0-x230.google.com [IPv6:2a00:1450:4013:c01::230]) by ietfa.amsl.com (Postfix) with ESMTP id A17F421F9A8E for <yang@ietf.org>; Wed, 17 Jul 2013 13:49:00 -0700 (PDT)
Received: by mail-ea0-f176.google.com with SMTP id z15so1287133ead.21 for <yang@ietf.org>; Wed, 17 Jul 2013 13:48:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=IDr7gCNSitjKQH2+TbSo7vppZ/m/sQi3oZVgAZnQibE=; b=vjSEqTvr1VyKG6xN7fXwJQMq/VjYGSTl6B/vBtXdTDTZ9LUFXiDoU1+oXcJgX6TBEd bQREAC0Ghfl7lB4Oe5yoSz6uXtKLjCOIalyZNv2UvQB6K5F8aND+iblTODEKL69IroIn rNBFVMbategqW3CGrxUmLp73idCx+coSNYmfEvzhKzJwOF+ZtcEd3/XF4oDrMISR+pZx 7z0/haoBbbjK71CJ+UAVfjbO5LDx3AzhilULwCde3rz6hpVzJDvoz4qucbW7BVoYNNJj 81CuCPm1fUg29GLszyqLXFXBkJbnay2+NMq8bSWe1/gTE7y9vpHv+VVhO4fy00eQoSEb zkug==
MIME-Version: 1.0
X-Received: by 10.15.35.65 with SMTP id f41mr8064226eev.61.1374094137507; Wed, 17 Jul 2013 13:48:57 -0700 (PDT)
Received: by 10.14.199.196 with HTTP; Wed, 17 Jul 2013 13:48:57 -0700 (PDT)
Date: Wed, 17 Jul 2013 13:48:57 -0700
Message-ID: <CAN=5dVwdrfz1T1RXRQF8pTH5v6qVjWSJ-rpXVpY_3ZK9AYzvSg@mail.gmail.com>
From: Kedar Gaonkar <kedargaonkar@gmail.com>
To: yang@ietf.org
Content-Type: multipart/alternative; boundary="089e016353c6f46d1204e1bb38ba"
X-Mailman-Approved-At: Sun, 21 Jul 2013 05:24:14 -0700
Subject: [YANG] Usage of rpc under container or list statement
X-BeenThere: yang@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: YANG modeling Language for NETCONF <yang.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang>, <mailto:yang-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/yang>
List-Post: <mailto:yang@ietf.org>
List-Help: <mailto:yang-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang>, <mailto:yang-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 17 Jul 2013 20:52:49 -0000

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