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

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Mon, 09 March 2020 16:03 UTC

Return-Path: <J.Schoenwaelder@jacobs-university.de>
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 C33CC3A1335 for <netconf@ietfa.amsl.com>; Mon, 9 Mar 2020 09:03:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAD_ENC_HEADER=0.001, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, MSGID_FROM_MTA_HEADER=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=jacobsuniversity.onmicrosoft.com
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 rgS4Sun_ye7U for <netconf@ietfa.amsl.com>; Mon, 9 Mar 2020 09:02:56 -0700 (PDT)
Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80088.outbound.protection.outlook.com [40.107.8.88]) (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 5D5043A134B for <netconf@ietf.org>; Mon, 9 Mar 2020 09:02:55 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=msunz8QPTUS84Eh7IpllzPERxyxVp9NgG4aUnS6ajH9qVoh4EW/5F41DfyBtQWhT3nFAGubafi6UCGrjDNrgUd9SWqp1FMz2BHTw4jaTD4D1NXWsmUsN5vjjYfwQAqLEr32HwQbqpPvfFF9pTk1N7eS3vAYcBQ40iUmLR5Vtslyx2F5Rgwpxh2iFkwjqHqQuQF0w9b1aLQ6uMDLXjO+aI481mEZLTmRrb9t3828vtg5cnrrRgMbzrYCUFMsTW0ZyDfdmyy3+rjd8nj8phQTA5rclFuwEhKVSS5gGBH4WiWXa9Riqj2pjZPq1nX3TrudK70o+JVJgu/9smOeRUgrskw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;bh=LSSWjp3TBSHG41ZaL9hIrnX66I/ydwkl25cHIAfj0U4=; b=B/dHDsIEws97v6+CJU7X8qOM3gMlgJqpPxGDtELdbCjOWdrSx3+8BnZLeUoNDY8BCqP1h//wh840FjUgkhWvRGP3G9bque9GYqAtOkdZJXlaEe1qBKwRo7y3azqWW5uDPET4UBD/8FERETtLzVqMu+q9cO+DX9HbSzV2kIPErY79a3PQeRDtWeL6nD1loF9fPBaN1RBvwN1HCHwCTRWPBJAUhu0HYIoVz+86ZhM1pXP4vERO2PtICFcndNgKZo1kZnPqkDLskLeX2ahH0O/zg/wanyIVr1x2Q6dZuAaZUb4k4Om4cEWIHi7FN8zFAz+Uki/2k6jiCvrgDzkF0PtzLw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jacobs-university.de; dmarc=pass action=none header.from=jacobs-university.de; dkim=pass header.d=jacobs-university.de; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jacobsuniversity.onmicrosoft.com; s=selector2-jacobsuniversity-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;bh=LSSWjp3TBSHG41ZaL9hIrnX66I/ydwkl25cHIAfj0U4=; b=H0fbYnT1RQERvgdjMyu6h+D2hl2pKVMb+T+GkOgm2iw7W/+THuWS3dnfmqpsp7KhTYosYzzViREGrbzZab5SvOdaP5E4IEMkG4hGdWUXwLWqyb3eQOMJ4blMngNTsLXp4Ekj5s6AyOXVdSZMHBBhWOTrM6Rj4U/2wd36S0+/2qo=
Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=J.Schoenwaelder@jacobs-university.de;
Received: from AM4P190MB0004.EURP190.PROD.OUTLOOK.COM (10.172.221.19) by AM4P190MB0177.EURP190.PROD.OUTLOOK.COM (10.172.220.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Mon, 9 Mar 2020 16:02:53 +0000
Received: from AM4P190MB0004.EURP190.PROD.OUTLOOK.COM ([fe80::10f:bf91:1a67:a580]) by AM4P190MB0004.EURP190.PROD.OUTLOOK.COM ([fe80::10f:bf91:1a67:a580%8]) with mapi id 15.20.2793.013; Mon, 9 Mar 2020 16:02:53 +0000
Date: Mon, 09 Mar 2020 17:02:52 +0100
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Radek Krejčí <rkrejci@cesnet.cz>
Cc: Michal Vaško <mvasko@cesnet.cz>, "Rob Wilton (rwilton)" <rwilton@cisco.com>, netconf <netconf@ietf.org>
Message-ID: <20200309160252.ngadhyzahh6jppzv@anna.jacobs.jacobs-university.de>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Radek Krejčí <rkrejci@cesnet.cz>, 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> <4cdf2f85-4eb9-de62-971f-8d90bd5ac300@cesnet.cz>
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <4cdf2f85-4eb9-de62-971f-8d90bd5ac300@cesnet.cz>
X-ClientProxiedBy: AM3PR07CA0109.eurprd07.prod.outlook.com (2603:10a6:207:7::19) To AM4P190MB0004.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:65::19)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
Received: from localhost (212.201.44.247) by AM3PR07CA0109.eurprd07.prod.outlook.com (2603:10a6:207:7::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.7 via Frontend Transport; Mon, 9 Mar 2020 16:02:53 +0000
X-Originating-IP: [212.201.44.247]
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: f5eaada0-1fb2-4342-8096-08d7c4435360
X-MS-TrafficTypeDiagnostic: AM4P190MB0177:
X-MS-Exchange-Transport-Forked: True
X-Microsoft-Antispam-PRVS: <AM4P190MB0177EB0F17A1370EB8E9AB08DEFE0@AM4P190MB0177.EURP190.PROD.OUTLOOK.COM>
X-MS-Oob-TLC-OOBClassifiers: OLM:7219;
X-Forefront-PRVS: 0337AFFE9A
X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(346002)(376002)(396003)(366004)(39850400004)(189003)(199004)(1076003)(5660300002)(45080400002)(478600001)(786003)(316002)(3450700001)(53546011)(956004)(66476007)(66574012)(86362001)(66556008)(66946007)(54906003)(2906002)(966005)(52116002)(16526019)(6916009)(186003)(6496006)(4326008)(6486002)(26005)(81166006)(81156014)(8676002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4P190MB0177; H:AM4P190MB0004.EURP190.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
Received-SPF: None (protection.outlook.com: jacobs-university.de does not designate permitted sender hosts)
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: BbEkfdcTeVvB+Hf1C96gsJz9e/u2M9tlJSdtW/nKNhqNy/H08F2cYTt7xXTU3Dp2jP/Pf/DNiaPuF86xE4jkEj2v2hlW1SbVEsbmFRK3DIb6HI+/EfJ+RDb+Tymmf2+qvAG/iE7c3YdQzFu9DBNTeL2BF529gskTdCKeubq+vKc53fGVB/gELDIyVlGK8UZS+MP4M7o/J8OAz/zGL06pdpsa7jDv6d82fz2JGBd1mgyHKnrzHboXVEV2O8HlNkT3LfuI+4KJbJ/Fbuoo2Pt9FJQIuqIAukaSB/pEonPDSkZhz2fb/nKqz6jcOEdcOJCqUFds2FTNJjCKqaAMSNSz/BpX3VBZl58Fl/u4/7t2wQ3Su/TL4VGxV/+4YJ8fg5GgduYJ0x75MWlQl1oKmlCNxjObbWA8Zly4WAZyTA36CSouafDMuS2ZyqPquUBM3Vk/eDlq2vOP4Csx1gQM0QKUHcNww37faxuhJ8m0L4ZfKf9E2jMU4pDtzECrpy/EWi89AAq/f1+sv9GUA1PzYQPlyw==
X-MS-Exchange-AntiSpam-MessageData: jx8o+yS//OIVpH/s5IrrxyEkn1zif4N9+g4mzKyWKqIkzKA4KfSBh1HaanLseGwbNADc7aCAfbW70ZcLEruTjEtGlPMiIK1RLdnjaZMMnRmD3q/0B9qTS5gZAj+m/3EzU3212/LrwXfsO210soT+Zg==
X-OriginatorOrg: jacobs-university.de
X-MS-Exchange-CrossTenant-Network-Message-Id: f5eaada0-1fb2-4342-8096-08d7c4435360
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2020 16:02:53.8250 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: f78e973e-5c0b-4ab8-bbd7-9887c95a8ebd
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: xQ+ML62seTV5TJQiHgtW4eXdnDaGxylwae6CyCwCXFdRM5lmcezAOf3axcBZoH9RaBiGPYWfzVmDqSxztK4h31p81G0h48dc0Va93u0Isus=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4P190MB0177
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/V54GJLNvPtBIqRJzH3GlPFB0lgQ>
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 16:03:07 -0000

The NETCONF specification is largely silent about the details of the
processing of requests, other protocols are much more explicit.
Hence, it is often difficult to declare something 'right' or 'wrong';
all we can do is to recognize that for certain requests
implementations may be behave differently. Some may do the delete
without looking at the value at all, others may check types first and
return an error before they attempt to process the operation.

/js

On Mon, Mar 09, 2020 at 03:00:46PM +0100, Radek Krejčí wrote:
> 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
> 
> 
> _______________________________________________
> netconf mailing list
> netconf@ietf.org
> https://www.ietf.org/mailman/listinfo/netconf

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>