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

Per Hedeland <per@hedeland.org> Tue, 05 May 2020 09:46 UTC

Return-Path: <per@hedeland.org>
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 ED8363A15CA for <netmod@ietfa.amsl.com>; Tue, 5 May 2020 02:46:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 spzotGtSuH3E for <netmod@ietfa.amsl.com>; Tue, 5 May 2020 02:46:10 -0700 (PDT)
Received: from mailout.easydns.com (mailout.easydns.com [64.68.202.10]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 31BDB3A15FD for <netmod@ietf.org>; Tue, 5 May 2020 02:45:47 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by mailout.easydns.com (Postfix) with ESMTP id 544B8A2A61; Tue, 5 May 2020 09:45:47 +0000 (UTC)
Received: from mailout.easydns.com ([127.0.0.1]) by localhost (emo13-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3xxQL06zevRj; Tue, 5 May 2020 09:45:47 +0000 (UTC)
Received: from hedeland.org (81-228-157-209-no289.tbcn.telia.com [81.228.157.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easydns.com (Postfix) with ESMTPSA id 4C7CEA1FEE; Tue, 5 May 2020 09:45:43 +0000 (UTC)
Received: from pluto.hedeland.org (pluto.hedeland.org [10.1.1.5]) by tellus.hedeland.org (8.15.2/8.15.2) with ESMTPS id 0459jfOP026897 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Tue, 5 May 2020 11:45:41 +0200 (CEST) (envelope-from per@hedeland.org)
To: Martin Björklund <mbj+ietf@4668.se>
Cc: chopps@chopps.org, netmod@ietf.org
References: <AE95765B-0561-45DC-A4A8-E8B3BCE4BB12@cisco.com> <DM5PR08MB263359FB2993EC569444A4539BAA0@DM5PR08MB2633.namprd08.prod.outlook.com> <0533F71D-C017-40A5-B953-21FFF9CBD1FB@chopps.org> <20200505.110011.1423220937314479731.id@4668.se>
From: Per Hedeland <per@hedeland.org>
Message-ID: <f96eaddb-47f2-9f43-9e7f-5d60987adb27@hedeland.org>
Date: Tue, 05 May 2020 11:45:41 +0200
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1
MIME-Version: 1.0
In-Reply-To: <20200505.110011.1423220937314479731.id@4668.se>
Content-Type: text/plain; charset="windows-1252"
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/UA8I4nWkawxqr35ebg4_dFmxoiI>
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:46:12 -0000

On 2020-05-05 11:00, Martin Björklund wrote:
> 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.

So, no rpc statement, and thereby no possibility to extend NETCONF
with new RPCs? (Or to be precise, YANG would extend NETCONF with
exactly one RPC, called "operation"?)

--Per

> /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 dont 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
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>