Re: [netmod] Regarding origin annotation encoding in ietf-netconf-nmda-restconf-05

Ladislav Lhotka <lhotka@nic.cz> Thu, 14 February 2019 11:40 UTC

Return-Path: <lhotka@nic.cz>
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 4F584131166 for <netmod@ietfa.amsl.com>; Thu, 14 Feb 2019 03:40:48 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.999
X-Spam-Level:
X-Spam-Status: No, score=-6.999 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, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
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 K34pUYDKJzq2 for <netmod@ietfa.amsl.com>; Thu, 14 Feb 2019 03:40:45 -0800 (PST)
Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4DBBF131162 for <netmod@ietf.org>; Thu, 14 Feb 2019 03:40:45 -0800 (PST)
Received: from birdie (unknown [IPv6:2001:1488:fffe:6:1f99:257b:62cc:c0d5]) by mail.nic.cz (Postfix) with ESMTPSA id 79B3A60611; Thu, 14 Feb 2019 12:40:42 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1550144442; bh=2RK/Y4PH+HREcIJUVXFKgZHd8hlRWGZou51uaArUk0Y=; h=From:To:Date; b=u8XjnRGF1HD93pSFeDMeSpJRAsGjI6ixmUW2qj/vwOf4MF6Ma+oIXdQiynXebOnTZ Tp7ACv+8+YMyvWF3IzaQtLVy7BWpLi7QUcOGZBdDTzwkB6rQMi6YVEf4kHHi8JKQf8 dendIQfgu6AIPPerYhVs/DBYJCTFHhyl2PiPeCvw=
Message-ID: <d16d52297f7440dc91ef556e95d13da0d0148159.camel@nic.cz>
From: Ladislav Lhotka <lhotka@nic.cz>
To: Robert Wilton <rwilton@cisco.com>, Amar Jadagoud <ammys.vas@gmail.com>, netmod@ietf.org
Date: Thu, 14 Feb 2019 12:40:42 +0100
In-Reply-To: <d8bc9eae-c947-4f13-b22c-ee2207ec6b99@cisco.com>
References: <CAKiLt9+K=X2jRWJZo4vT4DC=aNVH0RL6b2ByNwh2Z1JykcWcPw@mail.gmail.com> <d8bc9eae-c947-4f13-b22c-ee2207ec6b99@cisco.com>
Organization: CZ.NIC
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.30.5
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: clamav-milter 0.99.2 at mail
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/vEQ1WqyEypTsz_obvjDNX0Dkscw>
Subject: Re: [netmod] Regarding origin annotation encoding in ietf-netconf-nmda-restconf-05
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: Thu, 14 Feb 2019 11:40:48 -0000

On Thu, 2019-02-14 at 11:26 +0000, Robert Wilton wrote:
> Hi Amar,
> Based on RFC 7952 section 5.2.1, I think that it would look like this:
> {
>     "example:interface" : [
>        {
>            "name" : "eth1", 
>            "mtu" : 1500,
>            "@mtu" : {
>                   "ietf-netconf-with-defaults:default" : true,
>                   "ietf-origin:origin" : intended
>               }, 
>            "status" : "up" 
>       } 
>   ] 
> }
> Thanks,
> Rob

It depends. The version above is correct but both annotations are attached to
the "mtu" leaf. If the idea was to attach the origin annotation to the interface
entry, then it should be encoded like this:

{
    "example:interface" : [
       {
	   "name" : "eth1",
	   "mtu" : 1500,
	   "@mtu" : {
		  "ietf-netconf-with-defaults:default" : true
	      },
	    "@" : {
		    "ietf-origin:origin" : intended
	          },
	      "status" : "up"
      }
  ]
}

Lada

> 
> On 14/02/2019 06:49, Amar Jadagoud wrote:
> > Hi All,
> > 
> > I have a question regarding encoding of origin annotation along with other
> > annotation (with-defaults) in JSON metadata encoding format. 
> > 
> > Suppose if below is the GET method :
> > 
> > GET /restconf/ds/ietf-datastores:operational/ietf-
> > interface:interfaces/interface=eth1?with-defaults=report-all-tagged&with-
> > origin HTTP/1.1
> > 
> > How both origin and with-defaults annotations should be encoded in the JSON
> > metadata encoding format? 
> > 
> > Currently in restconf RFC 8040, in section 5.3.2, example with only one
> > annotation is provided.
> > 
> >  Refering to this example, whether multiple annotation representation should
> > be like below? 
> > 
> > {
> >     "example:interface" : [
> >        {
> >            "name" : "eth1", 
> >            "mtu" : 1500,
> >            "@mtu" : {
> >                   "ietf-netconf-with-defaults:default" : true
> >               }, 
> >               {
> >                     "ietf-origin:origin" : intended
> >               }, 
> >               "status" : "up" 
> >       } 
> >   ] 
> > } 
> > 
> > Thanks, 
> > Amar
> > 
> > 
> > _______________________________________________
> > netmod mailing list
> > netmod@ietf.org
> > https://www.ietf.org/mailman/listinfo/netmod
> 
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67