Re: [YANG] usage of container statement inside choice?

Ladislav Lhotka <lhotka@cesnet.cz> Wed, 13 October 2010 15:17 UTC

Return-Path: <lhotka@cesnet.cz>
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 BF2033A69CD for <yang@core3.amsl.com>; Wed, 13 Oct 2010 08:17:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.443
X-Spam-Level:
X-Spam-Status: No, score=-2.443 tagged_above=-999 required=5 tests=[AWL=0.156, BAYES_00=-2.599]
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 qaea27Z+A8M9 for <yang@core3.amsl.com>; Wed, 13 Oct 2010 08:17:30 -0700 (PDT)
Received: from office2.cesnet.cz (office2.cesnet.cz [IPv6:2001:718:1:101::144:244]) by core3.amsl.com (Postfix) with ESMTP id 506883A699F for <yang@ietf.org>; Wed, 13 Oct 2010 08:17:30 -0700 (PDT)
Received: from [192.168.2.8] (unknown [78.156.128.19]) by office2.cesnet.cz (Postfix) with ESMTPSA id C2EDB2CDE05B for <yang@ietf.org>; Wed, 13 Oct 2010 17:18:45 +0200 (CEST)
From: Ladislav Lhotka <lhotka@cesnet.cz>
To: yang@ietf.org
In-Reply-To: <DAC506E724B1E345837F2FD9C40194E1270A302753@HQ1-EXCH03.corp.brocade.com>
References: <DAC506E724B1E345837F2FD9C40194E1270A302753@HQ1-EXCH03.corp.brocade.com>
Content-Type: text/plain; charset="UTF-8"
Organization: CESNET
Date: Wed, 13 Oct 2010 17:18:44 +0200
Message-ID: <1286983124.9553.5.camel@missotis>
Mime-Version: 1.0
X-Mailer: Evolution 2.28.3
Content-Transfer-Encoding: 8bit
Subject: Re: [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 15:17:31 -0000

Hi Jason,

this is certainly possible, and the 'case' statements may also be
omitted as there is only one node per case.

Lada

On Út, 2010-10-12 at 17:35 -0700, Jason Nixon wrote:
> 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
> 
> 
> _______________________________________________
> YANG mailing list
> YANG@ietf.org
> https://www.ietf.org/mailman/listinfo/yang

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C