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

Robert Varga <nite@hq.sk> Mon, 04 April 2022 22:34 UTC

Return-Path: <nite@hq.sk>
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 23CB93A1B59 for <netmod@ietfa.amsl.com>; Mon, 4 Apr 2022 15:34:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.11
X-Spam-Level:
X-Spam-Status: No, score=-7.11 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_HI=-5, 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 (1024-bit key) header.d=hq.sk
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 FYiyKTFl_CV7 for <netmod@ietfa.amsl.com>; Mon, 4 Apr 2022 15:34:14 -0700 (PDT)
Received: from mail.hq.sk (hq.sk [81.89.59.181]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C7E193A1B58 for <netmod@ietf.org>; Mon, 4 Apr 2022 15:34:12 -0700 (PDT)
Received: from [192.168.1.146] (chello085216197060.chello.sk [85.216.197.60]) by mail.hq.sk (Postfix) with ESMTPSA id A8FA82467A2; Tue, 5 Apr 2022 00:34:08 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hq.sk; s=mail; t=1649111648; bh=NcpKR2lm0tQEpph31PVecxPF/s6B9kB2/pYz6UTyja0=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=X3ufSWUH7AWcc3Pjdc/+p8TRKSzgTkGscd/lOmx7dvxDu+md9C0qTBFs51pXY9vq3 ZDKorZJ3gci1BRMaLNahzCu0MRcnZS/icIZFi3RF4QZcwpKUNjKUglrxhOdm1+B1ql jQ+hWuQAqQu4BsMGDAtI5crTy06SLxv7h9+3uxxM=
Message-ID: <31192d86-bd73-9708-b96b-63f1bb291024@hq.sk>
Date: Tue, 05 Apr 2022 00:34:08 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0
Content-Language: en-US
To: Jernej Tuljak <jernej.tuljak@mg-soft.si>, 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>
From: Robert Varga <nite@hq.sk>
In-Reply-To: <9a55de3d-c7bc-597a-e1c8-e11f58325049@mg-soft.si>
Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="------------oTJyTyTAXrzlq1LwAp0zp1wE"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/CpEKVoQ2pEkuW43smtmOyM8pucM>
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: Mon, 04 Apr 2022 22:34:19 -0000

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

Regards,
Robert