Re: [netmod] metadata in JSON

Ladislav Lhotka <lhotka@nic.cz> Mon, 28 July 2014 15:32 UTC

Return-Path: <lhotka@nic.cz>
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 37A951B2892 for <netmod@ietfa.amsl.com>; Mon, 28 Jul 2014 08:32:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.652
X-Spam-Level:
X-Spam-Status: No, score=-0.652 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HELO_EQ_CZ=0.445, HOST_EQ_CZ=0.904, RP_MATCHES_RCVD=-0.001] autolearn=no
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 m2hp0Zdj3quh for <netmod@ietfa.amsl.com>; Mon, 28 Jul 2014 08:32:07 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2BF8D1B2890 for <netmod@ietf.org>; Mon, 28 Jul 2014 08:32:07 -0700 (PDT)
Received: from [172.29.2.201] (nat-5.bravonet.cz [77.48.224.5]) by mail.nic.cz (Postfix) with ESMTPSA id 6CEB913F697; Mon, 28 Jul 2014 17:32:05 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nic.cz; s=default; t=1406561525; bh=fmvAChxA2gxu6mBVGy49YVlO/cmksWgKiaKPtacuxiw=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=OEVXQJ4OYcYEl4VCFpBwV5b3uu+I5Q0LhczcdTjXdMMOGCl3PvpK9kn8WXxrkKSf+ lyq1dT78VLlOLknXSMz4d/z48F7iGih0Wv4NR5Rtwzvl8cZBoBWA2E3exZwV2CIKT3 P16n0LVLn5oXHi+6aTP3lt7++MoYcUaiVNybsdD4=
Content-Type: text/plain; charset="windows-1252"
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
From: Ladislav Lhotka <lhotka@nic.cz>
In-Reply-To: <CABCOCHTOYqBe1dVAJA2CmBhho2AG68nEg9o5pPwQavvDHy=3Vg@mail.gmail.com>
Date: Mon, 28 Jul 2014 17:31:56 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <C7194C07-B8B0-4C4B-B7C8-A0F468516E27@nic.cz>
References: <m27g2xdf50.fsf@nic.cz> <20140728095501.GB55180@elstar.local> <m21tt5dbhq.fsf@nic.cz> <CABCOCHRg8LiKj9ZQa1T8-Hp1wFq4zXPo_u381eWNL218oa2vGA@mail.gmail.com> <A8E4F278-1C03-45B9-B961-56C6DB852A19@nic.cz> <20140728121328.GA55631@elstar.local> <CABCOCHS+jqHLn8hcQmG6ErA91jdPuRsReAou+XUtu5MyeGSA4Q@mail.gmail.com> <5392C525-EB34-4E8A-BB39-B1464E4DE4C9@nic.cz> <CABCOCHS8aXQKMqq+h=7fvjhpdiBpR8PbCT5QkwM3Y9KKyV0=eQ@mail.gmail.com> <E0C7A946-BB33-493C-BD95-B3BFC3EC11DF@nic.cz> <CABCOCHTOYqBe1dVAJA2CmBhho2AG68nEg9o5pPwQavvDHy=3Vg@mail.gmail.com>
To: Andy Bierman <andy@yumaworks.com>
X-Mailer: Apple Mail (2.1878.6)
X-Virus-Scanned: clamav-milter 0.98.1 at mail
X-Virus-Status: Clean
Archived-At: http://mailarchive.ietf.org/arch/msg/netmod/TKQiy5mYBvxEvn9C5hW6PZdQBC8
Cc: "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [netmod] metadata in JSON
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, 28 Jul 2014 15:32:09 -0000

On 28 Jul 2014, at 16:54, Andy Bierman <andy@yumaworks.com> wrote:

> 
> 
> 
> On Mon, Jul 28, 2014 at 7:17 AM, Ladislav Lhotka <lhotka@nic.cz> wrote:
> 
> On 28 Jul 2014, at 15:32, Andy Bierman <andy@yumaworks.com> wrote:
> 
> >
> >
> >
> > On Mon, Jul 28, 2014 at 6:10 AM, Ladislav Lhotka <lhotka@nic.cz> wrote:
> >
> > On 28 Jul 2014, at 14:33, Andy Bierman <andy@yumaworks.com> wrote:
> >
> > >
> > >
> > >
> > > On Mon, Jul 28, 2014 at 5:13 AM, Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> wrote:
> > > On Mon, Jul 28, 2014 at 02:06:30PM +0200, Ladislav Lhotka wrote:
> > > >
> > >
> > > > But then, IMO, the cleanest way is to make this explicit by using the “attribute” statement which
> > > >
> > > > - assigns the attribute to a module,
> > > > - also assigns the namespace URI and recommended prefix for XML encoding,
> > > > - defines a datatype for the attribute, which may occasionally be useful.
> > > >
> > > > I’d like to emphasize that Y33 was only about global attributes, i.e. it doesn’t attempt to make attributes into regular data nodes, so the following would NOT be possible:
> > > >
> > > > leaf flag {
> > > >     attribute foo {…}
> > > >     …
> > > > }
> > >
> > > I can counter argue that easily: If we do not do Y33, then there are
> > > no attributes and hence there is no need to encode them in JSON. Move
> > > the whole attribute encoding text into a non-normative appendix and we
> > > are done.
> > >
> > >
> > > Several people want to support attributes in the RESTCONF protocol messages.
> > > Martin came up with a solution that works and we already agreed to use it
> > > in RESTCONF.
> >
> > This doesn’t necessarily mean it has to be part of draft-ietf-netmod-yang-json.
> >
> 
> 
> So if it was moved to a different document, that would be OK?
> Vendors will implement the standard if there is one.  If not,
> the features vendors need will get implemented anyway,
> but proprietary schemes.

As far as the yang-json draft is concerned, this would be OK. Attributes aren’t YANG data nodes.

> 
> >
> >

...

> > The WG already decided to move this text from RESTCONF to the JSON draft.
> 
> I haven’t seen any evidence of this being a WG decision. That’s why the first question in my presentation in Toronto was
> 
>    Is this draft an appropriate place for defining metadata encoding in JSON?
> 
> and I didn’t notice any consensus about this in the room. In the relevant thread
> 
> http://www.ietf.org/mail-archive/web/netmod/current/msg09338.html
> 
> only you and Martin wanted to have the mapping in the yang-json draft but Martin also said (http://www.ietf.org/mail-archive/web/netmod/current/msg09350.html):
> 
>        Maybe the original JSON mapping idea is the only one that works; i.e.,
>        map pure YANG data to JSON.  No meta data.  A protocol that needs meta
>        data should not use JSON; use XML instead.
> 
> 
> > So what new arguments are you presenting that justify re-opening this issue?
> 
> The lack of namespace mapping.
> 
> 
> The RFC that defines any protocol attributes for RESTCONF can define a YANG module
> if they want, so there is a module name to specify in the ad-hoc or XSD text. 
> 
> RFC 6020bis can easily register a standard module name
> that goes with the YANG XML namespace if the insert attributes
> ever need to be supported (and there is desire to make sure YANG
> is not XML-specific).  Your draft just needs to say
> that the field contains a YANG module name.

It should also specify how the association between an attribute and a module is established, if the module says nothing about it, or even doesn’t exist at all. How do you find out which attributes are associated with a given module? Can anybody add a new attribute to an existing module at any time? 

I really fail to see how a module-top-level “attribute” statement could possibly encourage misuse of attributes, I’d say it’s rather the opposite. Having an explicit attribute definition with a description and subject to revision rules of YANG modules etc. is IMO much better than implicit and hand-waving associations.

Lada

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C