[netmod] NETCONF server handling of 'when' statements

"Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com> Wed, 02 May 2018 15:21 UTC

Return-Path: <jason.sterne@nokia.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 86383126579 for <netmod@ietfa.amsl.com>; Wed, 2 May 2018 08:21:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.91
X-Spam-Level:
X-Spam-Status: No, score=-1.91 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nokia.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 qwCTDZx3rvQC for <netmod@ietfa.amsl.com>; Wed, 2 May 2018 08:21:05 -0700 (PDT)
Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50120.outbound.protection.outlook.com [40.107.5.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B3C8B124235 for <netmod@ietf.org>; Wed, 2 May 2018 08:21:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=63RwAU68bAJU9uadw1UYiztQ3PYnkD48g9k4e1QV91o=; b=iKFgOic1OT4py53c7XQ1uiF93fZIPjeAzhtnhSQ9qLspqLaCPpuIfkC1as8H11lwxMxzyK7lrMCUEX4gjU17xmsNWMMmsmGokkSJkMIj+vVwadT8ZQvlD6B3lqAVAyWq5GsbiiUl7traWRS35BF463QtrL0ysboEC+EjwEWo+gE=
Received: from AM0PR07MB3844.eurprd07.prod.outlook.com (52.134.82.20) by AM0PR07MB4241.eurprd07.prod.outlook.com (52.133.60.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.6; Wed, 2 May 2018 15:21:02 +0000
Received: from AM0PR07MB3844.eurprd07.prod.outlook.com ([fe80::c65:ce3c:f99e:3132]) by AM0PR07MB3844.eurprd07.prod.outlook.com ([fe80::c65:ce3c:f99e:3132%3]) with mapi id 15.20.0735.006; Wed, 2 May 2018 15:21:02 +0000
From: "Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com>
To: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: NETCONF server handling of 'when' statements
Thread-Index: AdPhmt4MyR2TAhLzQmOJdvRLqrMCsA==
Date: Wed, 02 May 2018 15:21:02 +0000
Message-ID: <AM0PR07MB38442E8CF930E0D216C218459B800@AM0PR07MB3844.eurprd07.prod.outlook.com>
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=jason.sterne@nokia.com;
x-originating-ip: [135.245.20.21]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; AM0PR07MB4241; 7:9qNs0oXlcAx9BGfnh/w38o4xzNzqf1MuuohGPdfIw/ursDDvF2q+3Py5ljn4kWORDdUA2vRK7m8ebR+HZl/BqiWYdozY2doB9KTSrAIfyf9RsMOCUcnp9eid2z7Iyu9c0nmpCdkCwFJESJdbzYE2iBItcro6razDiIyms4m4g7Jnt+2KuH8+XmB7HQlS/NnGtZHHMh1RNtAKrFKtL+AtnGHAkbjTBsngHcLGtu0Q3pW0TPQlIVD1+ftuigf9umtY
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989080)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(8990040)(2017052603328)(7193020); SRVR:AM0PR07MB4241;
x-ms-traffictypediagnostic: AM0PR07MB4241:
x-microsoft-antispam-prvs: <AM0PR07MB42413DD902186D2E96AD097B9B800@AM0PR07MB4241.eurprd07.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(28532068793085)(158342451672863)(21748063052155)(183022231695245);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(3231254)(11241501184)(806099)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041310)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:AM0PR07MB4241; BCL:0; PCL:0; RULEID:; SRVR:AM0PR07MB4241;
x-forefront-prvs: 06607E485E
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39380400002)(396003)(376002)(346002)(366004)(39860400002)(53754006)(199004)(189003)(25786009)(53386004)(55016002)(7736002)(33656002)(5630700001)(81156014)(3280700002)(5660300001)(68736007)(606006)(5640700003)(2900100001)(8676002)(106356001)(74316002)(6916009)(3660700001)(105586002)(2906002)(81166006)(86362001)(14454004)(66066001)(476003)(2351001)(26005)(102836004)(6506007)(1730700003)(316002)(2501003)(8936002)(5250100002)(59450400001)(486006)(99286004)(6116002)(3846002)(9686003)(53936002)(236005)(186003)(7696005)(97736004)(790700001)(478600001)(6306002)(6436002)(54896002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR07MB4241; H:AM0PR07MB3844.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: nokia.com does not designate permitted sender hosts)
x-microsoft-antispam-message-info: UhcC12C+BkmDUH2RvubNF0S6VSlZwlFbTgmLtT5j2LOEW8nPrATZZRAiMQRuSEJK11UEhsU9PP+8qZwzkrBJ1h1ngaaKdl2EAr39bQqmjeRYvC4pAsaNllC+mOkJGrikCoB7Jm7emiCi5cfVzb6riUBUWxZfpCva+04u0cvZfVc6D45Kp3l7oCC7U4KQK6amO5vPBtD2EOeRSHF7FfAUJXRLIiX6bFYEjc/+qQouuSQ0pWlplbshBqSAB/MT3Aeh
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_AM0PR07MB38442E8CF930E0D216C218459B800AM0PR07MB3844eurp_"
MIME-Version: 1.0
X-MS-Office365-Filtering-Correlation-Id: ebc5e8e3-9eb7-45ef-e076-08d5b04050ce
X-OriginatorOrg: nokia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ebc5e8e3-9eb7-45ef-e076-08d5b04050ce
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 May 2018 15:21:02.2683 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR07MB4241
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/iK9ZJE2YsDQe7hMzfmuBhCwcnuU>
Subject: [netmod] NETCONF server handling of 'when' statements
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 02 May 2018 15:21:10 -0000

Hi all,

I've seen some older threads about 'when' handling and they ended up creating a lot of debate about behavior & intentions (and about how well the text is written in the specs).

I'm hoping that the community out there is in agreement on yes vs no for the questions below.

Given the following module:

module test {
   namespace "http://test.com";
   prefix "test";

   container foo {
     leaf foo-type {
       type enumeration {
         enum "green";
         enum "red";
       }
     }
     leaf green-value {
       when "../foo-type = 'green'";
       type uint32;
     }
     leaf red-value {
       when "../foo-type = 'red'";
       type uint32;
     }
   }
}


(A) Assume the candidate is empty initially.  Does the following edit-config to the candidate return "OK" ?  (only showing the content of the <config></config> section):

<root xmlns=http://dummy.com>
  <red-value>23</red-value>
  <foo-type>red</foo-type>
</root>

Does the candidate contain the following after the edit-config ?
     foo-type = red
     red-value = 23

Is the result the same if the red-value and foo-type leafs were reversed in the XML above ?

(B) Assume the candidate is empty initially.  Does the following edit-config to the candidate return an error ?

<root xmlns=http://dummy.com>
  <red-value>23</red-value>
  <foo-type>green</foo-type>
</root>

Does it also return an error if the red-value and foo-type leafs were reversed in the XML above ?

(C) Does the presence of 'when' in a YANG model ever create the need for a NETCONF client to specifically order nodes within a single edit-config to achieve some desired behavior ?

Or do 'when' statements purely put the onus on the server to build a dependency tree with the scope of a single edit-config (to ensure that the input leafs to a 'when' statement are processed before the when statement itself is evaluated, i.e. evaluate the when statements at the end) ?

Rgds,
Jason