Re: [netmod] yang-data-ext issues

Joe Clarke <jclarke@cisco.com> Mon, 16 April 2018 13:34 UTC

Return-Path: <jclarke@cisco.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0D6FE12D864 for <netmod@ietfa.amsl.com>; Mon, 16 Apr 2018 06:34:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.511
X-Spam-Level:
X-Spam-Status: No, score=-14.511 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.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 UKKtSXvL_cLr for <netmod@ietfa.amsl.com>; Mon, 16 Apr 2018 06:34:26 -0700 (PDT)
Received: from rcdn-iport-6.cisco.com (rcdn-iport-6.cisco.com [173.37.86.77]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4968B126FDC for <netmod@ietf.org>; Mon, 16 Apr 2018 06:34:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3139; q=dns/txt; s=iport; t=1523885666; x=1525095266; h=subject:to:references:from:message-id:date:mime-version: in-reply-to:content-transfer-encoding; bh=HEECFSiYGrUA5ih2IXrg0+EkS7VzYHcUBVgJaCMVGvs=; b=RiyBhlXwPxmwc4t9pIDtdRCbRQRhYFdJOcjaPAoEq9a8mKVx0xHK7o8O iKHQwoFKmUOkWBJwb8m8k+Cu9knXz2Kx9mdQBt8AhAbD8P1q/NMrhAfDN 2fq+VjyCnQlmRal+mMiW3LQNyxEB+krJswZ0g76Bo+Lre6Dg6W5To0Vcw M=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0ClBADDpdRa/4ENJK1cGgEBAQEBAgE?= =?us-ascii?q?BAQEIAQEBAYNCgVuED5UTgUspgQ+SaIF7C4UDAoJDITYWAQIBAQEBAQECbCi?= =?us-ascii?q?FIwEFIw8BVgsOCgICJgICVwYBDAgBAYUJpU+CHIg8gi+BCYZ9gVQ/gQ8jgmi?= =?us-ascii?q?Hc4JUApdkCI41BodHhQSQH4ElIgExgVJNIxWCf4IfF44zI45oAQE?=
X-IronPort-AV: E=Sophos;i="5.48,459,1517875200"; d="scan'208";a="382055691"
Received: from alln-core-9.cisco.com ([173.36.13.129]) by rcdn-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Apr 2018 13:33:24 +0000
Received: from [10.82.174.138] ([10.82.174.138]) by alln-core-9.cisco.com (8.14.5/8.14.5) with ESMTP id w3GDXOOc007765; Mon, 16 Apr 2018 13:33:24 GMT
To: Martin Bjorklund <mbj@tail-f.com>, netmod@ietf.org
References: <20180416.145617.1262098657698751846.mbj@tail-f.com>
From: Joe Clarke <jclarke@cisco.com>
Openpgp: preference=signencrypt
Autocrypt: addr=jclarke@cisco.com; prefer-encrypt=mutual; keydata= xsDiBDyDmj4RBADa/Icz5Xl+cJUGNxC/tWgXWqcA9VA8GN+PeqKhXS0BnVHntdsQxbpFUUKK 4ld0Zex/Rec1jgC/ikExJHHIee8ZVcHqP+tsWexi83/ZvEdzI95diBp2Is5fYp8P8hdIBNQS Ooc1jVYrTJUaZgJK2uBzbkh/WbipwsQbueRzXqPORwCgsPNrStLzqOpjrA7FdUz/JVQf5+8D /1SiKAOFiW4TxY+fS09lqiL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r 2018 09:33:24 -0400
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0
MIME-Version: 1.0
In-Reply-To: <20180416.145617.1262098657698751846.mbj@tail-f.com>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/Zj0ycJ-ecSLCPnniJZr4HPtnMRc>
Subject: Re: [netmod] yang-data-ext issues
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Apr 2018 13:34:28 -0000

On 4/16/18 08:56, Martin Bjorklund wrote:
> Hi,
> 
> While preparing draft-ietf-netmod-yang-data-ext-02, it turned out that
> it is not clear what, if any, restrictions should be enforced for
> yang-data structures.  Even among the authors we have different ideas
> for how this should work.
> 
> Background:
> 
> In 8040, the original yang-data extension had a restriction that said
> that a yang-data structure MUST have exactly one container, since it
> wouldn't be possible to have a yang-data structure in an XML instance
> document otherwise.
> 
> Since people want to use yang-data structures in other places, this
> restriction was lifted in the new draft:
> 
>    There is no longer an assumption that a yang data structure can
>    only be used as a top-level abstraction, instead of nested within
>    some other data structure.
> 
> 
> With this in mind, here's a use case that I think we ought to support:
> 
>   rpc my-first-rpc {
>     description
>       "Bla bla...
>        If an error occurs, <error-info> will contain an instance of
>        the yang-data structure 'my-first-rpc-error-info'.";
>     ...
>   }
> 
>   yang-data my-first-rpc-error-info {
>     leaf reason { ... }
>     container user-info { ... }
>   }
> 
>   rpc my-second-rpc {
>     description
>       "Bla bla...
>        If an error occurs, <error-info> will contain an instance of
>        the yang-data structure 'my-second-rpc-error-info'.";
>     ...
>   }
> 
>   yang-data my-second-rpc-error-info {
>     leaf reason { ... }
>     leaf important-url { ... }
>   }
> 
> (maybe in the future we could even have a YANG extension statement to
> formalize the description:
> 
>    rpc my-first-rpc {
>      ...
>      opx:error-info-structure my-first-rpc-error-info;
>    }
> 
> but this is not point now.)
> 
> In the example above, note that the leaf "reason" is present in both
> structures.  IMO this is not a problem, since these structures are
> used in different contexts.
> 
> My point is that I think we should impose as few restrictions as
> possible to the yang-data extension.  It should be up to the user of
> yang-data to ensure that the structure is defined in such a way so
> that it can be used properly.  For example, a structure that is
> supposed to describe an XML instance document cannot define two leafs
> at the top level.
> 
> If the WG agrees with what I wrote above, we need to change the
> augment-yang-data extension so that you would write for example:
> 
>   yx:augment-yang-data /ex:my-first-rpc-error-info/ex:user-info {
>     ...
>   }
> 
> Comments?

I found the "single container only" policy to be too restricting.  I was
modeling data that would [typically] be serialized to something other
than XML, and this just made me jump through more hoops than I wanted to
use rc:yang-data.

I agree with your laissez-faire proposal here.  I think there should be
some text to the same effect about how it is up to the author of the
yd:yang-data elements to make sure the modeled data can be encoded as
they require.

Joe