Re: [netconf] Error to make a NETCONF action call without including an action node?

Andy Bierman <andy@yumaworks.com> Thu, 30 April 2020 17:52 UTC

Return-Path: <andy@yumaworks.com>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BF8993A0E07 for <netconf@ietfa.amsl.com>; Thu, 30 Apr 2020 10:52:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.887
X-Spam-Level:
X-Spam-Status: No, score=-1.887 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.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 5FERqtML0tIG for <netconf@ietfa.amsl.com>; Thu, 30 Apr 2020 10:52:33 -0700 (PDT)
Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3D2AA3A0E06 for <netconf@ietf.org>; Thu, 30 Apr 2020 10:52:33 -0700 (PDT)
Received: by mail-yb1-xb36.google.com with SMTP id q206so2500784ybg.1 for <netconf@ietf.org>; Thu, 30 Apr 2020 10:52:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cAJJjRdeWsBQtK1WS/JV/IsR8tT8DpjsYyVU0vCmc2I=; b=ACFOMYyVgn5Nyh7yYr5bjqN9NpOPLMFrR26kQ/e6mvo7U+yf8cd94+wUGf3712kK64 6xwGy2OYzAgb3VjTNgQ8Sj0K7Plj7r5iAxjd7M6Vzy/jrXwUIggomOFpi2ERZV/LVjTg iZqNTJFRhT7zej8y8gCBcUW4EkKwvz/z4uscHEKjAZDcVDyWvE2P7/vlMfino8Woj4ht Espai586VdxmDO3OcfYlBFKSmQTXhZdg/ftifwNx0b+CUxXO2EalcT1YA1HiuFXdoNFy qJdnfYIyCmwk9e7LzoYJU+zMe6NjDK7IkKpb5ZQq4lG99zcBLRdCp/qBGqfHEm9Mbqkk zeMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cAJJjRdeWsBQtK1WS/JV/IsR8tT8DpjsYyVU0vCmc2I=; b=KnGRmZh6XrdzJXJrrrwlK/OwxDEwa643Asb2g97YMbCMYGeoj8J8sI5oPaseakgPv1 KW+pcuYeIVGHGmGk5ZOaIqbDxwhcR4ZVXY9xM0cOq8zudpzCGsKQrJkOfAIsKpoRfYAG gr5/aA/zUZIJ3KF5HR4+T2FVvZFuqbK+WlbwLfi0IhnnL271zC90DRRs/Ki4ZoT39bjO TXAIKpCie7jv700/WZ0h6KwTtTbaPkck/6POPqvDJhA+PiD157uY2b1vH73ibJtNzFU4 d8OBMQvck1XLHwS8U6XTbMHftBADU6X9a9hcOX5G0BrVIlngHBW/rTWX4EKBTdcr9P5o ar9Q==
X-Gm-Message-State: AGi0PuYC6jGREkHVP04CbskOnE0ZWzMUsHVKyCL3pB4S4IZn6G1W0kAg ZLbb4botfD3Ny4McFffWeyMgi006wOZLsPobC1A0Wg==
X-Google-Smtp-Source: APiQypK+r8tr0areYNePygcW0wGVAdZibvJwXbd3NMg72cZQMccuVphebF2Jkt+JrsJdkuHTW0nMQDW+2fVz7lyIucI=
X-Received: by 2002:a5b:cd0:: with SMTP id e16mr7218607ybr.107.1588269151891; Thu, 30 Apr 2020 10:52:31 -0700 (PDT)
MIME-Version: 1.0
References: <090A9D80-679C-4507-8BF9-BB82601B8260@cisco.com> <DM5PR08MB26331B8862F63FCE356632109BAA0@DM5PR08MB2633.namprd08.prod.outlook.com> <F231F702-1DB6-454D-95C8-8FD0F702E7ED@cisco.com> <DM5PR08MB2633108CDAB4602608749A7E9BAA0@DM5PR08MB2633.namprd08.prod.outlook.com>
In-Reply-To: <DM5PR08MB2633108CDAB4602608749A7E9BAA0@DM5PR08MB2633.namprd08.prod.outlook.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Thu, 30 Apr 2020 10:52:21 -0700
Message-ID: <CABCOCHSrx7Tyof6Qxag5gaTkwpDeJLJomDMgAgereE0U_JrPTw@mail.gmail.com>
To: "Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com>
Cc: "Reshad Rahman (rrahman)" <rrahman@cisco.com>, "netconf@ietf.org" <netconf@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000009b442a05a485ba10"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/Loru08gZynBbWq2psy1BEXJqHuk>
Subject: Re: [netconf] Error to make a NETCONF action call without including an action node?
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETCONF WG list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 30 Apr 2020 17:52:36 -0000

On Thu, Apr 30, 2020 at 9:27 AM Sterne, Jason (Nokia - CA/Ottawa) <
jason.sterne@nokia.com> wrote:

