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

Radek Krejčí <rkrejci@cesnet.cz> Mon, 09 March 2020 14:58 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 1A6B33A11A7 for <netconf@ietfa.amsl.com>; Mon, 9 Mar 2020 07:58:09 -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 igEPUv24Kw5M for <netconf@ietfa.amsl.com>; Mon, 9 Mar 2020 07:58:06 -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 2439D3A1092 for <netconf@ietf.org>; Mon, 9 Mar 2020 07:58:06 -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 38FD7400052; Mon, 9 Mar 2020 15:58:03 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=office2-2020; t=1583765883; bh=pVsKSmEO6qj25CrMrhlOApuSAwCQEq0hGzky615d2CM=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=RGG27ru/7wlkO3dVmrrRPWnGKdXf8NExl+8iRlA2OnGsFZ8xWM3f6eTzcf7vXoesA /SOEC9Za5SDA81cgrfrVKzBUqBiehgMKxjnqNDnr7c7Yg2Vel/PE3G2oUUODXvohRB N6y5bRIljQLlzNorpsa65gvywTP+xSXdwdnOdiKz2l301F1EHMjoK7WB3/mIl3Rb6n W1QqfVAsKUOZ1QfxckaRFTQgWOXb0U8vlhai4EkMcyTt4BJKq8hgf2ok2RZTJqfxM7 3H+0wVZ63EleyshSGV/FzzaASdlt0aiMEn7pp/hvrobXdg1gWffCeFkJuBjWdbvHYk OgPb8Ptucnwxg==
To: "Rob Wilton (rwilton)" <rwilton@cisco.com>, Michal Vaško <mvasko@cesnet.cz>
Cc: netconf <netconf@ietf.org>
References: <1af0-5e65ed80-f-33fd2280@3977087> <2f574fd1-b616-9f1c-24f4-5e14b5a93c40@cesnet.cz> <BY5PR11MB43552A7343D183A5BC873B52B5FE0@BY5PR11MB4355.namprd11.prod.outlook.com>
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: <911e2c42-f489-1014-14d7-58c0078ec8ea@cesnet.cz>
Date: Mon, 09 Mar 2020 15:58:03 +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: <BY5PR11MB43552A7343D183A5BC873B52B5FE0@BY5PR11MB4355.namprd11.prod.outlook.com>
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/FZkpjsHZ7QvKlRpiuhALPxb6E4Y>
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:58:09 -0000

Thanks Rob,

Dne 09. 03. 20 v 15:33 Rob Wilton (rwilton) napsal(a):
> Hi Radek,
>
> Let's consider the "remove" case because that one is simpler:
>
> I don't think that it makes sense to require the client to specify a value for a leaf that is being removed.  I read the semantics of "remove" to be best effort, i.e. remove the leaf if you can, and ignore it silently if you cannot (e.g. the leaf does not exist).

agreed

> If a client also provides a value for the leaf being removed, and it matches what the server holds, then that would seem fine but unnecessary, but the leaf should be deleted.
>
> If a client provides a value that doesn’t type check during a remove, then the behaviour is probably undefined.  Some servers might reject the request because it doesn't type check, others might be graceful in what they receive and delete the leaf anyway.  However, I'm not sure that I regard not providing a value as a type check failure when considering a remove or a delete operation.
>
> Having looked at both the NETCONF and YANG specs, it is unclear to me what behaviour is expected if the value type checks but differs from what the server holds.  E.g. is the request "remove leaf foo if it exists", or is the request "remove leaf foo if it exists with value 5"?  My understanding of Juergen's interpretation is that it is only meant to be the former, which does seem to be backed up by section 7.6.7 of RFC 7950, given that it only mentions existence and not checking values.

ok, agreed. We are going this way and handle the edit-config data more like a filter with some additional attributes than a standard data.

Regards,
Radek

>
> Considering the "delete" operation, I think that the behaviour should be the same as "remove", except that the request must be failed if the target node doesn’t exist.
>
> I suspect that it is better if clients don't provide values in either "remove" or "delete" requests.  Whatever is decided by the WG, raising an issue on the NETCONF github issue tracker would seem to be a good idea.
>
> Regards,
> Rob
>
>
>
>
>
>> -----Original Message-----
>> From: Radek Krejčí <rkrejci@cesnet.cz>
>> Sent: 09 March 2020 12:57
>> To: Michal Vaško <mvasko@cesnet.cz>; Rob Wilton (rwilton)
>> <rwilton@cisco.com>
>> Cc: netconf <netconf@ietf.org>
>> Subject: Re: [netconf] ?==?utf-8?q? edit-config leaf without value
>>
>> 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
>>