Re: [netmod] YANG action not allowed at root?

Martin Björklund <mbj+ietf@4668.se> Tue, 05 May 2020 09:00 UTC

Return-Path: <mbj+ietf@4668.se>
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 10F543A15DE for <netmod@ietfa.amsl.com>; Tue, 5 May 2020 02:00:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.923
X-Spam-Level:
X-Spam-Status: No, score=-0.923 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, PDS_NAKED_TO_NUMERO=1.177, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=4668.se header.b=jikdSDBT; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=VFpyHz2P
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 YW5MyE48hiuZ for <netmod@ietfa.amsl.com>; Tue, 5 May 2020 02:00:20 -0700 (PDT)
Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 626843A041A for <netmod@ietf.org>; Tue, 5 May 2020 02:00:15 -0700 (PDT)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id B48B85C003F; Tue, 5 May 2020 05:00:14 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 05 May 2020 05:00:14 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=4668.se; h=date :message-id:to:cc:subject:from:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=fm1; bh= zJ2XqKOQ9tmeo9j4DcoopQrqmMhKMPsqxCZOnmtGUUw=; b=jikdSDBTAUvOH0pJ obac5LQrVwVq+nQv5lBpRQVQG5/KYxbEdo9CBoPbooosqS2XwHnaq8p3MSnkxajx p8xZv1Fqm2goO0eVJOL4VPWquBLpiluSNSYzx3m4So8nLfxnpGf7bUhLWqYC9TM5 uDY/w3hyTguvMP3+xf37J8T3eAEGeO6NKuPBrNlWyDU/p+XJWCtyb50IW7qZsPPC kcZ0D9kol2TXQisK5HYBwNfN9RlSr0ms1H43ywJYmIeD9kU80AkIOLS8IkukT2IR LJOX36mcgc1D/dtqzL/bfjdcRpooTFMakfrXJC7bJAshkGB6oNA7J9rnFa4WaWsc tiwytg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=zJ2XqKOQ9tmeo9j4DcoopQrqmMhKMPsqxCZOnmtGU Uw=; b=VFpyHz2P2aKy65+Mvgcggdp4zeZcbojPqfbOESHWItly+/GzJFrOr4NFT MpWMFdirxWu9TTRaVY1jT97qiaYUuph1qZG3PZFb3Z9RyMexPXgGRKUvsbO+07pj A/lS9/s6LYEyYhKaEuMEo9FMEDwO+BrUG53iBaTDtPDAL1NHb2RmXhhiWoAe41ub 9ZVJCwfQ789vohFs/QchGZJ1JW/X3CuS+TQtNCrbZ0cVoHOFQv7oK/oNKdu2tM1b 9bYDb6NjuuQdC92Nl82UXXOAK5GbvYjIQ0wepnhQh7unqpvnIVffc83Kvq/0B/Xu y5aRg4aqa8q7UdZZI4UcgzOrLdEFg==
X-ME-Sender: <xms:HSuxXu7s7_uKKyBkdhw6nhX10m2QydlwADVDSP25Gc8nggxsFwKNtw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrjeeigddtlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffkvffuhfgjfhfogggtgfesthgsre dtredtjeenucfhrhhomhepofgrrhhtihhnuceujhpnrhhklhhunhguuceomhgsjhdoihgv thhfseegieeikedrshgvqeenucggtffrrghtthgvrhhnpeefheekgfdukeefheeihefhke egvdffheetvefgfeefgefhvdefueeluddvvdfgheenucffohhmrghinhepihgvthhfrdho rhhgnecukfhppeduheekrddujeegrdegrdeggeenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmsghjodhivghtfhesgeeiieekrdhsvg
X-ME-Proxy: <xmx:HSuxXv5U4YSTVFt3Rt5a2YzW5nMgPxFLtoVRpci0MkIuiiPMzN--MQ> <xmx:HSuxXuE5Mtbt4D1bf4dSyiwTjJae2wQnBds8HwSCCdbJx_yCZGaNHg> <xmx:HSuxXqv9u2mrQWVwp9TFwcvjcf4DtTbUGmsR4Oksm-F3qUVvaDTkMw> <xmx:HiuxXiEXYSdKUmTD8W8pw8lj3Bgb0ENEtdnoGEv-WqreET_gXqyAUg>
Received: from localhost (unknown [158.174.4.44]) by mail.messagingengine.com (Postfix) with ESMTPA id 658283065FE4; Tue, 5 May 2020 05:00:13 -0400 (EDT)
Date: Tue, 05 May 2020 11:00:11 +0200
Message-Id: <20200505.110011.1423220937314479731.id@4668.se>
To: chopps@chopps.org
Cc: jason.sterne@nokia.com, netmod@ietf.org
From: Martin Björklund <mbj+ietf@4668.se>
In-Reply-To: <0533F71D-C017-40A5-B953-21FFF9CBD1FB@chopps.org>
References: <AE95765B-0561-45DC-A4A8-E8B3BCE4BB12@cisco.com> <DM5PR08MB263359FB2993EC569444A4539BAA0@DM5PR08MB2633.namprd08.prod.outlook.com> <0533F71D-C017-40A5-B953-21FFF9CBD1FB@chopps.org>
X-Mailer: Mew version 6.8 on Emacs 25.2
Mime-Version: 1.0
Content-Type: Text/Plain; charset="utf-8"
Content-Transfer-Encoding: base64
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/3VEmfpW8Dh2WJdpcmJeOf611eJA>
Subject: Re: [netmod] YANG action not allowed at root?
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 May 2020 09:00:22 -0000

