Re: [netmod] yang-data-ext issues

Andy Bierman <andy@yumaworks.com> Wed, 25 April 2018 10:13 UTC

Return-Path: <andy@yumaworks.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 2366412DA1D for <netmod@ietfa.amsl.com>; Wed, 25 Apr 2018 03:13:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.61
X-Spam-Level:
X-Spam-Status: No, score=-2.61 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_LOW=-0.7, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01] 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 a9YKVrVvgDBf for <netmod@ietfa.amsl.com>; Wed, 25 Apr 2018 03:13:36 -0700 (PDT)
Received: from mail-lf0-x234.google.com (mail-lf0-x234.google.com [IPv6:2a00:1450:4010:c07::234]) (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 0EB6912DA13 for <netmod@ietf.org>; Wed, 25 Apr 2018 03:13:36 -0700 (PDT)
Received: by mail-lf0-x234.google.com with SMTP id b23-v6so24660110lfg.4 for <netmod@ietf.org>; Wed, 25 Apr 2018 03:13:35 -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=ENeac4W2MfojulEsoxHaD2oTwMmNUzZOCUw0UV9bAIs=; b=Qh7E8Qcfg3nu8OG85W4oDVbdS0OZR8IKDry5T67lbgfR8KSPnCH55DSbbO2V4Uk24B sBrEvMtCUHA665oW7+KUlCbkPuA+yIObKIxa/Jj1sUDPg3qma6+C8KxB8upd1IvVFwjP cAtlqY4TnN/g5SK6+mvLAa47aZ3s8s9sIfZnYe2FSnBpriFzbirheekL/D3If34CioNa ZVO4IAvRtsm6neXzdleGqznBzsQ/AbArTz6nxZ+LhHBX0frdnJZpaQdzdM3Kauv0Or3c 8Ibb9BmQqAkYHel8fOZaC/dp8uL1zfnzVWf7xcvNe+EpSAiFG/MegRt1sVAV8qR8bR+L jqQw==
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=ENeac4W2MfojulEsoxHaD2oTwMmNUzZOCUw0UV9bAIs=; b=o4eCMikFA8ILWW2AfUF4Ry/XqJHl8Pf4BD+gDCeMmuRAwrx83qXlZzX8bDZ+bor7nN lu+Qh9E/0F4jhv40YReR7X5xfM8zP/M1SpQ6FzSb1RgaqSJhuFYyG1/OGjbcp4+5EM0N eG1kjlI0xFeG2n6AsbJlS7cajpUd1RJD3JH7xI01F7I9dGlnY3oQS8BnPwaoGuLvL8cR PHvPOjc8l68NOoErtbKSZQ/ie/Y3DZPOZQMZe5/QxAx2tEF312vYnW9Ero722iN0absD zscxfsZY/VpiMUpEgTv5SQzp7i5tTUw64eqIbpAF9UFRzKQsvrVejYrAE3ldDhaozvSV FAFA==
X-Gm-Message-State: ALQs6tB8K26l+XoQGs0ITdzEvIcO3ZB6i8kKS3WHPIRoSGWOCOng13A9 hDRkTfBQur03yv0Fgi4t8XMDL4cB75GIUXdO7n+LGhHU
X-Google-Smtp-Source: AIpwx4/V/w7ZVO9bWeqSLJ9dibv5613TGkJNrrX/VgYwM+6ccIz4OLtGVa1gjyhc329YrMpbklCrrEfOmbI3TMsgUkc=
X-Received: by 10.46.127.10 with SMTP id a10mr13586626ljd.78.1524651214348; Wed, 25 Apr 2018 03:13:34 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a19:d8c6:0:0:0:0:0 with HTTP; Wed, 25 Apr 2018 03:13:33 -0700 (PDT)
In-Reply-To: <20180425.090347.389055708996810830.mbj@tail-f.com>
References: <CABCOCHTwdBbo_qtBu=_OunOtLNBXmWCWVZ8ajr0LFZPDFpNEFg@mail.gmail.com> <20180423.220815.526647366558506966.mbj@tail-f.com> <CABCOCHTt3noQ5PcX57yGi5Cm7BxQA=GCB9KajrWS2WLnYM9THA@mail.gmail.com> <20180425.090347.389055708996810830.mbj@tail-f.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Wed, 25 Apr 2018 03:13:33 -0700
Message-ID: <CABCOCHS0FL7ydRi12z=9a2vReRVNG5ULm=3V7ACuWspr2BWPCg@mail.gmail.com>
To: Martin Bjorklund <mbj@tail-f.com>
Cc: Kent Watsen <kwatsen@juniper.net>, NetMod WG <netmod@ietf.org>
Content-Type: multipart/alternative; boundary="089e082b3ee809b584056aa9869c"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/NvqFC9OPAde1EgZ9SodT5ibm4Ns>
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: Wed, 25 Apr 2018 10:13:40 -0000

On Wed, Apr 25, 2018 at 12:03 AM, Martin Bjorklund <mbj@tail-f.com>; wrote:

> Andy Bierman <andy@yumaworks.com>; wrote:
> > On Mon, Apr 23, 2018 at 1:08 PM, Martin Bjorklund <mbj@tail-f.com>;
> wrote:
> >
> > > Andy Bierman <andy@yumaworks.com>; wrote:
> > > > > ....
> > > > > >
> > > > > > I do not understand the need for a yang-data structure that
> > > represents
> > > > > data
> > > > > > that can be instantiated anywhere and everywhere.
> > > > >
> > > > > AFAIK noone is proposing that.
> > > > >
> > > > > > I do not want to break
> > > > > > existing tools that expect sibling data nodes in the same module
> > > > > namespace
> > > > > > to
> > > > > > be unique local-names.
> > > > > >
> > > > > > I would rather stick with the yang-data in RFC 8040 than
> introduce a
> > > new
> > > > > > extension
> > > > > > with no restrictions.  Standard YANG extensions should be
> > > interoperable
> > > > > and
> > > > > > have
> > > > > > a clear purpose.
> > > > >
> > > > > Of course.
> > > > >
> > > > > > If we do not need to define what a YANG extension does in
> > > > > > a way that can be observed somehow, then it does not need to be a
> > > > > standard.
> > > > >
> > > > > Agreed.
> > > > >
> > > > > Not sure how any of this helps with the original issue though.
> > > > >
> > > > >
> > > >
> > > > You proposed that duplicate nodes were OK:
> > > >
> > > > module X {
> > > > prefix x;
> > > >
> > > > x:yang-data A {
> > > >    list foo { ... }
> > > > }
> > > >
> > > > x:yang-data B {
> > > >   container foo { ... }
> > > > }
> > > >
> > > > }
> > > >
> > > >
> > > > I do not want to allow any duplicates.
> > >
> > > Yes, I got that.
> > >
> > > > There are no encoding and parsing rules for instance data
> > > > that support this sort of duplicate.
> > >
> > > This is not correct, as I have demonstrated earlier, and I think you
> > > also accepted; if different structures are defined for different rpcs'
> > > error-infos, then these structures can have the same child node names.
> > >
> > > I think that we have to agree on the basics before disussing
> > > solutions:
> > >
> > >   1)  Should we do anything at all?
> > >
> > >       (i.e., keep using yang-data in RFC 8040)
> > >
> > >   2)  Should we define structures that only can be used in
> > >       standalone instance documents?
> > >
> > >       (i.e., *more* restrictive than yang-data in RFC 8040)
> > >
> > >   3)  Should we define structures that can be used in standalone
> > >       instance documents, error-info contents, and other places that
> > >       we might not know right now?
> > >
> > >       (i.e., *less* restrictive than yang-data in RFC 8040)
> > >
> > >
> > > Since the current draft says:
> > >
> > >    The "yang-data" extension statement from RFC
> > >    8040 [RFC8040] is defined for this purpose, however it is limited in
> > >    its functionality.
> > >
> > >    The intended use of the "yang-data" extension is to model all or
> part
> > >    of a protocol message, such as the "errors" definition in ietf-
> > >    restconf.yang [RFC8040], or the contents of a file.  However,
> > >    protocols are often layered such that the header or payload portions
> > >    of the message can be extended by external documents.  The YANG
> > >    statements that model a protocol need to support this extensibility
> > >    that is already found in that protocol.
> > >
> > >
> > > I thought we are doing (3).
> > >
> > >
> > >
> > The use-case that has come up several times is (1).
> > People want to use YANG to define the schema for an XML or JSON
> > representation of a stand-alone document.
> >
> > Item (3) needs to be machine-readable and deterministic for it to be even
> > remotely
> > feasible as a standard. There is no way a tool should have to match
> <x:foo>
> > to
> > the correct schema, based on the description-stmt inside some
> > yang-data-stmt.
> > The only data needed must be module + local-name.
> >
> > The example you gave of different definitions of the <reason> leaf is a
> > really bad idea.
> > We should never try to define different schema for the same instance
> data,
> > where the module-name and local-name are the same, but the contents are
> > different.
>
> When the context is different this is not a problem.  Compare w/
> augment:
>
>     augment "/if:interfaces/if:interface" {
>       container ipv4 { ... }
>     }
>
>     augment "/if:interfaces/if:interface-state" {
>       container ipv4 { ... }
>     }
>
>

But you are proposing that the target location not be specified,
or specified inside a description-stmt.

No matter what context you pick, DOUBLE augment is not allowed:


    augment "/if:interfaces/if:interface" {
      container ipv4 { ... }
    }


    augment "/if:interfaces/if:interface" {
      container ipv4 { ... }
    }


So yang-data cannot define the same node in multiple contexts.
Leaving the context unspecified is not an option.





> These augements define the node "ipv4" in the the "ietf-ip" namespace,
> but b/c the context is different, there is no risk for confusion.
>
> > Defining an extension that maps error-info data for a specific RPC might
> be
> > something worth standardizing.  It should not be done with yang-data,
> > but rather a different extension just for this purpose.
>
> See my email to Kent.  I don't understand why this can't be done with
> yang-data.  This said, if we were to do a new version of YANG and
> address this problem, we would define a new core keyword for this.
>
>
> /martin
>
>
>

Andy



>
>
> >
> >
> >
> > > /martin
> > >
> >
> > Andy
> >
> >
> > >
> > >
> > >
> > > > yang-data definitions define conceptual data nodes (e.g, /x:foo)
> > > > Only one data-def-stmt (in yang-data or otherwise) can define a data
> node
> > > > /x:foo.
> > > > The descriptive names for the yang-data (A or B) do not define
> > > namespaces.
> > > >
> > > >
> > > >
> > > > > /martin
> > > > >
> > > > >
> > > > Andy
> > >
>