Re: [netmod] yang-json document

Martin Bjorklund <mbj@tail-f.com> Mon, 09 February 2015 15:33 UTC

Return-Path: <mbj@tail-f.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 58BB01A1A31 for <netmod@ietfa.amsl.com>; Mon, 9 Feb 2015 07:33:22 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.911
X-Spam-Level:
X-Spam-Status: No, score=-1.911 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
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 XwwuG_-N67qt for <netmod@ietfa.amsl.com>; Mon, 9 Feb 2015 07:33:09 -0800 (PST)
Received: from mail.tail-f.com (mail.tail-f.com [83.241.162.140]) by ietfa.amsl.com (Postfix) with ESMTP id D2A011A0AF7 for <netmod@ietf.org>; Mon, 9 Feb 2015 07:33:04 -0800 (PST)
Received: from localhost (unknown [193.13.112.215]) by mail.tail-f.com (Postfix) with ESMTPSA id D47711280B72; Mon, 9 Feb 2015 16:33:03 +0100 (CET)
Date: Mon, 09 Feb 2015 16:33:04 +0100
Message-Id: <20150209.163304.1056665518440015232.mbj@tail-f.com>
To: andy@yumaworks.com
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <CABCOCHTdoQC7M0x4S9j05NyGVLjc+HmSq=uo9GEi07fExv8YTw@mail.gmail.com>
References: <E30F2CF1-D6A9-4EEB-A59E-52695F717876@nic.cz> <20150209.135651.1017394851894918029.mbj@tail-f.com> <CABCOCHTdoQC7M0x4S9j05NyGVLjc+HmSq=uo9GEi07fExv8YTw@mail.gmail.com>
X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="utf-8"
Content-Transfer-Encoding: base64
Archived-At: <http://mailarchive.ietf.org/arch/msg/netmod/2dJKgmaKIaCCQJRtcXYMB2nU2Sw>
Cc: netmod@ietf.org
Subject: Re: [netmod] yang-json document
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.15
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: <http://www.ietf.org/mail-archive/web/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, 09 Feb 2015 15:33:22 -0000

Andy Bierman <andy@yumaworks.com> wrote:
> On Mon, Feb 9, 2015 at 4:56 AM, Martin Bjorklund <mbj@tail-f.com> wrote:
> > Ladislav Lhotka <lhotka@nic.cz> wrote:
> >>
> >> > On 09 Feb 2015, at 09:59, Andy Bierman <andy@yumaworks.com> wrote:
> >> >
> >> > On Mon, Feb 9, 2015 at 12:18 AM, Martin Bjorklund <mbj@tail-f.com>
> >> > wrote:
> >> >> Phil Shafer <phil@juniper.net> wrote:
> >> >>> Andy Bierman writes:
> >> >>>> Solution Y34-06
> >> >>>>   - do not deprecate anyxml
> >> >>>>   - do not add anydata (no agreement on rules)
> >> >>>>   - implementations MAY restrict the XML accepted in anyxml
> >> >>>>      - MAY ignore processing instructions
> >> >>>>      - MAY reject mixed mode input
> >> >>>>   - document in YANG 1.1 that anyxml is not considered interoperable
> >> >>>>     if PIs and mixed mode XML are used
> >> >>>
> >> >>> This is essenially "be aware that server implementations might not
> >> >>> implement all of YANG".
> >> >>>
> >> >
> >> > Isn't this already the case?
> >> > Why is it that not all servers fully support anyxml?
> >> >
> >> >
> >> >>>>   - The guidelines document should say that YANG Doctors will review
> >> >>>>     each use of anyxml in IETF modules
> >> >>>
> >> >>> This part I completely agree with.
> >> >>>
> >> >>> Here's my proposal:
> >> >>>
> >> >>> Solution Y34-07
> >> >>>  - do not change YANG
> >> >>>  - Change the JSON encoding rules to encode anyxml nodes as strings
> >> >>>  - The guidelines document should say that YANG Doctors will review
> >> >>>    each use of anyxml in IETF modules (lifted from Y34-06)
> >> >>
> >> >> This is fine (*) as one part of the solution, but by itself it isn't
> >> >> sufficient.
> >> >>
> >> >> The problem is illustrated in YANG PATCH, which is supposed to work
> >> >> for both XML and JSON.  If YANG PATCH uses anyxml, it means that the
> >> >> JSON encoding of a YANG PATCH is pretty much useless (since the edit
> >> >> would be expressed as XML, but the reast in JSON).
> >> >>
> >> >> This is why we have suggested to add anydata, which YANG PATCH then
> >> >> should use instead of anyxml.
> >> >>
> >> >
> >> >
> >> > I strongly object to making YANG Patch YANG 1.1 only.
> >> > I would rather drop JSON support.
> >>
> >> I think you can continue using anyxml in YANG PATCH, IMO there is
> >> nothing wrong with it. If the module gets upgraded to YANG 1.1, the
> >> descriptions could perhaps be made shorter, and that’s all.
> >
> > I think you're missing the context.  Phil suggested that anyxml should
> > be encoded as a string in json, and we're discussing the implications
> > of that.  In this context, I do not think that anyxml can be used in
> > YANG PATCH - or we do what Andy suggests, drop json support.
> >
> 
> It would be a shame to drop JSON support, because implementations will
> ignore the standard and continue to support JSON in proprietary ways.
> 
> The frustrating part for me is that there is not 1 single implementation
> that is actually using anyxml as configuration storage for HTML.
> If this is such a great use-case, then why isn't anybody doing it?
> 
> OTOH, using anyxml as free-form YANG data nodes is implemented
> by many vendors, in many forms, and has been working fine for years.

Agreed.  But this is not anyxml, it is anydata.  So if we introduce
anydata, we're standardizing what people are doing already.

anyxml is still needed in order to correctly define the NETCONF
protocol.  There are actually quite a few NETCONF implementations that
still use some proprietary language; i.e., even if we had anydata it
would be inappropraite to use it in the ietf-netconf.yang model.

> I don't know why we would design for the 0% use-case instead of the
> 100% use-cases.  The IETF seems to get wrapped around the axle
> far too easily.

To me it seems the only issue is timing.  If we had YANG 1.1. w/
anydata today, YANG PATCH would use it, and everyone would be happy.

anydata would have a clear encoding and mapping in JSON, and anyxml
would not.


/martin