Hi,

If we were to redo YANG, I would prefer to have a single statement
"operation", either on the top-level, or tied to a node.


/martin

Christian Hopps <chopps@chopps.org> wrote:
> An action is defined as being something bound to a node. Talking about
> actions that aren't bound to a node is talking about RPCs AFAICT. In
> the server it just comes down to passing the bound node data in to the
> function or not. Defining "unbound actions" to replace RPCs is just
> different syntax for the same thing, right? Having 2 ways to do the
> same thing wouldn't help make servers easier to implement (it would do
> the opposite actually).
> 
> Thanks,
> Chris.
> 
> > On Apr 30, 2020, at 11:50 AM, Sterne, Jason (Nokia - CA/Ottawa)
> > <jason.sterne@nokia.com> wrote:
> > 
> > Yes - the intent was to address the limitation that an RPC can only be
> > at root. Actions can be out in a tree & nicely associated with
> > something (e.g. instead of having a pile of flat RPCs with long names
> > that encode containers like reset-www-xxx-yyy-zzz-entity).
> >  
> > But I don't really understand why we limited actions from being at the
> > root. It prevents a strategy of implementing all operations in a
> > server (some of which may be desirable at root for various reasons,
> > some of which may be desirable in the tree) as actions.
> >  
> > Why not allow this?
> >  
> >    module bar {
> >          action do-stuff {
> >            input {
> >              leaf iterations {
> >                type uint8;
> >               }
> >             }
> >          } 
> >        } 
> >    } 
> >  
> > Which could be called from NETCONF like this:
> >  
> >      <rpc message-id="101"
> >           xmlns="urn:ietf:params:xml:ns:netconf:base:1..0">
> >        <action xmlns="urn:ietf:params:xml:ns:yang:1">
> >          <do-stuff xmlns="urn:example:bar">
> >            <iterations>5</iterations>
> >          </do-stuff>
> >        </action>
> >      </rpc>
> >  
> >  
> > Jason
> >  
> > From: Reshad Rahman (rrahman) <rrahman@cisco.com> 
> > Sent: Thursday, April 30, 2020 11:31 AM
> > To: Sterne, Jason (Nokia - CA/Ottawa) <jason.sterne@nokia.com>;
> > netmod@ietf.org
> > Subject: Re: [netmod] YANG action not allowed at root?
> >  
> > I don’t know the history on this but the intent is to have action tied
> > to a data node.
> >  
> > https://tools.ietf.org/html/rfc7950#section-7.15
> >    The difference between an action and an rpc is that an action is tied
> >    to a node in the datastore, whereas an rpc is not.  When an action is
> >    invoked, the node in the datastore is specified along with the name
> >    of the action and the input parameters.
> >  
> > Regards,
> > Reshad.
> >  
> > From: netmod <netmod-bounces@ietf.org> on behalf of "Sterne, Jason
> > (Nokia - CA/Ottawa)" <jason.sterne@nokia.com>
> > Date: Thursday, April 30, 2020 at 11:08 AM
> > To: "netmod@ietf.org" <netmod@ietf.org>
> > Subject: [netmod] YANG action not allowed at root?
> >  
> > Hi all,
> >  
> > I was a bit surprised to find this in section 7.15 of 7950 recently:
> >  
> >    Since an action cannot be defined at the top level of a module or in
> >    a "case" statement, it is an error if a grouping that contains an
> >    action at the top of its node hierarchy is used at the top level of a
> >    module or in a case definition.
> >  
> > I realize that actions can be placed down in a schema tree (i.e. sit
> > in the context of a container or list), but why is it phrased that
> > they *must* be in a container?
> >  
> > RPCs are limited to being at the root. I would have thought actions
> > could be anywhere (root or down in the tree).
> >  
> > Jason
> >  
> >  
> > _______________________________________________
> > netmod mailing list
> > netmod@ietf.org
> > https://www.ietf.org/mailman/listinfo/netmod
> 
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod