Re: [yang-doctors] Identities vs Choice statement

Andy Bierman <andy@yumaworks.com> Tue, 26 September 2017 01:53 UTC

Return-Path: <andy@yumaworks.com>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A71E3134637 for <yang-doctors@ietfa.amsl.com>; Mon, 25 Sep 2017 18:53:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WVzwfbmbkeVn for <yang-doctors@ietfa.amsl.com>; Mon, 25 Sep 2017 18:53:34 -0700 (PDT)
Received: from mail-wr0-x22b.google.com (mail-wr0-x22b.google.com [IPv6:2a00:1450:400c:c0c::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6D75913463C for <yang-doctors@ietf.org>; Mon, 25 Sep 2017 18:53:34 -0700 (PDT)
Received: by mail-wr0-x22b.google.com with SMTP id m18so10882122wrm.2 for <yang-doctors@ietf.org>; Mon, 25 Sep 2017 18:53:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=AqFAeYwL6G8SZIBWlqF9r0iHe78vuCJjk+EYdZKg0kQ=; b=AbdQl37AFEHpsoy4EIe1zKWhpDEZKSYPU8gHB08NG6/0DThpQKkqiEVZtfVEd3w6x3 r/nEtfrAamz4vbQKTxHy9Mq5/gs+n2nnKYDl1UuJXr3LkYoNfv9aGgOg9QLGjdU6/YkM 34D3h7wkfRY/GiOEDFKDW5KPqBbLb7FZtHlwmzHAQe56+2uuFVAqcjdoIS0MTEdEY/Ix +oukN4xoG+15okJBu9hBR0ZUtP1L7OR9OImkKZ1Xm2kf6kkDwymXKb6Y/RN8xI2OImA5 /Jegno8z78IB54yHB+rYcvy3c2cviTjO6db1x0njHXONzJprDDlXxcyaITqGVMDs0KEI NE1w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=AqFAeYwL6G8SZIBWlqF9r0iHe78vuCJjk+EYdZKg0kQ=; b=ZYcZOe4+sTz0iaLApbRYm11Ob74W5fkRO+sjhQ/C01Nvm5oclNrcX1PhEHlfE/hUyb 3xvo6hj3Tq9oIV6+Mo5vna47UIOvAPgczj42+6aygBppBcEuXdiPka8dFNEGJZRuKHfk 9daak4dEvkTKLlgTHsqSUtcTE/HFSAS81TG08PdFRwE3dW+DT1Yb3msHd0rRuNCg4btU q5MRyQL8lEXxw8BWtWHUTSHYzhok5IiSujASTdGCQ1DSara8TFZAVVN018FlRqzAQL6i eUHA009vM+4FfB4P/3Zu9PmQlGef9zYIczdUx/xVaIBkODI6Wp1f3wLOgV/7YYV/SdFg oT6Q==
X-Gm-Message-State: AHPjjUhyN2DCCEQwGR11aABCRnBgHjYMFsB3TttCcNEq9nznuund6bd7 JGp0GCsa8ZEYvVXLdD0e6/gEn6q0j3gfNKFzvcBSmw==
X-Google-Smtp-Source: AOwi7QDzG81xt12jbTpyaEAyMluWnx5Utsehtv0qdWcL30zJBI+WHi/1t7g5aHq8zvkjWWx1On5MbjOEsdi1foUwIQ8=
X-Received: by 10.25.211.14 with SMTP id k14mr2784589lfg.51.1506390812872; Mon, 25 Sep 2017 18:53:32 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.25.18.41 with HTTP; Mon, 25 Sep 2017 18:53:32 -0700 (PDT)
In-Reply-To: <3B1FB6B8-C489-4A55-86CC-D61F63339A28@gmail.com>
References: <3B1FB6B8-C489-4A55-86CC-D61F63339A28@gmail.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Mon, 25 Sep 2017 18:53:32 -0700
Message-ID: <CABCOCHQT7Ls1jm8udfUggYgXWK=nnhHHfmf7x1Nq-MH8Te_Y-g@mail.gmail.com>
To: Mahesh Jethanandani <mjethanandani@gmail.com>
Cc: YANG Doctors <yang-doctors@ietf.org>
Content-Type: multipart/alternative; boundary="001a11400d724b61e8055a0df12b"
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/SQ3aXPLUZkXEiP5LRigkPIy-mGg>
Subject: Re: [yang-doctors] Identities vs Choice statement
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Sep 2017 01:53:37 -0000

Hi,

An identityref is a leaf or leaf-list set to an extensible codepoint.

A choice allows multiple cases, and each case is a set of multiple objects,
not just 1 object for the identity.  So YANG knows that if you pick case
foo,
then all the nodes in case foo are available.

For identities, you could put a when-stmt on other objects associated with
the
conceptual case-stmt represented by picking "when identity A", etc.

I think either approach is OK.


Andy



On Mon, Sep 25, 2017 at 6:44 PM, Mahesh Jethanandani <
mjethanandani@gmail.com> wrote:

> What are the advantages/disadvantages of using identities vs choice
> statement?
>
> Background info: There is no central authority on options that can be
> defined as part of the statement. While the model will define a set of
> options, extensibility is important. Also, assume that the options are
> mutually exclusive. The entity being defined is an action, which could be
> considered abstract, and is not of a particular type, but is scoped
> locally, and at least at this point does not need to be globally unique.
>
> How would doctors model this?
>
> Mahesh Jethanandani
> mjethanandani@gmail.com
>
>
>
> _______________________________________________
> yang-doctors mailing list
> yang-doctors@ietf.org
> https://www.ietf.org/mailman/listinfo/yang-doctors
>