Re: [netconf] YANG attributes in a datastore

Martin Bjorklund <mbj@tail-f.com> Tue, 10 December 2019 14:55 UTC

Return-Path: <mbj@tail-f.com>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E0D5B1200B9 for <netconf@ietfa.amsl.com>; Tue, 10 Dec 2019 06:55:46 -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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 9GweWIl5bKdm for <netconf@ietfa.amsl.com>; Tue, 10 Dec 2019 06:55:45 -0800 (PST)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id C860D1200B6 for <netconf@ietf.org>; Tue, 10 Dec 2019 06:55:44 -0800 (PST)
Received: from localhost (unknown [173.38.220.41]) by mail.tail-f.com (Postfix) with ESMTPSA id DA4371AE02A7; Tue, 10 Dec 2019 15:55:43 +0100 (CET)
Date: Tue, 10 Dec 2019 15:55:08 +0100
Message-Id: <20191210.155508.1463469968893061984.mbj@tail-f.com>
To: lhotka@nic.cz
Cc: netconf@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <1eba9ea2d474ccc9cff0906e6f269fd9a532c03c.camel@nic.cz>
References: <5cce-5def9a00-11-66c7ce00@101566344> <20191210.150333.2171238725445540389.mbj@tail-f.com> <1eba9ea2d474ccc9cff0906e6f269fd9a532c03c.camel@nic.cz>
X-Mailer: Mew version 6.8 on Emacs 25.2
Mime-Version: 1.0
Content-Type: Text/Plain; charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/uubWuVze5gl5uOmC_IF8JBnmZkA>
Subject: Re: [netconf] YANG attributes in a datastore
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETCONF WG list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Dec 2019 14:55:47 -0000

Ladislav Lhotka <lhotka@nic.cz> wrote:
> On Tue, 2019-12-10 at 15:03 +0100, Martin Bjorklund wrote:
> > Hi,
> > 
> > Michal Vaško <mvasko@cesnet.cz> wrote:
> > > Hello,
> > > we are thinking about adding support for arbitrary attributes [1] in
> > > our YANG/NETCONF datastore. To my knowledge, only the representation
> > > in XML or JSON is defined and standardized but there are no guidelines
> > > for editing (CRUD) these attributes.
> > > 
> > > So, my question is a rather general one, regarding implementations
> > > that support editing these attributes, would you mind sharing some
> > > basic ideas or principles used? Or is this outside any consensus and
> > > each implementation is free to handle this completely in its own
> > > fashion? Thanks for any input.
> > 
> > I think this depends on the attribute defintion.  Some attributes are
> > read-only from the northbound's protocol point of view.  Internally in
> > the server you may need some API to set/change them of course.  Some
> > other attributes are read-write.
> > 
> > In our implementation we support a few read-write attributes (and some
> > read-only).  Here's a simple example (in an edit-config):
> > 
> >   <foo annotation="hello"/>
> > 
> > This would set/change the "annotation" attribute's value to
> > "hello", regardless of its previous value.
> > 
> > To delete an annotation, you would do:
> > 
> >   <foo annotation=""/>
> > 
> > Each of our attributes has a special value that means "delete" (in
> > most cases it is the empty string.
> 
> Hmm, why don't you do simply
> 
> <foo/>
> 
> to delete the attribute?

B/c that would mean that all attributes would have to be repeated just
to set a value; I don't want:

  <foo>42</foo>

to erase all attributes on foo.


/martin
 

> 
> Lada
> 
> > 
> > 
> > /martin
> > 
> > 
> > 
> > 
> > > Regards,
> > > Michal
> > > 
> > > [1] https://tools.ietf.org/html/rfc7952
> > > 
> > > _______________________________________________
> > > netconf mailing list
> > > netconf@ietf.org
> > > https://www.ietf.org/mailman/listinfo/netconf
> > > 
> > _______________________________________________
> > netconf mailing list
> > netconf@ietf.org
> > https://www.ietf.org/mailman/listinfo/netconf
> -- 
> Ladislav Lhotka
> Head, CZ.NIC Labs
> PGP Key ID: 0xB8F92B08A9F76C67
> 
> _______________________________________________
> netconf mailing list
> netconf@ietf.org
> https://www.ietf.org/mailman/listinfo/netconf