Subject: [Netconf] netconf-restconf Action

From: t.petch <[email-masked]>
Date: Tue, 1 Mar 2016 09:56:24 +0000

I would like to know what an action looks like in restconf and JSON.
What would be the equivalent of, from rfc6020bis,

     <rpc message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <action xmlns="urn:ietf:params:xml:ns:yang:1">
         <server xmlns="http://example.net/server-farm">
           <name>apache-1</name>
           <reset>
             <reset-at>2014-07-29T13:42:00Z</reset-at>
           </reset>
         </server>
       </action>
     </rpc>

     <rpc-reply message-id="101"
                xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <reset-finished-at xmlns="http://example.net/server-farm">
         2014-07-29T13:42:12Z
       </reset-finished-at>
     </rpc-reply>

Tom Petch

---

From: Andy Bierman <[email-masked]>
Date: Thu, 3 Mar 2016 18:45:48 -0800

>        <reset-finished-at xmlns="http://example.net/server-farm">

I put examples in the next RESTCONF draft for XML and JSON.

I am assuming the module-name is server-farm.

   POST /restconf/data/server-farm:server=apache-1/reset HTTP/1.1
   Host: example.com
   Content-Type: application/yang.action+json

   { "server-farm:reset" : {
        "reset-at" : "2014-07-29T13:42:00Z"
     }
   }

   HTTP/1.1 200 OK
   Date: Mon, 25 Apr 2012 11:10:30 GMT
   Server: example-server
   Content-Type: application/yang.action+json

   {
      "server-farm:reset" : {
         "reset-finished-at" : "2014-07-29T13:42:12Z"
     }
   }

Tom Petch

Andy

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

---

From: t.petch <[email-masked]>
Date: Thu, 10 Mar 2016 18:12:06 +0000

Andy

Thanks for this;  I am getting there but struggle to match what you have
given with the partial example in restconf-09 where it has

      HTTP/1.1 200 OK
     ...
      {
        "example-ops:output" : {
          "reboot-time" : 30,
          "message" : "Going down for system maintenance",
          "language" : "en-US"
        }
      }

i.e the I-D has included an 'output' node but has omitted the name of
the action itself, namely 'example-ops:get-reboot-info ', whereas you
have done the opposite.  I was expecting both.

Thoughts?

Tom Petch

---

From: Andy Bierman <[email-masked]>
Date: Thu, 10 Mar 2016 10:23:13 -0800

> have done the opposite.  I was expecting both.
This is being changed in RESTCONF-10
It matches the way YANG 1.1 encodes action input and output, except
there is no need to include the ancestor nodes
since they were in the request target resource URI

Andy

---

From: Andy Bierman <[email-masked]>
Date: Thu, 10 Mar 2016 19:09:03 -0800

> have done the opposite.  I was expecting both.

I am changing it to be the same as an rpc-stmt.
I realized that no NETCONF and RESTCONF responses identify
the exact rpc-stmt or action-stmt to use to parse the "output" element.
The paired request message must be known to the parser. (yuch)
So this will be consistently flawed as well ;-)

Tom Petch

Andy