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

"Rob Wilton (rwilton)" <rwilton@cisco.com> Mon, 09 March 2020 14:33 UTC

Return-Path: <rwilton@cisco.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 B93353A10BB for <netconf@ietfa.amsl.com>; Mon, 9 Mar 2020 07:33:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.597
X-Spam-Level:
X-Spam-Status: No, score=-9.597 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.com header.b=dOWA3Z9o; dkim=pass (1024-bit key) header.d=cisco.onmicrosoft.com header.b=YZtjN4Dv
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 0l61Anq7dgeN for <netconf@ietfa.amsl.com>; Mon, 9 Mar 2020 07:33:30 -0700 (PDT)
Received: from rcdn-iport-2.cisco.com (rcdn-iport-2.cisco.com [173.37.86.73]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8FA4B3A10B4 for <netconf@ietf.org>; Mon, 9 Mar 2020 07:33:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=9944; q=dns/txt; s=iport; t=1583764409; x=1584974009; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=2WC9NFy8O0zCjPRhn4toYfuc3eq+r4KDXhDZW3k87+I=; b=dOWA3Z9o0ooqRgGGZR6ERaq0ttoFXx7hfSpA+F1xDMFlqytoIHwI5mQe SJ5L0J0TQBeXuxLNjRKB0daVHKz1n1lj8ylYydNMmIzG08g42iIxN8iuu zIK/lcihUkeqw7MtVyIOBRtVKB8qiN3iJEPVXN+/WzAqmxjTM7f9kVpS8 k=;
IronPort-PHdr: 9a23:V+5+XR1d3DTNYcX+smDT+zVfbzU7u7jyIg8e44YmjLQLaKm44pD+JxKHt+51ggrPWoPWo7JfhuzavrqoeFRI4I3J8RVgOIdJSwdDjMwXmwI6B8vQE1L6KOLtaQQxHd9JUxlu+HToeUU=
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0CxAADKUmZe/4gNJK0hQxoBAQEBAQEBAQEDAQEBAREBAQECAgEBAQGBe4FUUAVsWCAECyqEFYNGA4prgl+YFYFCgRADVAkBAQEMAQEYCwoCBAEBg35FAheBdyQ4EwIDAQELAQEFAQEBAgEFBG2FVgyFYwEBAQEDAQEQEREMAQEsCwELAgICAQYCEQQBAQMCJgICAhQRCxUICAIEAQ0FCBqDBYJKAy4BDotrkGcCgTmIYnWBMoJ/AQEFhQEYggwJBYEJKoUhDYZ+GoFBP4FYgU9JNT6CAVgLAQECAYFIAhoVgnoygiyNaYJ/iD+WC3YKgjyHUo8wgkmIIYROi32Odoh8klUCBAIEBQIOAQEFgWkigVhwFTuCbAlHGA2OHQwXg1CFFIVBdAIBgSaMYV8BAQ
X-IronPort-AV: E=Sophos;i="5.70,533,1574121600"; d="scan'208";a="741303337"
Received: from alln-core-3.cisco.com ([173.36.13.136]) by rcdn-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 09 Mar 2020 14:33:28 +0000
Received: from XCH-RCD-004.cisco.com (xch-rcd-004.cisco.com [173.37.102.14]) by alln-core-3.cisco.com (8.15.2/8.15.2) with ESMTPS id 029EXStA031773 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Mon, 9 Mar 2020 14:33:28 GMT
Received: from xhs-aln-002.cisco.com (173.37.135.119) by XCH-RCD-004.cisco.com (173.37.102.14) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Mar 2020 09:33:28 -0500
Received: from xhs-rcd-003.cisco.com (173.37.227.248) by xhs-aln-002.cisco.com (173.37.135.119) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Mar 2020 09:33:27 -0500
Received: from NAM12-DM6-obe.outbound.protection.outlook.com (72.163.14.9) by xhs-rcd-003.cisco.com (173.37.227.248) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 9 Mar 2020 09:33:27 -0500
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QmyXiNNxbzK3EmEZ+mtOhwzfvJTWL9AanAg6L9YWnEyTJrSEz7BM1rYh/Y/B3AHj+Ye0d0QnXIkVlehO6scMf8d5YzkqcQvto3/PIuHzbiwf+C35dwrvGNrhrBlePHhbeNqjrC9AZPNgSTd17bSJ/ZmcFQ1lh70DOibZs7QbCZ4x3c8CSwgcoI4w3nv1Z0QoYudsbfKw38kT6BbWa7Qa8WJ4bdZWWFn/Jj8pc1YWEhsWLxNNtwOuLgoGwri4pFoto8OaVOZt2nWR6Ou6nAuUzddOqCX5Y0QrWps33+2ryYo2QgaoxARPP2sfv2DTTB5a96BuMUkDdlF87HbGKlx8GQ==
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=2WC9NFy8O0zCjPRhn4toYfuc3eq+r4KDXhDZW3k87+I=; b=eqqRRaOw6uxRTYR1zE5ZCuFf6iRnlveyAxXZoDPi3qjgVZ6HbhGKevjgMBJtQ1yaH6bltpaSCh0dKUJ/UDUyyEH3dmkSEJetGE2i+UUsqUgPXjRL9uk8PQJvOPQBeaFAtu7LTWnYre+sPpOLozX5FXWGKLBEQCMIsvk4LNNkXE9+TkzucPZ1ftnR6KomF/SVBbpbB4IviHsFcUPeICKOnt09Lxsww8jEwU32ymFf07WMIeWKWNIcdFSD9dNBo2lCeoAqGy4S5d95sCinQfKTIw9hkFOA5aUZS7LwkqpGE4qIA9je9r4GOSRWKmAAnTBrovlw8ib/u3QnShoUtAhJQw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cisco.com; dmarc=pass action=none header.from=cisco.com; dkim=pass header.d=cisco.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.onmicrosoft.com; s=selector2-cisco-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2WC9NFy8O0zCjPRhn4toYfuc3eq+r4KDXhDZW3k87+I=; b=YZtjN4DvYLQSKNWl3p1N+04gOjxeEoU7FHoOiI4+5nvUilr2wLOD9fpKHPktETk4n6DxVMJCe3kM5NYJdoKQUoz1EbUJwTXajqzaXC8Tns2WqgqxVBb9BssJNT4ThwJYVsaSD9QzYZTsHRupWWa0EgrrbZh+8TzyGvrn8GTyxrs=
Received: from BY5PR11MB4355.namprd11.prod.outlook.com (2603:10b6:a03:1c3::13) by BY5PR11MB4388.namprd11.prod.outlook.com (2603:10b6:a03:1c9::17) 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 14:33:26 +0000
Received: from BY5PR11MB4355.namprd11.prod.outlook.com ([fe80::5434:7127:ff4b:e6f4]) by BY5PR11MB4355.namprd11.prod.outlook.com ([fe80::5434:7127:ff4b:e6f4%4]) with mapi id 15.20.2793.013; Mon, 9 Mar 2020 14:33:26 +0000
From: "Rob Wilton (rwilton)" <rwilton@cisco.com>
To: Radek Krejčí <rkrejci@cesnet.cz>, Michal Vaško <mvasko@cesnet.cz>
CC: netconf <netconf@ietf.org>
Thread-Topic: [netconf] ?==?utf-8?q? edit-config leaf without value
Thread-Index: AQHV9hJFLYRexBsG8ka35Zh65wZZH6hAPFcg
Date: Mon, 09 Mar 2020 14:33:26 +0000
Message-ID: <BY5PR11MB43552A7343D183A5BC873B52B5FE0@BY5PR11MB4355.namprd11.prod.outlook.com>
References: <1af0-5e65ed80-f-33fd2280@3977087> <2f574fd1-b616-9f1c-24f4-5e14b5a93c40@cesnet.cz>
In-Reply-To: <2f574fd1-b616-9f1c-24f4-5e14b5a93c40@cesnet.cz>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=rwilton@cisco.com;
x-originating-ip: [2001:420:c0c0:1002::af]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 4b816c62-875a-450a-6b14-08d7c436d443
x-ms-traffictypediagnostic: BY5PR11MB4388:
x-microsoft-antispam-prvs: <BY5PR11MB43887E3566899372E7977331B5FE0@BY5PR11MB4388.namprd11.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:9508;
x-forefront-prvs: 0337AFFE9A
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(346002)(376002)(366004)(39860400002)(189003)(199004)(81166006)(81156014)(8676002)(8936002)(66574012)(33656002)(52536014)(71200400001)(55016002)(9686003)(4326008)(2906002)(5660300002)(110136005)(66446008)(66556008)(64756008)(66476007)(76116006)(66946007)(966005)(6506007)(53546011)(316002)(478600001)(45080400002)(86362001)(7696005)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY5PR11MB4388; H:BY5PR11MB4355.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: cisco.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: wGn6uGrEu50ITd7TDZvHfD3g2siJv3TAn1FYsoabObHnTWb/L4IBDnF1oK4K1DGKjP6lEXjOO3iajUhCb2JKLwe6iiIbuPq7ynMGnrfc7tdWviJuyijLr9duNEJGtIccUTosPoI+SAVMgFto+5ZEv8wCiTqChlb6JYMDCDOUJ7+7QJA6OMvmM/HtlGy/snUJ3F0vvi/kYovJcplSAt9sJUyxj3xAofPPmRsOYA9O62prfioMIlNqg/V5dXoyoE5fW/cxoWjf0D0q1M6NvvQLVNccptIJCxi4bN+zo03NbX1+w8YRyFboVOhNDeInI3C6Jn+NNjCxp9VZNJ9zX5g7QwuCrEPIM+VU43893Tbau19UF/4/hCrwmIMuxeFp6LJAwdyFGSdhrE+TYQqIU0lkfzm7qjwWPCdpjphOKgZakQkJDr0d6376ngs+8SFQjGV2E012lncFX2kinKmLvnwFI2AY6aQr1Fgu/VrMRy/YzVosC6kUF1BZpewjn1tselssEvTqZo7XkNgY1CxpqIDrSA==
x-ms-exchange-antispam-messagedata: htaVTGTUSbO+Z6YbHAdagrrafWptJvBsRb97FE+mdGmsdfBx/WyHPlaqPLTyYaR3YLzTay9NpHE5EJBnCIcoju7z2HtHBuJCIRlrOGQyU7f857dSHcXF9HeyH6b4doaNXs0ns6h7hVp4KipnAoOwBXl9yapPEiY531A8khdQlTg=
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 4b816c62-875a-450a-6b14-08d7c436d443
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Mar 2020 14:33:26.3731 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5ae1af62-9505-4097-a69a-c1553ef7840e
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: NkrILT2TttfxqkvWi5Jo+AjumqJ7sjGH1LOH3U+hGUMhm6KCjH633r53lPqUNvCUz8Mmwi1YozFKBVWdHQPFag==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4388
X-OriginatorOrg: cisco.com
X-Outbound-SMTP-Client: 173.37.102.14, xch-rcd-004.cisco.com
X-Outbound-Node: alln-core-3.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/hsSPxI2yThZyNO0MvgpXv6ijRRE>
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:33:33 -0000

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).

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.


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
>