Re: [netmod] Action and RPC statements

Robert Wilton <rwilton@cisco.com> Wed, 01 November 2017 11:24 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 CD03E13F6FE for <netmod@ietfa.amsl.com>; Wed, 1 Nov 2017 04:24:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.501
X-Spam-Level:
X-Spam-Status: No, score=-14.501 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, 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 AqLiUZkbIlt9 for <netmod@ietfa.amsl.com>; Wed, 1 Nov 2017 04:24:44 -0700 (PDT)
Received: from aer-iport-2.cisco.com (aer-iport-2.cisco.com [173.38.203.52]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6687313F701 for <netmod@ietf.org>; Wed, 1 Nov 2017 04:24:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2652; q=dns/txt; s=iport; t=1509535482; x=1510745082; h=subject:to:references:from:message-id:date:mime-version: in-reply-to:content-transfer-encoding; bh=KFCQdGIhvf0bF7mQTVdNTZLrA2y5wkXaSHSi4dzCIFk=; b=Modb93adkIuKIP9WulfdPzAkXBwgzH9z04H6/Zn+gnLAGzGTrb2o99me 2ggxKzoq4r3Fz2ti41haaL4eg2qFuDiy13HCyuPaY2urGmQVv/ZkKgUgT 2S6g+rM66GqP7wtIqH5X97+R3LuNsqDDSfTGZpTxHQu64cVQo3BbYMdCl 0=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0C7AAAWrvlZ/xbLJq1cDgwBAQEBAgEBA?= =?us-ascii?q?QEIAQEBAYUxhCSKH3SQIJZDghEKhTsChTsYAQIBAQEBAQEBayiFHQEBAQMBIw8?= =?us-ascii?q?BBVELGAICJgICVwYBDAgBAYoXCKg8gieEFQGGeQEBAQEBAQEBAQEBAQEBAQEBA?= =?us-ascii?q?QEBAR2BD4Ifg1qCEoJMNYgmgmEFogqUfIt2hzqOJ4dsgTkfOFyBEDQhCB0Vgy6?= =?us-ascii?q?EHwQBOkGNIwEBAQ?=
X-IronPort-AV: E=Sophos;i="5.44,327,1505779200"; d="scan'208";a="655799396"
Received: from aer-iport-nat.cisco.com (HELO aer-core-3.cisco.com) ([173.38.203.22]) by aer-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Nov 2017 11:24:40 +0000
Received: from [10.63.23.76] (dhcp-ensft1-uk-vla370-10-63-23-76.cisco.com [10.63.23.76]) by aer-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id vA1BOdDk004237; Wed, 1 Nov 2017 11:24:39 GMT
To: Phil Shafer <phil@juniper.net>, Kent Watsen <kwatsen@juniper.net>, Martin Bjorklund <mbj@tail-f.com>, "andy@yumaworks.com" <andy@yumaworks.com>, "netmod@ietf.org" <netmod@ietf.org>, Randy Presuhn <randy_presuhn@alumni.stanford.edu>
References: <201711010636.vA16aW1S027622@idle.juniper.net>
From: Robert Wilton <rwilton@cisco.com>
Message-ID: <ed73fb43-a081-486f-0af0-6ab3d87641f0@cisco.com>
Date: Wed, 1 Nov 2017 11:24:39 +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: <201711010636.vA16aW1S027622@idle.juniper.net>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/0pMdPgCAihJP_TNeYkmEgQQGje4>
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: Wed, 01 Nov 2017 11:24:46 -0000


On 01/11/2017 06:36, Phil Shafer wrote:
> Robert Wilton writes:
>> ii) However, as far as I can see, it doesn't make sense for an action to
>> directly affect the contents of any configuration datastore, that should
>> be done via a purpose built rpc (like edit-config).
> An example action would be to retrieve the  fingerprint of an ssh
> key.  I might want to get the fingerprint of a key in <candidate>
> before I commit it.
>
> Or I could have an action that sets the SNMPv3 auth key to a random
> value, and I want to invoke that action against <candidate>.
>
> Seems like <startup> might also be an interesting place to target
> actions, but I can't think of a good example.
>
> There are always scenarios where something is useful, and the problem
> with ruling it out is that it becomes needed at some later point.
> We've a habit of ruling out things and later wishing we had them.
Yes, I have this concern.


>
> Is the easy fix to just put a datastore leaf under rpc/action and
> have it default to operational?  Any specific RPC can define its
> own datastore leaf of hard-code the database in the description
> (explicitly or implicitly <operational>), but the <action> RPC only
> gets this if we make a new parameter for it.

I think that an action/rpc statement should indicate in the schema where 
its input/output arguments are resolved against.  I.e. "configuration", 
"state", or "client-provided".  This would be specified by a new 
optional "resolve-to" YANG sub-statement to action/rpc, that defaults to 
"state" if not specified.

(i) Actions/rpcs that "resolve-to state" would resolve against 
<operational> (the default behaviour).
(ii) Actions/rpcs that "resolve-to configuration" would probably resolve 
against <intended>.
(iii) Actions/rpcs that "resolve-to client-provided" would require that 
an explicit datastore be specified as an input parameter to the action/rpc.

Actions of type "resolve-to client-provided" would be required to be 
invoked with a new <datastore-action> RPC that has a new target 
datastore input parameter.

RPCs of type "resolve-to client-provided" would be required to have an 
input parameter named "datastore" that is a leafref to a datastore.

Finally, I would propose that we defer defining the new "resolved-to" 
YANG statement and <datastore-action> RPC to YANG/NETCONF/RESTCONF 2.0, 
so that for the moment actions/rpcs always resolve against <operational> 
because that will be the default behaviour today, but with the 
understanding that this could be extended in future.

Thanks,
Rob


>
> Thanks,
>   Phil
> .
>