Re: [netmod] YANG actions - need to define OK/error or can reuse NETCONF ok/rpc-error ?

Martin Bjorklund <mbj@tail-f.com> Fri, 08 June 2018 08:44 UTC

Return-Path: <mbj@tail-f.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 6975D130E37 for <netmod@ietfa.amsl.com>; Fri, 8 Jun 2018 01:44:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-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 HgfxYPQEc8Oq for <netmod@ietfa.amsl.com>; Fri, 8 Jun 2018 01:44:28 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 7B889130E35 for <netmod@ietf.org>; Fri, 8 Jun 2018 01:44:28 -0700 (PDT)
Received: from localhost (unknown [173.38.220.61]) by mail.tail-f.com (Postfix) with ESMTPSA id 50B141AE027A; Fri, 8 Jun 2018 10:44:25 +0200 (CEST)
Date: Fri, 08 Jun 2018 10:44:24 +0200
Message-Id: <20180608.104424.959527989316421656.mbj@tail-f.com>
To: jason.sterne@nokia.com
Cc: netmod@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <AM0PR07MB3844E1E2FA97C9FB696BA3789B640@AM0PR07MB3844.eurprd07.prod.outlook.com>
References: <AM0PR07MB3844C6E5A6F4085B530B63429B640@AM0PR07MB3844.eurprd07.prod.outlook.com> <20180607.232059.254974416192719323.mbj@tail-f.com> <AM0PR07MB3844E1E2FA97C9FB696BA3789B640@AM0PR07MB3844.eurprd07.prod.outlook.com>
X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/Ky-shI6Hp7g8TNdc5vstIaqrGWg>
Subject: Re: [netmod] YANG actions - need to define OK/error or can reuse NETCONF ok/rpc-error ?
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.26
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: Fri, 08 Jun 2018 08:44:32 -0000

"Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com> wrote:
> Thanks Martin.  I should have found that myself when I was looking
> through that section.
> 
> What about the case where the operation invocation did not succeed and
> there are no output parameters defined ?

In NETCONF that will be a <rpc-error>, as per RFC 6241.  The action is
invoked with a normal NETCONF <rpc> message.


/martin



> 
> Rgds,
> Jason
> 
> > -----Original Message-----
> > From: Martin Bjorklund [mailto:mbj@tail-f.com]
> > Sent: Thursday, June 7, 2018 5:21 PM
> > To: Sterne, Jason (Nokia - CA/Ottawa) <jason.sterne@nokia.com>
> > Cc: netmod@ietf.org
> > Subject: Re: [netmod] YANG actions - need to define OK/error or can
> > reuse
> > NETCONF ok/rpc-error ?
> > 
> > Hi,
> > 
> > "Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com> wrote:
> > > Hi all,
> > >
> > > When defining an 'action' in a YANG 1.1 model, and we want the server
> > > to be able to respond with <ok> or some error information, do we need
> > > to define the ok/error info in the 'output' of the action, or can we
> > > define an action without any 'output' statement and have the server
> > > respond using the typical <ok> or <rpc-error> in NETCONF ?
> > 
> > You don't need to define "ok" - see section 7.15.2, the last paragraph
> > of RFC 7950:
> > 
> >    If the action operation invocation succeeded and no output parameters
> >    are returned, the <rpc-reply> contains a single <ok/> element defined
> >    in [RFC6241].  If output parameters are returned, they are encoded as
> >    child elements to the <rpc-reply> element defined in [RFC6241], in
> >    the same order as they are defined within the "output" statement.
> > 
> > 
> > 
> > /martin
> > 
> > > I'm not sure if it is relevant, but when I look at the definition of
> > > the commit rpc in the NETCONF spec, there is no 'output' defined but
> > > clearly a response of <ok> or an rpc-error can be returned by a
> > > server.
> > >
> > > If we don't define the ok/error in the action itself then I suppose
> > > other types of interfaces (RESTCONF) may or may not have other ways to
> > > reply ok/error (at least it won't be defined by the YANG model for the
> > > particular action).
> > >
> > > But it does seem like a waste to go and specify ok/error information
> > > for every action out there if they only need to return ok or error
> > > information that could be carried in the standard rpc-error message.
> > >
> > > Rgds,
> > > Jason
>