Re: [netmod] Action and RPC statements

Robert Wilton <rwilton@cisco.com> Tue, 31 October 2017 14:14 UTC

Return-Path: <rwilton@cisco.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 0B8B713F44D for <netmod@ietfa.amsl.com>; Tue, 31 Oct 2017 07:14:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.5
X-Spam-Level:
X-Spam-Status: No, score=-14.5 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.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 bnsghBtzYmMD for <netmod@ietfa.amsl.com>; Tue, 31 Oct 2017 07:14:23 -0700 (PDT)
Received: from aer-iport-1.cisco.com (aer-iport-1.cisco.com [173.38.203.51]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DD844137C2E for <netmod@ietf.org>; Tue, 31 Oct 2017 07:14:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=13238; q=dns/txt; s=iport; t=1509459263; x=1510668863; h=subject:to:references:from:message-id:date:mime-version: in-reply-to; bh=mDnVFzsDUY+ixTD8IkDka4vROaJCLukv9DT2+o3Cdlo=; b=iKJ5VYM9dYcSoioL7czAInILnCbf0eNThQIUveiUWS5O85vtsCjx1a9s 598zV04CnMp3IESlc4UTO9j4mS3xztUh82d5XvkO6ZW7KeLk21OwU1Waa unQI5lF58JIGPgoMibwhPb7tV+RKHFv+slmzKJHMUULKEOubjkf6kc1Vp I=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0COAACmhPhZ/xbLJq1dDgsBAQEBAQEBAQEBAQcBAQEBAYJvQoESbieDfIofdJAfkH2FRYIRChgBCoRJTwKFKxgBAgEBAQEBAQFrKIUeAQEEAQEhSxsLDgoqAgInMAYBDAYCAQGKHxCoN4InJopkAQEBAQEBAQEBAQEBAQEBAQEBAQEBGAWDLoNagWkpgwGEe4MrgmEFogaUfIt0hzqOJodsgTkfOEKBKTQhCB0VSYJkhCA/QTaJFCyCFgEBAQ
X-IronPort-AV: E=Sophos;i="5.44,324,1505779200"; d="scan'208,217";a="698349308"
Received: from aer-iport-nat.cisco.com (HELO aer-core-3.cisco.com) ([173.38.203.22]) by aer-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Oct 2017 14:14:20 +0000
Received: from [10.63.23.63] (dhcp-ensft1-uk-vla370-10-63-23-63.cisco.com [10.63.23.63]) by aer-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id v9VEEK5o014656; Tue, 31 Oct 2017 14:14:20 GMT
To: Martin Bjorklund <mbj@tail-f.com>, andy@yumaworks.com, netmod@ietf.org, Randy Presuhn <randy_presuhn@alumni.stanford.edu>
References: <4d2030ca-3d75-72db-1afd-76a8597b615c@cisco.com> <c544a19e-2534-9355-002e-18affd12ea5a@alumni.stanford.edu> <CABCOCHQdmMYObMBCxP=qWuH3RdCRi9q7Y6G0VsSnDeyg2qLc4w@mail.gmail.com> <20171027.103341.1048835221774842137.mbj@tail-f.com>
From: Robert Wilton <rwilton@cisco.com>
Message-ID: <9645422a-05a2-9d24-e50e-799d964f021f@cisco.com>
Date: Tue, 31 Oct 2017 14:14:20 +0000
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0
MIME-Version: 1.0
In-Reply-To: <20171027.103341.1048835221774842137.mbj@tail-f.com>
Content-Type: multipart/alternative; boundary="------------631D05CBC99CB4D47F6618AB"
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/NfpSc2UfRQzDgvurm_8GqE_0rgM>
Subject: Re: [netmod] Action and RPC statements
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
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, 31 Oct 2017 14:14:26 -0000

Hi,

Here is another attempt for proposed text for Actions/RPC statements in 
NMDA.

<new>

6.2 Invocation of RPC Operations

This section updates section 7.14 of RFC 7950.

RPCs MAY be defined as affecting the contents of a specific datastore,
any configuration datastore (e.g., <edit-config>), or any datastore
(e.g., <get-data>).  The RPC definition specifies how the RPC input
data is interpreted by the server.

RPCs definitions that do not explicitly state an affected
datastore(s) modify the general operational state of the server.
Hence, if any RPC input data relates to data node instances then
those would generally resolve to data node instances in the
<operational> data tree.


6.3 Invocation of Actions

This section updates section 7.15 of RFC 7950.

In YANG data models, the "action" statement may appear under "config
true" and "config false" schema nodes.  While instances of both
schema nodes may appear in <operational>, instances of "config true"
schema nodes may also appear in other datastores.

Actions are always invoked on a data node instance that exist in the
<operational> data tree.  The behavior defined by an action statement
is generally expected to affect the operational state of the server
rather than directly modifying the contents of any configuration
datastore.

</new>


On a related note, I also want to confirm that it is right that RPC 
input data is always checked against operational:

Section 6.1. of the NMDA draft states:

    o  If the XPath expression is defined in a substatement to an "input"
       statement in an "rpc" or "action" statement, the accessible tree
       is the RPC or action operation instance and all operational state
       in the server.  The root node has top-level data nodes in all
       modules as children.  Additionally, for an RPC, the root node also
       has the node representing the RPC operation being defined as a
       child.  The node representing the operation being defined has the
       operation's input parameters as children.



Is <operational> always the right datastore to evaluate RPC input/output 
data relative to?  For most RPCs this seems to be the right choice by 
default but it also seems plausible that someone may wish to define an 
RPC that wants to validate its input parameters against the contents of 
another datastore.

An example could be an "is-applied" RPC that takes a path to a subtree 
in <running> or <intended> and checks whether the configuration for that 
subtree is fully represented in <operational>.

Thanks,
Rob


On 27/10/2017 09:33, Martin Bjorklund wrote:
> Andy Bierman <andy@yumaworks.com> wrote:
>> On Thu, Oct 26, 2017 at 11:22 AM, Randy Presuhn <
>> randy_presuhn@alumni.stanford.edu> wrote:
>>
>>> Hi -
>>>
>>> On 10/26/2017 10:44 AM, Robert Wilton wrote:
>>>
>>>> Hi ,
>>>>
>>>> Separating out the issue regarding which datastore action and RPC apply
>>>> to, we propose the following NEW text to the datastores draft:
>>>>
>>>> 6.2 Invocation of Actions and RPC Operations
>>>>
>>>>     This section updates section 7.15. of RFC 7950.
>>>>
>>>>     In YANG data models, the "action" statement may appear under "config
>>>>     true" and "config false" schema nodes.  While instances of both
>>>>     schema nodes may appear in <operational>, instances of "config true"
>>>>     schema nodes may also appear in other datastores.
>>>>
>>>>     An NMDA compliant server MUST execute all actions in the context of
>>>>     <operational>.  Likewise, an NMDA compliant server MUST invoke all RPC
>>>>     operations in the context of <operational>, unless the RPC is
>>>> explicitly
>>>>     defined as affecting other datastores (e.g., <edit-config>).
>>>>
>>>> OK?
>>>>
>>> A question - I understand the motivation for the "unless" for RPC
>>> operations, but wonder why there is no similar "unless" for actions.
>>>
>>>
>> The <rpc> is not really in a datastore at all.
>> It may have input and output parameters with leafref and must/when
>> statements.
>> These are evaluated in the <operational> context.
>> The <rpc> may in fact be something like <edit-config>
>> which has parameters (like <config> to apply to
>> a specific datastore.
>>
>> The action node is embedded within some data that has to be parsed
>> in a specific datastore before the action is processed.
>> This data is required to be in <operational>.
>> It also has XPath and leafref that needs to be resolved (same as <rpc>).
>>
>> The side effects of the <rpc> or <action> can impact other datastores.
>> This would be defined in the description-stmt and this is not a problem.
> This is exactly right.  We need to capture this in the text.
>
>
> /martin
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
> .
>