Re: [netconf] ?==?utf-8?q? edit-config leaf without value

Radek Krejčí <rkrejci@cesnet.cz> Mon, 09 March 2020 14:00 UTC

Return-Path: <rkrejci@cesnet.cz>
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 60D643A1080 for <netconf@ietfa.amsl.com>; Mon, 9 Mar 2020 07:00:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.096
X-Spam-Level:
X-Spam-Status: No, score=-2.096 tagged_above=-999 required=5 tests=[BAD_ENC_HEADER=0.001, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=cesnet.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 P3ROtgJtfYZY for <netconf@ietfa.amsl.com>; Mon, 9 Mar 2020 07:00:53 -0700 (PDT)
Received: from office2.cesnet.cz (office2.cesnet.cz [IPv6:2001:718:1:101::144:244]) (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 A5AA63A1099 for <netconf@ietf.org>; Mon, 9 Mar 2020 07:00:53 -0700 (PDT)
Received: from [IPv6:2001:67c:1220:80c:b3:eadf:3a72:9f] (unknown [IPv6:2001:67c:1220:80c:b3:eadf:3a72:9f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by office2.cesnet.cz (Postfix) with ESMTPSA id 3D059400052; Mon, 9 Mar 2020 15:00:46 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=office2-2020; t=1583762449; bh=wCWMPgOJaByb3yjv+qTt2Mc8vHMwmXQL3ZnKZYO40Ls=; h=Subject:To:References:From:Date:In-Reply-To; b=dF50hLkkySi4SP4xmNJFx3VMfg8p8VJlOZgzCSOr0lMpe62VRD3O+kDLHSkI6bizu 5+ogeDsMGVKW7+wVdzd6FHJsd7P+iJ2Fd5HA+/gPOHCjJO4th0AtoT5ibzQFREjagq unu99jBkazpDNc3yYADREnDQ2+H+sSYsSBGox+ccgcnlA9F2ja2bDCn5O+27hS0edf 2ln0FF7hOgIbCl0JLqu6L8mSnm59qzXsxWxzWzKI4l/LvsT4OGQwhXJVNuvK5mAPXs T9iOHMmiB7r/VxIN2OQnm8GwLi6H7blSWWgluCz9rG81izQxWBkmH24uBLZ4nwDhDE KnX9UepJeTApQ==
To: Michal Vaško <mvasko@cesnet.cz>, "Rob Wilton (rwilton)" <rwilton@cisco.com>, netconf <netconf@ietf.org>
References: <1af0-5e65ed80-f-33fd2280@3977087> <2f574fd1-b616-9f1c-24f4-5e14b5a93c40@cesnet.cz> <20200309130108.thfmu6gu5ds7h4ri@anna.jacobs.jacobs-university.de>
From: Radek Krejčí <rkrejci@cesnet.cz>
Autocrypt: addr=rkrejci@cesnet.cz; prefer-encrypt=mutual; keydata= xsDiBEKfHd4RBADDE8CtJpEtOraXBKfQg0KCRZu7BRALixoLqW98U+N9h+PJ+gCnFaKNmnYu fXWLYKTJRUlaoMGIJOZjHpr/zvwozSR+VJkxCsTyNYTF8vIfN3Iwrxy9e8CNy/O1GI50K/ld WWMDl+3M2NztiBFPrCT0b/U5ErsN7bTrf2XLEQRpZwCg95POGbJPqPAaaok2KU5e2u0/flsD /AyC0aRO66Ci0OGw0R5sCJmzZ5xE5eBUvfx0N0IC16aojrwRYM5yf+bULtBDd4wPI1R+VH/X P6OrDgzlDmutJthVtYfCcho3IhqnVo1R/UvJxjF3ATKbOnVHL4xwiLSrRDb6rKVyd1+Kc7cq +JABgFl+JP4xndytvvUXdVqhuSUFBACCDdDtxutkclBrvEp2guBIftuT4/oK3IWxgtevlGfY LZXwdD6pIWS1z6y6xthoFTsLWS1QCFk2ZXmAgvOV/lnW0iGHwO5kCfzvWJq7weeH2FGuBgq+ WInxhdIFD/QwiXV6EPUWzAoC5Fx4Cz5ySFSd6n0C1Mrzin3ABtPHRpUT8s0pUmFkZWsgS3Jl amNpIChDRVNORVQpIDxya3JlamNpQGNlc25ldC5jej7CYgQTEQIAIgUCTT/pkAIbAwYLCQgH AwIGFQgCCQoLBBYCAwECHgECF4AACgkQIMoxClN+p/31DwCfWVWX1IWaUa6+QbuVvZQIkb6m Rn8AoLRvdANGe/As/Nxabu+KKtrorkQ6zsBNBEKfHeIQBACwORs231u+o9/pM7y85ZlZhnNY iJziZ4P5W9lD5cwcEUFgTt1upUmjjSMWr5x4HL6o5jZeKOQMxiYP+8qA8OPEM6fzemS1Uj9M 6RXUaoUZFrcKD6BvneyyKuGgNa9bQfTG0aDOqaxy4lYFNcHVeo9sXJ+6adVxlCo/GzZ6zznn nwADBQP+IZQoao7aCFkZOVk8F5AW9Iiz0hk1trdCw88vD5fPMqcLxOQEsKrHAjibTWyOy1il 9zgLyVjcBzOs+v6UvbcJRybyaITC7j4IFPr78euVup/AeL+A9ay+ZWKHMFzALD+VjLyYAiRL w2MBjdqAKbPh2Ei1HXJoOX5JTWWnMRsBey/CSQQYEQIACQUCQp8d4gIbDAAKCRAgyjEKU36n /YssAKDVrEroZMSci018ipG4q6w11TsriwCghwCwX0isavqXJTbw10hwJePlDns=
Message-ID: <4cdf2f85-4eb9-de62-971f-8d90bd5ac300@cesnet.cz>
Date: Mon, 09 Mar 2020 15:00:46 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0
MIME-Version: 1.0
In-Reply-To: <20200309130108.thfmu6gu5ds7h4ri@anna.jacobs.jacobs-university.de>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/PQJsPcgNDHbv69Ffunlxsc6jX4c>
Subject: Re: [netconf] ?==?utf-8?q? edit-config leaf without value
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: Mon, 09 Mar 2020 14:01:08 -0000

So your answer is the option a)? So the value processing (and type violation reporting) must be always checked (no matter when). Maybe I'm just not getting your point.

What is the expected result of edit-config's <l operation="delete"/> in case

i) l is uint32 and node l is present with value "1"

ii) l is string and node l is present with value "x"

What is the "value not present" representation for string?

Regards,
Radek


Dne 09. 03. 20 v 14:01 Juergen Schoenwaelder napsal(a):
> I think when and how type checking is done is rather implementation
> specific. Some implementations may complain about a type violations
> before processing the operation attributes, others may not look at the
> type until they process values.
>
> /js
>
> On Mon, Mar 09, 2020 at 01:57:05PM +0100, Radek Krejčí wrote:
>> Hi Rob,
>>
>> I agree with Michal, it is actually not clear what the "value not provided" mean. Because I understand <l operation="delete"/> to have a value which is invalid for the uint32 type, but valid for for example in case of string. By checking for the type, we would have types without possibility to have "value not provided". So I believe that we can a) always check the value or b) never check the value in case of delete/remove operation. Acting according to the type seems confusing. When involving unions, with the possibility to change type according to some external data, it would be hell.
>>
>> Regards,
>> Radek
>>
>>
>> Dne 09. 03. 20 v 8:18 Michal Vaško napsal(a):
>>> Hi Rob,
>>> thank you for answers even though they are quite different from what I expected. I tried to understand the behavior from the RFC having always referenced the specific sections and I found nothing about invalid values being allowed although there is no explicit prohibition. I would make sure explicit rules are included in whatever next YANG document is released.
>>>
>>> Also, you are saying "delete" on a uint32 leaf can occur without a value (meaning it can never match a valid value) but in the next answer you are saying you would check the value and return an error if it did not match, which is an obvious inconsistency, so please clarify what you meant. As for the "remove" operation and not checking the value, what exactly would be the behavior? An error is never returned, that is written in the RFC, but would the leaf actually be removed only if the value matches or even when it does not?
>>>
>>> Regards,
>>> Michal
>>>
>>> On Friday, March 6, 2020 21:06 CET, "Rob Wilton (rwilton)" <rwilton@cisco.com> wrote: 
>>>  
>>>> [As a contributor]
>>>>
>>>> Hi Michal,
>>>>
>>>> Please see inline ...
>>>>
>>>>> -----Original Message-----
>>>>> From: netconf <netconf-bounces@ietf.org> On Behalf Of Michal Vaško
>>>>> Sent: 06 March 2020 15:10
>>>>> To: netconf <netconf@ietf.org>
>>>>> Subject: [netconf] edit-config leaf without value
>>>>>
>>>>> Hello,
>>>>> we would like some input on a problem that was discussed several times
>>>>> based on our search of the mailing list archive but we are still not sure
>>>>> what the exact rules are.
>>>>>
>>>>> So, let's say we have YANG snippet
>>>>>
>>>>> leaf l {
>>>>>     type uint32;
>>>>> }
>>>>>
>>>>> and edit-config config (assume correct namespaces)
>>>>>
>>>>> <l operation="delete"/>
>>>>>
>>>>> a) Is the example allowed? Meaning can the leaf "l" be without a value
>>>>> (have an invalid value)? Based on the YANG 1.1 RFC [1] I would say it
>>>>> cannot.
>>>> [RW] 
>>>> Yes, a value does not need to be provided, but the leaf must previously exist in the configuration, or an error is returned.
>>>>
>>>> I think that this would be the normal way this operation is expressed.
>>>>
>>>>
>>>>> b) If it can be without a value, is it only in the case of "delete"
>>>>> operation, otherwise it is an error?
>>>> [RW] 
>>>> "remove" would be similar but would not error if the node doesn't exist.
>>>>
>>>>> c) If the leaf "l" had a string type, for example, and there was an
>>>>> instance with value "string" in the datastore, would the edit-config
>>>>> succeed and the leaf be deleted? In other words, when deleting a leaf, do
>>>>> the values have to match for a successful delete or not? In this case, I
>>>>> would say the values do not have to match [2].
>>>> [RW] 
>>>> For a delete operation, if a value was provided, then I would check it or return an error if it did not match.
>>>>
>>>> For a remove operation, I wouldn't perform the check, and just remove the node if it exists.
>>>>
>>>>> d) I am assuming none of this can work for a leaf-list [3] or list [4],
>>>>> which must always have the exact value/keys no matter what the operation
>>>>> on them is.
>>>> [RW] 
>>>> Agreed.
>>>>
>>>> Thanks,
>>>> Rob
>>>>
>>>>
>>>>> Thank you for any clarification.
>>>>>
>>>>> Regards,
>>>>> Michal
>>>>>
>>>>> [1] https://tools.ietf.org/html/rfc7950#section-7.6.6
>>>>> [2] https://tools.ietf.org/html/rfc7950#section-7.6.7
>>>>> [3] https://tools.ietf.org/html/rfc7950#section-7.7.9
>>>>> [4] https://tools.ietf.org/html/rfc7950#section-7.8.6
>>>>>
>>>>> _______________________________________________
>>>>> 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
>> -- 
>> Radek Krejci
>> mobile  : +420 732 212 714
>> office  : +420 234 680 256
>> e-mail  : rkrejci@cesnet.cz
>> LinkedIn: http://www.linkedin.com/in/radekkrejci
>>
>> CESNET, Association of Legal Entities
>> Zikova 4                                      Office: Bozetechova 1
>> 160 00 Praha 6                                        612 66 Brno
>> Czech Republic                                        Czech Republic
>>
>>
>> _______________________________________________
>> netconf mailing list
>> netconf@ietf.org
>> https://www.ietf.org/mailman/listinfo/netconf