[YANG] usage of container statement inside choice?

Jason Nixon <jnixon@brocade.com> Wed, 13 October 2010 00:34 UTC

Return-Path: <jnixon@brocade.com>
X-Original-To: yang@core3.amsl.com
Delivered-To: yang@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 460FF3A686E for <yang@core3.amsl.com>; Tue, 12 Oct 2010 17:34:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.264
X-Spam-Level:
X-Spam-Status: No, score=-2.264 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HTML_MESSAGE=0.001, IP_NOT_FRIENDLY=0.334]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zan-oiaek3zc for <yang@core3.amsl.com>; Tue, 12 Oct 2010 17:34:18 -0700 (PDT)
Received: from mx0a-000f0801.pphosted.com (mx0a-000f0801.pphosted.com [67.231.144.122]) by core3.amsl.com (Postfix) with ESMTP id 0F0353A6832 for <yang@ietf.org>; Tue, 12 Oct 2010 17:34:17 -0700 (PDT)
Received: from pps.filterd (m0000542 [127.0.0.1]) by mx0a-000f0801.pphosted.com (8.14.3/8.14.3) with SMTP id o9D0ZXQx029815 for <yang@ietf.org>; Tue, 12 Oct 2010 17:35:33 -0700
Received: from hq1-exedge.brocade.com (hq1-exedge.brocade.com [144.49.141.11]) by mx0a-000f0801.pphosted.com with ESMTP id rvxww838m-2 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for <yang@ietf.org>; Tue, 12 Oct 2010 17:35:33 -0700
Received: from HQ1WP-EXHUB01.corp.brocade.com (10.70.36.14) by HQ1WP-EXEDGE02.corp.brocade.com (144.49.141.11) with Microsoft SMTP Server (TLS) id 8.2.254.0; Tue, 12 Oct 2010 17:39:59 -0700
Received: from HQ1-EXCH03.corp.brocade.com ([fe80::411c:2971:c59e:5e4a]) by HQ1WP-EXHUB01.corp.brocade.com ([::1]) with mapi; Tue, 12 Oct 2010 17:35:32 -0700
From: Jason Nixon <jnixon@brocade.com>
To: "'yang@ietf.org'" <yang@ietf.org>
Date: Tue, 12 Oct 2010 17:35:31 -0700
Thread-Topic: usage of container statement inside choice?
Thread-Index: ActqboqPvsHVO0ptRDKWbkJ+4OwpTw==
Message-ID: <DAC506E724B1E345837F2FD9C40194E1270A302753@HQ1-EXCH03.corp.brocade.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US
Content-Type: multipart/alternative; boundary="_000_DAC506E724B1E345837F2FD9C40194E1270A302753HQ1EXCH03corp_"
MIME-Version: 1.0
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15, 1.0.148, 0.0.0000 definitions=2010-10-12_14:2010-10-13, 2010-10-12, 1970-01-01 signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=5 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1010120157
X-Mailman-Approved-At: Wed, 13 Oct 2010 08:01:51 -0700
Subject: [YANG] usage of container statement inside choice?
X-BeenThere: yang@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: YANG modeling Language for NETCONF <yang.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/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, 13 Oct 2010 00:35:16 -0000

All,
Every example of a choice statement I have seen so far uses a leaf to define the information for a particular case.
Yet I am wondering if the below example would be allowed?
I am assuming that groupings of dogtreat, and feed_cow are defined elsewhere, and may have multiple leaf objects defined inside.
Thanks for your thoughts on this,
Jason Nixon

choice moof
                        {
                            description "is it a cow or a dog";
                                    case dog
                                    {
                                        container dog
                                        {
                                            description "awww puppies are cute";
                                                    uses dogtreat;
                                        }
                                    }
                                    case cow
                                    {
                                        container cow
                                        {
                                            description "got some hay?";
                                                    uses feed_cow;
                                        }
                                    }
                       }//end choice