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

From: "Reshad Rahman (rrahman)" <[email-masked]>
Date: Thu, 30 Apr 2020 15:39:12 +0000

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 <[email-masked]> on behalf of "Sterne, Jason (Nokia - CA/Ottawa)" <[email-masked]>
Date: Thursday, April 30, 2020 at 11:06 AM
To: "[email-masked]" <[email-masked]>
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

---

From: "Sterne, Jason (Nokia - CA/Ottawa)" <[email-masked]>
Date: Thu, 30 Apr 2020 15:44:54 +0000

I used a bad example.  Pretend the mandatory statement wasn't there. Is it an error?

From: Reshad Rahman (rrahman) <[email-masked]>
Sent: Thursday, April 30, 2020 11:39 AM
To: Sterne, Jason (Nokia - CA/Ottawa) <[email-masked]>; [email-masked]
Subject: Re: [netconf] Error to make a NETCONF action call without including an action node?

I’d expect this error:

Regards,
Reshad.

From: netconf <[email-masked]<mailto:[email-masked]>> on behalf of "Sterne, Jason (Nokia - CA/Ottawa)" <[email-masked]<mailto:[email-masked]>>
Date: Thursday, April 30, 2020 at 11:06 AM
To: "[email-masked]<mailto:[email-masked]>" <[email-masked]<mailto:[email-masked]>>
Subject: [netconf] Error to make a NETCONF action call without including an action node?

Hi all,

   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

     <rpc message-id="101"

Jason

---

From: "Reshad Rahman (rrahman)" <[email-masked]>
Date: Thu, 30 Apr 2020 16:13:14 +0000

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)" <[email-masked]>
Date: Thursday, April 30, 2020 at 11:45 AM
To: "Reshad Rahman (rrahman)" <[email-masked]>, "[email-masked]" <[email-masked]>
Subject: RE: [netconf] Error to make a NETCONF action call without including an action node?

I’d expect this error:

Regards,
Reshad.

Hi all,

   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

     <rpc message-id="101"

Jason

---

From: "Sterne, Jason (Nokia - CA/Ottawa)" <[email-masked]>
Date: Thu, 30 Apr 2020 16:27:25 +0000

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

     <rpc message-id="101"

From: Reshad Rahman (rrahman) <[email-masked]>
Sent: Thursday, April 30, 2020 12:13 PM
To: Sterne, Jason (Nokia - CA/Ottawa) <[email-masked]>; [email-masked]
Subject: Re: [netconf] Error to make a NETCONF action call without including an action node?

From: "Sterne, Jason (Nokia - CA/Ottawa)" <[email-masked]<mailto:[email-masked]>>
Date: Thursday, April 30, 2020 at 11:45 AM
To: "Reshad Rahman (rrahman)" <[email-masked]<mailto:[email-masked]>>, "[email-masked]<mailto:[email-masked]>" <[email-masked]<mailto:[email-masked]>>
Subject: RE: [netconf] Error to make a NETCONF action call without including an action node?

From: Reshad Rahman (rrahman) <[email-masked]<mailto:[email-masked]>>
Sent: Thursday, April 30, 2020 11:39 AM
To: Sterne, Jason (Nokia - CA/Ottawa) <[email-masked]<mailto:[email-masked]>>; [email-masked]<mailto:[email-masked]>
Subject: Re: [netconf] Error to make a NETCONF action call without including an action node?

I’d expect this error:

Regards,
Reshad.

Hi all,

   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

     <rpc message-id="101"

Jason

---

From: Andy Bierman <[email-masked]>
Date: Thu, 30 Apr 2020 10:52:21 -0700

On Thu, Apr 30, 2020 at 9:27 AM Sterne, Jason (Nokia - CA/Ottawa) <
[email-masked]> 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"
>

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) <[email-masked]>
> *Sent:* Thursday, April 30, 2020 12:13 PM
> *To:* Sterne, Jason (Nokia - CA/Ottawa) <[email-masked]>;
> [email-masked]
> *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)" <[email-masked]>
> *Date: *Thursday, April 30, 2020 at 11:45 AM
> *To: *"Reshad Rahman (rrahman)" <[email-masked]>, "[email-masked]" <
> [email-masked]>
> *Subject: *RE: [netconf] Error to make a NETCONF action call without
> including an action node?
>
>
>
> *From:* Reshad Rahman (rrahman) <[email-masked]>
> *Sent:* Thursday, April 30, 2020 11:39 AM
> *To:* Sterne, Jason (Nokia - CA/Ottawa) <[email-masked]>;
> [email-masked]
> *Subject:* Re: [netconf] Error to make a NETCONF action call without
> including an action node?
>
>
>
> *From: *netconf <[email-masked]> on behalf of "Sterne, Jason
> (Nokia - CA/Ottawa)" <[email-masked]>
> *Date: *Thursday, April 30, 2020 at 11:06 AM
> *To: *"[email-masked]" <[email-masked]>
> *Subject: *[netconf] Error to make a NETCONF action call without
> including an action node?
>
>
>
> Hi all,
>
>
>
> 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"
>
> _______________________________________________
> netconf mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netconf
>

---

From: "Sterne, Jason (Nokia - CA/Ottawa)" <[email-masked]>
Date: Thu, 30 Apr 2020 21:46:25 +0000

Thx all.

From: Andy Bierman <[email-masked]>
Sent: Thursday, April 30, 2020 1:52 PM
To: Sterne, Jason (Nokia - CA/Ottawa) <[email-masked]>
Cc: Reshad Rahman (rrahman) <[email-masked]>; [email-masked]
Subject: Re: [netconf] Error to make a NETCONF action call without including an action node?

On Thu, Apr 30, 2020 at 9:27 AM Sterne, Jason (Nokia - CA/Ottawa) <[email-masked]<mailto:[email-masked]>> 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

     <rpc message-id="101"

This should be an error

   be included.  The innermost container or list contains an XML element

   that carries the name of the defined action.  Within this element,

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

Andy

I’d expect this error:

Regards,
Reshad.

Hi all,

   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

     <rpc message-id="101"

Jason
_______________________________________________
netconf mailing list
[email-masked]<mailto:[email-masked]>
https://www.ietf.org/mailman/listinfo/netconf