Re: [netmod] 'when' statement in edit-config payload parsing

Andy Bierman <andy@yumaworks.com> Tue, 13 September 2016 08:44 UTC

Return-Path: <andy@yumaworks.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 7496A12B214 for <netmod@ietfa.amsl.com>; Tue, 13 Sep 2016 01:44:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 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_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.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 MVWpnmuO-uww for <netmod@ietfa.amsl.com>; Tue, 13 Sep 2016 01:43:59 -0700 (PDT)
Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4BD1A12B21B for <netmod@ietf.org>; Tue, 13 Sep 2016 01:43:59 -0700 (PDT)
Received: by mail-wm0-x22b.google.com with SMTP id c131so99609154wmh.0 for <netmod@ietf.org>; Tue, 13 Sep 2016 01:43:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=QagdIQuirPMTf8evN88qZtYkAaL3Z+vcwGsLQmYqeas=; b=LYkQtb2MyxiC+VZAni6HuuiWBsH1cRLVpf1UcYBc0ZC2bf8fiSQ4rBYeEmW2k+8Jer teb8YF7RxXYP+gfomlpqBvVKFjvxqAVWRnY22coTo/AUgP5qCzUKruPZAzxh+oD1cTt9 VABKv1zDuzofswV6y+UUFnVeiu1N+0UbOD0NkFN6fSTjDM3FvKR7UcuVSOML8YsYNxTw kQZLC2YiB0ns+hr2DD2necMvv3MzmKIYm803m4o0N8tyRxZABz56L696Ai71P7XbS48d KlyPmkCERF2M9HfGe9EdUoyNsGxOUX+nS5Q5Am78Nyx50nUL9TJXVNm/lLbHqjRv0GaW 6x6A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=QagdIQuirPMTf8evN88qZtYkAaL3Z+vcwGsLQmYqeas=; b=P5oOhGumjJtClieyOtIRNKCLxSC7+tdbN0Siwi7s/6BZGvS3wY5gHzQe0dccQpOvId Ax3wClu0oXSKgKbaoqRA6bEY2AR0XzXWVk6+OUy4swfv5C5M7vd5Gh0jNnwl67+hGTiF Xwg3qDG6aDoDm3uFJ/SIF37H7rMBMeAe3DfyTG6PhdQcbW/5lKcsxeWVDxX6PwaZT3xc FKr640KC+FLfcrULHRRQC87fpGgIb92zMzp00jtJHlY4/kuNrEqYqJaLDeNebDObWMcZ 2yOjXeGQhFriafJmg551FJr15CtbpSai4Hdutz5HuGMenRS6fRw4tX71gmFoQ4gHWdQv 3vZQ==
X-Gm-Message-State: AE9vXwMcANUIkyLBir1kP+uMNA9aSMz8on9CPHsceN4S257pzsEMjPhoBvJf5CvsJ4ZXmJEPp8yd+aldNJa2Lw==
X-Received: by 10.194.231.99 with SMTP id tf3mr8009666wjc.61.1473756237286; Tue, 13 Sep 2016 01:43:57 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.80.141.78 with HTTP; Tue, 13 Sep 2016 01:43:56 -0700 (PDT)
In-Reply-To: <20160913082526.GB44726@elstar.local>
References: <1526719e-0ce1-6dda-2716-a8b6c8fb313b@nokia.com> <20160912133353.GA40334@elstar.local> <0FF2F5A0-7E58-41AA-A0FA-463ABE94BE4F@nic.cz> <CABCOCHRGvzMtAYv9M-gL7_f8HbZhWWppPSYrvnoY_F_R8y5HSA@mail.gmail.com> <57D6E1EC.6070606@seguesoft.com> <CABCOCHTOgNdZDVBGPfRWNc8EXOq82OyCaggSGdfL=xQL5uDbPw@mail.gmail.com> <1cd5b1e3-4440-2635-c809-c709dcc6efd3@nokia.com> <D56F657D-1569-4E1C-937C-5FF4DEF53BF0@nic.cz> <20160913082526.GB44726@elstar.local>
From: Andy Bierman <andy@yumaworks.com>
Date: Tue, 13 Sep 2016 01:43:56 -0700
Message-ID: <CABCOCHSkGtg-gSL3ZJLMpuc=FOiQQwRsE46RPkOBAgC7kNgiGg@mail.gmail.com>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, Martin Bjorklund <mbj@tail-f.com>, Ladislav Lhotka <lhotka@nic.cz>, Yves Beauville <yves.beauville@nokia.com>, "netmod@ietf.org" <netmod@ietf.org>
Content-Type: multipart/alternative; boundary="001a113628880273fc053c5f9d47"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/M4fMApS2whqRNoVSWvViPeICvVo>
Subject: Re: [netmod] 'when' statement in edit-config payload parsing
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
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: Tue, 13 Sep 2016 08:44:01 -0000

On Tue, Sep 13, 2016 at 1:25 AM, Juergen Schoenwaelder <
j.schoenwaelder@jacobs-university.de> wrote:

> On Tue, Sep 13, 2016 at 09:34:33AM +0200, Ladislav Lhotka wrote:
> >
> > > On 13 Sep 2016, at 09:01, Yves Beauville <yves.beauville@nokia.com>
> wrote:
> > >
> > > Both RFC 6020 and RFC 7950 are providing the same requirement in
> section 'Payload Parsing':
> > >   o  If data for a node tagged with "when" is present, and the "when"
> condition evaluates to "false", the server MUST reply with an
> "unknown-element" error-tag in the rpc-error.
> >
> > This section seems confusing. It makes no sense to evaluate "when" or
> "must" on the contents of a protocol message such as edit-config because
> accessible trees for XPath evaluations are defined in sec. 6.4.1 in terms
> of datastores and "all state data".
> >
>
> I agree that this bullet in section 8.3.1 looks odd. Perhaps Martin
> recalls why this was written in the first place?
>

I recall that I did not agree that this error was clearly defined.
The subtle difference this line calls out is the case where the client
provides a configuration data node that evaluates to false immediately,
vs. an existing node that becomes false after the new edit is applied.
(The former is an error and the latter is just a silent delete).

One major problem with this text (as I pointed out years ago)
is that the when-stmt does not actually exist in the strictest sense.
It is hidden in the schema behind an "anyxml" node <config>.
The literal YANG says a when-stmt in the RPC input, but there isn't any.
The when-stmt is in the implied schema of the node provided in the anyxml
subtree.



>
> /js
>

Andy


>
> --
> Juergen Schoenwaelder           Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
> Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>