Re: [netmod] RPC input parameter definition order (uses augment)

Jernej Tuljak <jernej.tuljak@mg-soft.si> Tue, 05 April 2022 07:15 UTC

Return-Path: <jernej.tuljak@mg-soft.si>
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 080073A2191 for <netmod@ietfa.amsl.com>; Tue, 5 Apr 2022 00:15:06 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.109
X-Spam-Level:
X-Spam-Status: No, score=-2.109 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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=mg-soft.si
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 xgSA017be1tn for <netmod@ietfa.amsl.com>; Tue, 5 Apr 2022 00:15:01 -0700 (PDT)
Received: from galileo.mg-soft.si (gate.mg-soft.si [212.30.73.66]) by ietfa.amsl.com (Postfix) with ESMTP id F3A953A2192 for <netmod@ietf.org>; Tue, 5 Apr 2022 00:15:00 -0700 (PDT)
Received: from [10.0.0.222] (tp-x61t.mg-soft.si [10.0.0.222]) by galileo.mg-soft.si (Postfix) with ESMTP id B6024C401147; Tue, 5 Apr 2022 09:14:58 +0200 (CEST)
DKIM-Filter: OpenDKIM Filter v2.11.0 galileo.mg-soft.si B6024C401147
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mg-soft.si; s=default; t=1649142898; bh=I+DkudKZ5ERQjIo/rtEhmnLXENh/qASTxaMVCBnowFY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=cHLhq9fQhJsmwUek+SVbc5FpssgL9XYVAwwsyR1bvKKqj9WH0LS1EmqEsMVxoWD1p buHkgml98baX+QEBMdnaLL62YTmujwb2hbZHs96vDz8TORvYI5ZYrXOQFxVfgA7y5t JE29UnfDlYpsikn1Bnbf/5G3wBfH9FFJoNDBLh29RLVRATOCwwdVl/jR1DKVkCNEgY FQazagGBf1fqj/TfzngLPb1TGT3IyAgbo3njkZis/voo3w18/MBFRKplF0Xw1/bxjL MT5bqiEVRmmS5pPsGHSppNtKqNd747cwTsHUUZ9FA+NDXXRGSt/Ke/PofDrT5abjqv aFucvEO1JS3pw==
Message-ID: <0ec18689-0e95-945f-0c5a-5c4c4d0b5d70@mg-soft.si>
Date: Tue, 05 Apr 2022 09:14:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0
Content-Language: en-US
To: Robert Varga <nite@hq.sk>, Andy Bierman <andy@yumaworks.com>, Kent Watsen <kent@watsen.net>
Cc: NETMOD Working Group <netmod@ietf.org>
References: <3740e8e7-5e90-f2e2-b252-0dd42690f71c@mg-soft.si> <0100017fe4dec66b-298dc5a9-2d75-4a10-b90b-d11553726957-000000@email.amazonses.com> <CABCOCHR4pGF8wouBkcZm9hJMtKN8TWNNAs8RRfUP-6fHtCPXnw@mail.gmail.com> <9a55de3d-c7bc-597a-e1c8-e11f58325049@mg-soft.si> <31192d86-bd73-9708-b96b-63f1bb291024@hq.sk>
From: Jernej Tuljak <jernej.tuljak@mg-soft.si>
In-Reply-To: <31192d86-bd73-9708-b96b-63f1bb291024@hq.sk>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/PKle9MJyz-M06O0s7umpaNF5ha4>
Subject: Re: [netmod] RPC input parameter definition order (uses augment)
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
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, 05 Apr 2022 07:15:06 -0000

On 05/04/2022 00:34, Robert Varga wrote:
>
> On 04/04/2022 13:48, Jernej Tuljak wrote:
>>>     > If both "leaf" data nodes are instantiated (XML encoding) as
>>>     part of <rpc> for "foo", does <x> come before or after <y> (in
>>>     document order)?
>>>
>>>     Augmented-in nodes come after other nodes.
>>>
>>>
>>>
>>> Maybe this is an implementation convention, but the RFC says they 
>>> are encoded in any order.
>>> https://datatracker.ietf.org/doc/html/rfc7950#section-7.17.2
>>>
>>
>> You are referring to this:
>>
>>     When a node is augmented, the augmenting child nodes are encoded as
>>     subelements to the augmented node, in any order.
>>
>> This implies interleaving of augmenting and non-augmenting child 
>> nodes within "input" parameters for XML encoding?
>
> Yes. There is no semantic difference in directly-defined on augmenting 
> nodes, especially in 'uses/augment' case -- they share the same 
> namespace, so at the document level (i.e. effective model) there is no 
> difference between the two.
>
> Any ordering should be treated as an implementation artifact. In 
> particular this declaration:
>
> rpc foo {
>   grouping foo {
>     container foo {
>       leaf foo {
>         type string;
>       }
>     }
>   }
>
>   input {
>     uses foo {
>       augment foo {
>         leaf bar {
>           type uint8;
>         }
>       }
>     }
>   }
> }
>
> is completely equivalent to:
>
> rpc foo {
>   input {
>     container foo {
>       leaf bar {
>         type uint8;
>       }
>       leaf foo {
>         type string;
>       }
>     }
>   }
> }
>
> The presence of the intermediate grouping is a pure module-internal 
> modeling detail. I believe introducing/removing the grouping is a 
> non-breaking change as per RFC6020 (if memory serves right).

Module updating rules state this:

    o  Any set of data definition nodes may be replaced with another set
       of syntactically and semantically equivalent nodes.  For example,
       a set of leafs may be replaced by a "uses" statement of a grouping
       with the same leafs.

and this:

    In statements that have any data definition statements as
    substatements, those data definition substatements MUST NOT be
    reordered.

Can you state that your second example may be rewritten into your first 
one while retaining semantic equivalence? For the second example, it is 
clear that XML encoding for that container imposes ordering on <bar> and 
<foo> (in that order), for the first, this is no longer true.

Jernej

>
> Regards,
> Robert