Re: [netconf] edit-config leaf without value

"Rob Wilton (rwilton)" <rwilton@cisco.com> Fri, 06 March 2020 20:06 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 163293A0938 for <netconf@ietfa.amsl.com>; Fri, 6 Mar 2020 12:06:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.598
X-Spam-Level:
X-Spam-Status: No, score=-9.598 tagged_above=-999 required=5 tests=[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=BReLS3Lx; dkim=pass (1024-bit key) header.d=cisco.onmicrosoft.com header.b=yo6P1VFe
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 Eukg2Pv4Ltxf for <netconf@ietfa.amsl.com>; Fri, 6 Mar 2020 12:06:04 -0800 (PST)
Received: from rcdn-iport-6.cisco.com (rcdn-iport-6.cisco.com [173.37.86.77]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A9AC63A08F6 for <netconf@ietf.org>; Fri, 6 Mar 2020 12:06:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2462; q=dns/txt; s=iport; t=1583525164; x=1584734764; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=xY9fF/1dRZIJhsdbR9D1OnWjNqTxbqHrQiSL0/zkIFo=; b=BReLS3Lx6qozdl6bivFzJ8nqWxjOE91rgQJ8+j42oEau1bDOyqVqdizW EO53ZVUUIoL7QOVZrDxXMtYell4zWyEzD5BRwGOsOzFmcH+5Xu9eUIgoh 4g0eseXHgcvIB0Ug9+gvjrb/JsaP5Ia6zlv4X3qFfOJv9xbu9h3U3tm0Q I=;
IronPort-PHdr: 9a23:p3rH8R1aRNW64Sw5smDT+zVfbzU7u7jyIg8e44YmjLQLaKm44pD+JxKHt+51ggrPWoPWo7JfhuzavrqoeFRI4I3J8RVgOIdJSwdDjMwXmwI6B8vQE1L6KOLtaQQxHd9JUxlu+HToeUU=
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0AuCQBTrGJe/4sNJK1kHAEBAQEBBwEBEQEEBAEBgXuBVFAFbFggBAsqh1sDimpOghGYFYJSA1QJAQEBDAEBGAsKAgQBAYN+RQKCDiQ4EwIDAQELAQEFAQEBAgEFBG2FVgyFYwEBAQECAQEBEC4BASwMBAcEAgEIEQQBAS8nCx0IAgQBEggagwWCSgMOIAEOnX0CgTmIYoIngn8BAQWFCxiCDAMGgTiFIQ2GehqBQT+BWIJNPoJkAQECAYFkg0GCLK8vdgqCPIdSjzCCSYghkEuOdoh8klUCBAIEBQIOAQEFgWkigVhwFTuCbFAYDY4dDBeDUIUUhUF0AgGBJo5vXwEB
X-IronPort-AV: E=Sophos;i="5.70,523,1574121600"; d="scan'208";a="738124545"
Received: from alln-core-6.cisco.com ([173.36.13.139]) by rcdn-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 06 Mar 2020 20:06:03 +0000
Received: from XCH-ALN-002.cisco.com (xch-aln-002.cisco.com [173.36.7.12]) by alln-core-6.cisco.com (8.15.2/8.15.2) with ESMTPS id 026K63r9015042 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Fri, 6 Mar 2020 20:06:03 GMT
Received: from xhs-rcd-002.cisco.com (173.37.227.247) by XCH-ALN-002.cisco.com (173.36.7.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 6 Mar 2020 14:06:03 -0600
Received: from xhs-rcd-001.cisco.com (173.37.227.246) by xhs-rcd-002.cisco.com (173.37.227.247) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 6 Mar 2020 14:06:02 -0600
Received: from NAM04-SN1-obe.outbound.protection.outlook.com (72.163.14.9) by xhs-rcd-001.cisco.com (173.37.227.246) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 6 Mar 2020 14:06:02 -0600
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U40qjRV+hsjjhXaHMG/YAxsnNF7Ze6o3E/6vc1wmo8dtiTVkPhci/Z598IFvU/I3G5940fL/+CDxzajJENZgals7zv3t4s5zTjAoP5UWoFqbZnnfpWK5f2nfhjnQcNlW6aGOWgBQkFtD1wyoOXnNQ8v9+sEva2sPKayZ2g/03aSd4GenxCwqUva1+u+rUeharqeTDccdSPJqHZq3uNbXnMHa0Q7XaQhA9PHREd0TlN2Gu+6w43DODl3LJII+p5BnW2s/JNP4m3S6dxe+9fdZOQ40VTbuBEwNFJVtcQ//Gsf9ISQ6C2sHo49gwWGYm1AqET0WxlH4aTCUg4s75CAirg==
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=TH2mP6Dk7trpbWoLQ4dYK9YExXqfcIkQR0wCyKcYyBg=; b=jbv0plxaOh/B9jLv85heWXpzOPMyR6ixiZCoocc6OLWbwpcDOCCh7OkfHGZodAZ4QbwC0AJJdJw37qRCU/+4ZZzRbX/etcE0zcjk8nHmWpdITsdwAuDk62u7PWiMTYQqbdyT56kjcosu6QPwQVED4PYnO+hlyL3AyxDkM/woerjIEjb5lavhhTmLqSKeg12uAoTIP2xQ2t1eMImHZpJDxHB4lthi9Gt71Q1b7iJ88UFSNBgZCXX+mEYN8lQhMNidlxnTa6hOIdtGG0CeanZ2HxKuMUrcY8I0qql2ktCNZwPRPSwjIaXFTzTcTXe8Ab5mX0mY8NpEJ+1iriHKchEYaQ==
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=TH2mP6Dk7trpbWoLQ4dYK9YExXqfcIkQR0wCyKcYyBg=; b=yo6P1VFegEapkt0ZfDER0zCsl5yPSv7ObkVfxe5jO16xWR0vUdanyemPXb5rTjbRZlr+S0Obl6SlFt7/9si0fIiJ0WTKfV/iRexRtwAalK8gNXTwk5iCeJ3LyUQxPQu+IKIyrh/ZPkqsvIB8ogc8XngR3vZy73dlWUrqL9SOZ4I=
Received: from BY5PR11MB4355.namprd11.prod.outlook.com (2603:10b6:a03:1c3::13) by BY5PR11MB4449.namprd11.prod.outlook.com (2603:10b6:a03:1cc::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.16; Fri, 6 Mar 2020 20:06:01 +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.2772.019; Fri, 6 Mar 2020 20:06:01 +0000
From: "Rob Wilton (rwilton)" <rwilton@cisco.com>
To: Michal Vaško <mvasko@cesnet.cz>, netconf <netconf@ietf.org>
Thread-Topic: [netconf] edit-config leaf without value
Thread-Index: AQHV88ljyypHBS5CpEqNwkr6R4L5U6g7zwjg
Date: Fri, 06 Mar 2020 20:06:01 +0000
Message-ID: <BY5PR11MB4355E08DCBC62CFFA44DC172B5E30@BY5PR11MB4355.namprd11.prod.outlook.com>
References: <55d0-5e626800-11-3bd6efc0@61129709>
In-Reply-To: <55d0-5e626800-11-3bd6efc0@61129709>
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: 853f729a-18e2-439e-0ec2-08d7c209cb03
x-ms-traffictypediagnostic: BY5PR11MB4449:
x-microsoft-antispam-prvs: <BY5PR11MB444967D95079D0D7C59EA673B5E30@BY5PR11MB4449.namprd11.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-forefront-prvs: 0334223192
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(39860400002)(396003)(346002)(366004)(136003)(199004)(189003)(6506007)(52536014)(33656002)(66446008)(478600001)(966005)(64756008)(66476007)(53546011)(66946007)(66556008)(2906002)(316002)(66574012)(7696005)(110136005)(71200400001)(55016002)(8676002)(9686003)(76116006)(186003)(81166006)(8936002)(5660300002)(81156014)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY5PR11MB4449; H:BY5PR11MB4355.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: rC7wHXqXQkdmqx4ryWLvvIytNPyLVJcuPwFCVEdj090/uYo0JIs4UBdEozEfKtABNU0vdgD5P+zzJQyOuANtL9Xqgr001eX7n54QOdkkLcfEjXpSIAOOzDbzgb7f6vVokOAVDfUD09FNZgnpk4SFJ59MdsrSLqE+Mw06tyA5W6smRimEPSxfoeDr3T0OAZbe0pAPDlR9FDC1RorJq0YTEq78pzVHzTnyzJAqbbgZBoo67RYMddnSmRNUwRQFsP+6xXaPRUTx+UEDWEHUlndTCizqscvhILz8e2SE263cvDjMa3xAA7f86n5gm5UCAgcAYtpdKvpigI/vgyZlmTRile0ZqpaFqggPTlGZJHgsfFNJhK+C86PulK6dp+dptqYd/PQhp7CszdHiQlFWUwywBqo+bjRlvG5IXG/IEljBc3ROErT6SNY4SGVilc6Puq1nK1u5D3+ncb+FuxsKp1f4V8dMdJ9t9NyzZJCA01rYfkSUPwbLyFv5FpwquwJTEy7r05f8Yfx/LkNMb0HcS3vbSA==
x-ms-exchange-antispam-messagedata: CZc4lyVX0Q8vy8ava8hnNzQ4BOIZ5Yq5vHeNJFuAojnv2pX0EqVO1VUo4VZt2C+xUZpow7XR0NP1D+DJuWnqAuB/mrUTenwajxg5m7VrS6Mqw27wGEF0PpN4kUhNWbZUQG9ZV6sQ8sp7JnR2h9i/+Mv9BhnObVMadNGm9/s8d+Y=
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 853f729a-18e2-439e-0ec2-08d7c209cb03
X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Mar 2020 20:06:01.1134 (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: vIpJnq/WUbUB1k07RjrSzTq5ib6qfIN1gh4Xo1GiMOhE/b/wTGSl5zP2CJLrqgdmh7gpTmS3L4D+ngDfw9jbsA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4449
X-OriginatorOrg: cisco.com
X-Outbound-SMTP-Client: 173.36.7.12, xch-aln-002.cisco.com
X-Outbound-Node: alln-core-6.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/a_nYzNSukvTuC4_jUME5OjkZtcw>
Subject: Re: [netconf] 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: Fri, 06 Mar 2020 20:06:08 -0000

[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