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

Andy Bierman <andy@yumaworks.com> Mon, 04 April 2022 15:16 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 DF1FD3A003D for <netmod@ietfa.amsl.com>; Mon, 4 Apr 2022 08:16:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.108
X-Spam-Level:
X-Spam-Status: No, score=-2.108 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, HTML_MESSAGE=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=yumaworks.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 G-yi4LE7YUa2 for <netmod@ietfa.amsl.com>; Mon, 4 Apr 2022 08:16:50 -0700 (PDT)
Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com [IPv6:2607:f8b0:4864:20::1133]) (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 CD88E3A0028 for <netmod@ietf.org>; Mon, 4 Apr 2022 08:16:50 -0700 (PDT)
Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-2db2add4516so103654177b3.1 for <netmod@ietf.org>; Mon, 04 Apr 2022 08:16:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=C6687I1syRfJJMAgyGb/Lrr6T6z56XzbE2Rqoo1QiPY=; b=bVyX2dQKtHBpuABPWrAQH2HJVrGBd8bUxZb+0Yq+hxqLcPDZmOvgurWgvd6ce00imT V307rADmsECCNWjzjxioRqTTLlRk2smb3LpECEPkiNUIP2VhE8m00gQO2f2IwcZsMIsN qlDwCkqOoG9jEIfEolCrOjaZJ2UMckWBxVWhQJP5jWHkeUdFGBiERyRDgb/fYTDZnFzx GZ5XMbfQ84k/MCJprrK3AT3vzjbDKAQGwnrMWbeVHA7VY+lm4ncK0CIuUuUacATIRvib s7oKr50tNFC0cWk3qGbmBLGbijQ2fUWUIXUCFm26gA6+D57UCCNscGZTSAqRDG3oRSo/ Wvsg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=C6687I1syRfJJMAgyGb/Lrr6T6z56XzbE2Rqoo1QiPY=; b=gZOBYYnEDDhCllay4baWj5frwJLGtlVskSYV8q1DQrj4MYqieAe9iLsgcOYSzsK49g GiDispmKSp2LYsN+KcgmloPclCjKFOsHjuN/Xw8AIwhP/HGysD/Abd63QZfYpODmwi6D NRF8saB5h7X3Mz+gykgZTc9yjS7EhOtuRwsB2pQStTJv8Vmjv9iORggAJ1lsubFoB9Dd H+MnqrpFtjHs3eDfmCPN7hpRSwS037YnR2YGLf4GZgRwUK5D59hEAR28+nrabyPmYDjs OVAph7wQLcS2EkKoNtytJxpahx2CzEDgpLdbSVjqIK94Slri+nb4lnQ31jCHIvURiciz n9mg==
X-Gm-Message-State: AOAM5314Oi6bWOaslgGskdxu6deNsYGq54tLsUXF0w03smtnSNzmCuCQ GgIufK/dhKDhlNj3UY/XzHO/Hgb0GDpqF2Ew8xD/6A2IyHp1VA==
X-Google-Smtp-Source: ABdhPJxdDCD2yPw00Q0w5nbDkMFvbjlvJxA2hbS6K9zVDkUzz/Rzs4a7zYORvGnPLa9aPHSrX24JPk+Nqo0qOvXBNnM=
X-Received: by 2002:a81:5dd6:0:b0:2d6:3041:12e0 with SMTP id r205-20020a815dd6000000b002d6304112e0mr384669ywb.331.1649085409343; Mon, 04 Apr 2022 08:16:49 -0700 (PDT)
MIME-Version: 1.0
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>
In-Reply-To: <9a55de3d-c7bc-597a-e1c8-e11f58325049@mg-soft.si>
From: Andy Bierman <andy@yumaworks.com>
Date: Mon, 04 Apr 2022 08:16:38 -0700
Message-ID: <CABCOCHSs=1CERpQq7eb=YNr-eaqFPeyE0xo_vLABxsQn1XSzkg@mail.gmail.com>
To: Jernej Tuljak <jernej.tuljak@mg-soft.si>
Cc: Kent Watsen <kent@watsen.net>, NETMOD Working Group <netmod@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000074e7b05dbd59e94"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/KCcy1UfyjhnC0ouUiIQ60DcN6Jo>
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 15:16:56 -0000

On Mon, Apr 4, 2022 at 4:48 AM Jernej Tuljak <jernej.tuljak@mg-soft.si>
wrote:

> On 01/04/2022 15:49, Andy Bierman wrote:
>
>
>
> On Fri, Apr 1, 2022 at 4:24 AM Kent Watsen <kent@watsen.net> wrote:
>
>>
>> Hi Jernej,
>>
>> > RFC7950, 7.14.4. says:
>> >
>> >    Input parameters are encoded as child XML elements to the rpc node's
>> >    XML element, in the same order as they are defined within the "input"
>> >    statement.
>> >
>> > For the following model:
>> >
>> > module b {
>> >   namespace "b:uri";
>> >   prefix b;
>> >
>> >   grouping params {
>> >     container params {
>> >       leaf x {
>> >         type string;
>> >       }
>> >     }
>> >   }
>> >
>> >   rpc foo {
>> >     input {
>> >       uses params {
>> >         augment params {
>> >           leaf y {
>> >             type string;
>> >           }
>> >         }
>> >       }
>> >     }
>> >   }
>> > }
>> >
>> > 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?
>
>
There is no data node order defined except in 4 places:
  - rpc or action input (just the child nodes or all descendants?)
  - rpc or action output  (just the child nodes or all descendants?)
  - ordered by user applies to list and leaf-list entries
    (not the nodes within a list, just the list entries themselves)
  - list key leafs are encoded in key-stmt order, before other list child
nodes.
    This is true even if the list is affected by previous 3 rules (but this
is not specified)

It is not clear if the phrase "in any order" (appearing about a dozen times)
is in addition to these rules or instead of them.

What about an 'anyxml' or  'anydata' for a <config> node?
Since it is a terminal node, it could be interpreted that it is ordered,
but it is converted to regular nodes when applied to a datastore.


Andy



Jernej
>
>
> I’ve always wished there were a way to specify where they’re placed, for
>> readability, but it’s too inconsequential to raise as an issue here.
>
>
> There is no canonical order defined for any schema nodes.
> There is no order at all defined for top-level or augmenting schema nodes.
>
>
>>
>> > Jernej
>>
>> Kent
>>
>
> Andy
>
>
>> _______________________________________________
>> netmod mailing list
>> netmod@ietf.org
>> https://www.ietf.org/mailman/listinfo/netmod
>>
>
>