Re: [netmod] attributes in draft-lhotka-netmod-yang-json

Martin Bjorklund <mbj@tail-f.com> Thu, 20 March 2014 14:04 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 6D76B1A08DA for <netmod@ietfa.amsl.com>; Thu, 20 Mar 2014 07:04:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.448
X-Spam-Level:
X-Spam-Status: No, score=-2.448 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.547, SPF_PASS=-0.001] 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 7p1IjqxohYVk for <netmod@ietfa.amsl.com>; Thu, 20 Mar 2014 07:04:38 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [109.74.15.94]) by ietfa.amsl.com (Postfix) with ESMTP id 2B3511A08D1 for <netmod@ietf.org>; Thu, 20 Mar 2014 07:04:36 -0700 (PDT)
Received: from localhost (s193-12-74-81.cust.tele2.se [193.12.74.81]) by mail.tail-f.com (Postfix) with ESMTPSA id AAF803B4090; Thu, 20 Mar 2014 15:04:26 +0100 (CET)
Date: Thu, 20 Mar 2014 15:04:26 +0100
Message-Id: <20140320.150426.496532825.mbj@tail-f.com>
To: deanb@juniper.net
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <3FADE5E8-88AC-4FD0-A2F6-72F408FAFFC4@juniper.net>
References: <3FADE5E8-88AC-4FD0-A2F6-72F408FAFFC4@juniper.net>
X-Mailer: Mew version 6.5 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: http://mailarchive.ietf.org/arch/msg/netmod/cNndzqrly4KJjkhhHdMN2BAanWA
Cc: netmod@ietf.org
Subject: Re: [netmod] attributes in draft-lhotka-netmod-yang-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: Thu, 20 Mar 2014 14:04:46 -0000
X-List-Received-Date: Thu, 20 Mar 2014 14:04:46 -0000

Dean Bogdanovic <deanb@juniper.net> wrote:
> Hi, 
> 
> In draft yang leaf node is defined as name value pair in json
> 
> If it would be represented, as an object then we can assign attributes to it.
> 
> Example
> "host-name" {
>    "data" : "router",
> 	"attributes" : { "protect" : protect}
> }
> 
> We need attributes for several things, so lets try to figure out how to enable
> them.

I agree that the lack of attributes is a problem with the JSON
mapping.

The problem with your solution is that it adds noise to the normal
case where there are no attributes.  We're using another encoding:

   "host-name": "router",
   "@host-name": {
       "protect": "protect",
       ...
    }

Yep, not very elegant...


/martin