Re: [netmod] Action and RPC statements

Robert Wilton <> Wed, 01 November 2017 11:24 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id CD03E13F6FE for <>; Wed, 1 Nov 2017 04:24:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -14.501
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: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id AqLiUZkbIlt9 for <>; Wed, 1 Nov 2017 04:24:44 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 6687313F701 for <>; Wed, 1 Nov 2017 04:24:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;;; 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 (HELO ([]) by with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Nov 2017 11:24:40 +0000
Received: from [] ( []) by (8.14.5/8.14.5) with ESMTP id vA1BOdDk004237; Wed, 1 Nov 2017 11:24:39 GMT
To: Phil Shafer <>, Kent Watsen <>, Martin Bjorklund <>, "" <>, "" <>, Randy Presuhn <>
References: <>
From: Robert Wilton <>
Message-ID: <>
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: <>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Content-Language: en-US
Archived-At: <>
Subject: Re: [netmod] Action and RPC statements
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: NETMOD WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-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,
>   Phil
> .