Re: [netmod] instance file format and etags/timestamps, xml attributes

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Fri, 30 November 2018 12:48 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
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 CAB6D1294D7 for <netmod@ietfa.amsl.com>; Fri, 30 Nov 2018 04:48:06 -0800 (PST)
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, RCVD_IN_DNSWL_NONE=-0.0001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=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 McWN6AkYP9JE for <netmod@ietfa.amsl.com>; Fri, 30 Nov 2018 04:48:05 -0800 (PST)
Received: from atlas5.jacobs-university.de (atlas5.jacobs-university.de [212.201.44.20]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0B1C3128AFB for <netmod@ietf.org>; Fri, 30 Nov 2018 04:48:05 -0800 (PST)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas5.jacobs-university.de (Postfix) with ESMTP id B88E4DC0; Fri, 30 Nov 2018 13:48:03 +0100 (CET)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas5.jacobs-university.de ([10.70.0.217]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10032) with ESMTP id Bx7NNIg38uqw; Fri, 30 Nov 2018 13:48:03 +0100 (CET)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hermes.jacobs-university.de", Issuer "Jacobs University CA - G01" (verified OK)) by atlas5.jacobs-university.de (Postfix) with ESMTPS; Fri, 30 Nov 2018 13:48:03 +0100 (CET)
Received: from localhost (demetrius4.jacobs-university.de [212.201.44.49]) by hermes.jacobs-university.de (Postfix) with ESMTP id A1B9F2003F; Fri, 30 Nov 2018 13:48:03 +0100 (CET)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius4.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id Gtk6eo0BCmwg; Fri, 30 Nov 2018 13:48:02 +0100 (CET)
Received: from exchange.jacobs-university.de (sxchmb03.jacobs.jacobs-university.de [10.70.0.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "exchange.jacobs-university.de", Issuer "DFN-Verein Global Issuing CA" (verified OK)) by hermes.jacobs-university.de (Postfix) with ESMTPS id C1ACA20037; Fri, 30 Nov 2018 13:48:02 +0100 (CET)
Received: from anna.localdomain (10.50.218.117) by sxchmb03.jacobs.jacobs-university.de (10.70.0.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1591.10; Fri, 30 Nov 2018 13:48:02 +0100
Received: by anna.localdomain (Postfix, from userid 501) id E9F31300489248; Fri, 30 Nov 2018 13:48:01 +0100 (CET)
Date: Fri, 30 Nov 2018 13:48:01 +0100
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Balázs Lengyel <balazs.lengyel@ericsson.com>
CC: "netmod@ietf.org" <netmod@ietf.org>
Message-ID: <20181130124801.i2yhzkw3e6ml4qnv@anna.jacobs.jacobs-university.de>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Balázs Lengyel <balazs.lengyel@ericsson.com>, "netmod@ietf.org" <netmod@ietf.org>
References: <20181128100116.c6awxlwkxnm42gfb@anna.jacobs.jacobs-university.de> <6c329ed9-efdd-19cb-a346-f90fa1e3cfed@ericsson.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
X-Clacks-Overhead: GNU Terry Pratchett
Content-Transfer-Encoding: 8bit
In-Reply-To: <6c329ed9-efdd-19cb-a346-f90fa1e3cfed@ericsson.com>
User-Agent: NeoMutt/20180716
X-ClientProxiedBy: SXCHMB04.jacobs.jacobs-university.de (10.70.0.156) To sxchmb03.jacobs.jacobs-university.de (10.70.0.155)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/550I3qKxr9utzd7cIQT2uvhXuAo>
Subject: Re: [netmod] instance file format and etags/timestamps, xml attributes
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
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: Fri, 30 Nov 2018 12:48:07 -0000

On Fri, Nov 30, 2018 at 12:28:09PM +0000, Balázs Lengyel wrote:
>    Hello Jurgen,
> 
>    Thanks for the comments. See answers below.
> 
>    regards Balazs
> 
>    On 2018. 11. 28. 11:01, Juergen Schoenwaelder wrote:
> 
>  draft-ietf-netmod-yang-instance-file-format-00.txt says:
> 
>     The JSON format SHALL follow the format of the reply returmed for a
>     RESTCONF GET request directed at the datastore resource:
>     {+restconf}/data.  ETags and Timestamps SHOULD NOT be included, but
>     if present SHOULD be ignored.
> 
>  I assume that you mean the JSON content in the message-body of the
>  HTTP Response message for GET message. My understanding is that ETags
>  and Timestamps (what are these precisely?) are carried in the HTTP
>  header. So how could the ETag or 'Timestamps' be in the JSON data?  We
>  should not mess up the HTTP difference between header data and payload
>  data.
> 
>    BALAZS: OK, I will correct it. Yes, it is the payload that I want to
>    include in the instance data.
>    I thought that lower level etags/timestamps are returned inside the
>    get-response payload. On re-reading RFC8040 I see my mistake.

The more I think of it, defining the format by refering to specific
protocol operations really seems to be broken and causing complex
maintenance problems in the future. If you fetch <operational>, you do
not do a GET on {+restconf}/data.

>  I also do not fully understand the text concerning the XML format.
> 
>     The XML format SHALL follow the format returned for a NETCONF GET
>     operation.  The <data> anydata (which is not part of the real data
>     itself) SHALL contain all data that would be inside the <data>
>     wrapper element of a reply to the <get> operation.  XML attributes
>     SHOULD NOT be present, however if a SW receiving a YANG Based
>     Instance data file encounters XML attributes unknown to it, it MUST
>     ignore them, allowing them to be used later for other purposes.
> 
>  It is unclear what exactly is the instance data - the entire reponse?
>  Everything inside <data>? Everything inside and including <data>? I
>  assume the second sentence is trying to say the later but I do not
>  find it very clear not does it seem to be right. The examples show to
>  content of the NETCONF <rpc-reply><data/></rpc-reply> inside a <data>
>  container that belongs to the instance data format (two times <data>
>  but in different namespaces).
> 
>    BALAZS: I will try to reword it to clarify the issue. How about:
> 
>    An instance data set is made up of header part and content-data. The
>    content-data is all data inside the anydata data node.
> 
>    The header part is defined by the -ietf-instance-data module while the
>    content-data is defined by the target YANG modules. The content-dataÂ
>    SHALL contain all data that would be inside the <data> wrapper element of
>    a reply to the <get> operation . Â
> 
>    I hope this conveys that content data excludes the <data> wrapper element
>    from the get-reply.

As explained above already, I meanwhile believe it is wrong to define
the format by refering to protocol operations. A NETCONF <get> (using
NETCONF writing style) is wrong for any NMDA datastore content. We
should define the instance data format by refering to the XML and JSON
YANG encoding rules and not by refering to specific protocol
operations.

>  It is also unclear to me why XML attributes are to be removed. Why is
>  that? If I snapshot <operational>, why should I remove important
>  information such origin annotations? And removing attributes is
>  actually plain wrong if you consider that attributes carry XML
>  namespaces.
> 
>    BALAZS: You are right, although some attributes might be absent in some
>    use cases. E.g. namespace as you pointed out is always needed. However
>    e.g. origin may be present if the instance data is a snapshot of the
>    operational datastore, but it may be absent if the instance data is used
>    to document readOnly server capabilities.
> 
>    So I propose to change the text to:
> 
>  Some XML attributes (e.g. metadata like origin) MAY be absent.
>          SW handling YANG Instance data MUST ignore
>          XML attributes unknown to it, allowing them to be used
>          later for other purposes.

I disagree and I would prefer to be silent. The YANG models and the
encoding rules define the content. The instance format document has no
right to mess around with that. Whether origin is there or not is well
defined elsewhere. It is not the job of this document to repeat or
even change what is said elsewhere.
 
>  /js
> 
>  PS: I am also concerned about the revision being not fine grained
>      enough to be useful. I would love to have a much more precise
>      timestamp telling me when the instance data was recorded. I would
>      probably replace 'revision' with simply a 'timestamp' or add next
>      to a 'revision' a more fine grained 'timestamp'.
> 
>    BALAZS: I agree that in some use cases a timestamp would be useful e.g.
>    diagnostic data from a real live YANG server.
>    However in other use cases like documenting factory default, defining
>    default configuration to be preloaded or documenting server capabilities I
>    see no need for the timestamp. It is not interesting exactly at which
>    hour/minute/second the server capabilities were documented.
>    So while I would not like to add the timestamp in the draft, the draft
>    documents, that additional metadata like a timestamp may be added to the
>    instance data set.
> 

Having an (optional) timestamp with proper granularity seems rather
basic for me and I fail to see why we would not define this.

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>