> No.  I meant this as my example (but Martin's reply clarified it). Sorry
> for the confusion of having those mandatory statements (although I don't
> think those are evaluated unless their action parent is requested, a bit
> like a presence container).
>
>
>
>    module test {
>
>        container foo {
>
>          leaf bar { type uint8; }
>
>          action reset {
>
>            input {
>
>              leaf reset-at {
>
>                type yang:date-and-time;
>
>               }
>
>             }
>
>             output {
>
>               leaf reset-finished-at {
>
>                 type yang:date-and-time;
>
>               }
>
>             }
>
>          } // action reset
>
>        } // container foo
>
>    } // module
>
>
>
> Should NETCONF return an error (which one?) for this request or would the
> server simply do nothing an return "OK" (like doing a get-data on a
> non-existent list entry) ?
>
>
>
>      <rpc message-id="101"
>
>           xmlns="urn:ietf:params:xml:ns:netconf:base:1..0">
>
>        <action xmlns="urn:ietf:params:xml:ns:yang:1">
>
>          <foo xmlns="urn:example:test">
>
>          </foo>
>
>        </action>
>
>      </rpc>
>
>
>


This should be an error



   The <action> element contains a hierarchy of nodes that identifies
   the node in the datastore.  It MUST contain all containers and list
   nodes in the direct path from the top level down to the list or
   container containing the action.  For lists, all key leafs MUST also
   be included. * The innermost container or list contains an XML element
   that carries the name of the defined action. * Within this element,
   the input parameters are encoded as child XML elements, in the same
   order as they are defined within the "input" statement.



Looks like the "operation-failed" error-tag unless "data-missing" can be
used.


Andy




>
>
> *From:* Reshad Rahman (rrahman) <rrahman@cisco.com>
> *Sent:* Thursday, April 30, 2020 12:13 PM
> *To:* Sterne, Jason (Nokia - CA/Ottawa) <jason.sterne@nokia.com>;
> netconf@ietf.org
> *Subject:* Re: [netconf] Error to make a NETCONF action call without
> including an action node?
>
>
>
> I just saw Martin’s response which points out that you’re missing the
> reset node. So your example should have the reset node but no reset-at
> input?
>
>
>
> *From: *"Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com>
> *Date: *Thursday, April 30, 2020 at 11:45 AM
> *To: *"Reshad Rahman (rrahman)" <rrahman@cisco.com>, "netconf@ietf.org" <
> netconf@ietf.org>
> *Subject: *RE: [netconf] Error to make a NETCONF action call without
> including an action node?
>
>
>
> I used a bad example.  Pretend the mandatory statement wasn't there. Is it
> an error?
>
>
>
> *From:* Reshad Rahman (rrahman) <rrahman@cisco.com>
> *Sent:* Thursday, April 30, 2020 11:39 AM
> *To:* Sterne, Jason (Nokia - CA/Ottawa) <jason.sterne@nokia.com>;
> netconf@ietf.org
> *Subject:* Re: [netconf] Error to make a NETCONF action call without
> including an action node?
>
>
>
> Jason, my understanding is that an error should be returned since the
> input leaf has mandatory true.
>
>
>
> Interestingly, the following text (for rpc) is missing from the action
> section. Oversight or on purpose?
>
> https://tools.ietf.org/html/rfc7950#section-7.14.2
>
>    If a leaf in the input tree has a "mandatory" statement with the
>
>    value "true", the leaf MUST be present in an RPC invocation.
>
>
>
> I’d expect this error:
>
> https://tools.ietf.org/html/rfc6241#appendix-A
>
>    error-tag:      missing-attribute
>
>    error-type:     rpc, protocol, application
>
>    error-severity: error
>
>    error-info:     <bad-attribute> : name of the missing attribute
>
>                    <bad-element> : name of the element that is supposed
>
>                      to contain the missing attribute
>
>    Description:    An expected attribute is missing.
>
>
>
> Regards,
>
> Reshad.
>
>
>
> *From: *netconf <netconf-bounces@ietf.org> on behalf of "Sterne, Jason
> (Nokia - CA/Ottawa)" <jason.sterne@nokia.com>
> *Date: *Thursday, April 30, 2020 at 11:06 AM
> *To: *"netconf@ietf.org" <netconf@ietf.org>
> *Subject: *[netconf] Error to make a NETCONF action call without
> including an action node?
>
>
>
> Hi all,
>
>
>
> If we have this YANG model (omitting some details):
>
>
>
>    module test {
>
>        container foo {
>
>          leaf bar { type uint8; }
>
>          action reset {
>
>            input {
>
>              leaf reset-at {
>
>                type yang:date-and-time;
>
>                mandatory true;
>
>               }
>
>             }
>
>             output {
>
>               leaf reset-finished-at {
>
>                 type yang:date-and-time;
>
>                 mandatory true;
>
>               }
>
>             }
>
>          } // action reset
>
>        } // container foo
>
>    } // module
>
>
>
> Should NETCONF return an error (which one?) for this request or would the
> server simply do nothing an return "OK" (like doing a get-data on a
> non-existent list entry) ?
>
>
>
>      <rpc message-id="101"
>
>           xmlns="urn:ietf:params:xml:ns:netconf:base:1..0">
>
>        <action xmlns="urn:ietf:params:xml:ns:yang:1">
>
>          <foo xmlns="urn:example:test">
>
>          </foo>
>
>        </action>
>
>      </rpc>
>
>
>
> Jason
> _______________________________________________
> netconf mailing list
> netconf@ietf.org
> https://www.ietf.org/mailman/listinfo/netconf
>