Subject: [6tisch] FW: YANG patch with XML and Netconf edit-config

From: "Pascal Thubert (pthubert)" <[email-masked]>
Date: Tue, 29 Sep 2015 07:56:23 +0000

Dear all:

Looks like Yang patch would be useful to us, say to modify a schedule.
Anyone looked at how that maps into CoMI?

Cheers,

Pascal

From: Netconf [mailto:[email-masked]] On Behalf Of Alexander Clemm (alex)
Sent: lundi 28 septembre 2015 21:05
To: Andy Bierman <[email-masked]>
Cc: Martin Bjorklund (mbjorklu) <[email-masked]>; Netconf <[email-masked]>
Subject: Re: [Netconf] YANG patch with XML and Netconf edit-config

Hi Andy,

thanks.

The examples in YANG Patch appendix D are all JSON, not XML.  But you answered my question.

--- Alex

From: Andy Bierman [mailto:[email-masked]]
Sent: Monday, September 28, 2015 11:47 AM
To: Alexander Clemm (alex) <[email-masked]<mailto:[email-masked]>>
Cc: Martin Bjorklund (mbjorklu) <[email-masked]<mailto:[email-masked]>>; Kent Watsen <[email-masked]<mailto:[email-masked]>>; Netconf <[email-masked]<mailto:[email-masked]>>
Subject: Re: YANG patch with XML and Netconf edit-config

On Mon, Sep 28, 2015 at 11:28 AM, Alexander Clemm (alex) <[email-masked]<mailto:[email-masked]>> wrote:
Hi Andy,

thank you for your response.

So, the encoding is like in the second alternative – e.g. something like      '

It follows the schema in ietf-yang-patch.yang

      <yang-patch>

        <patch-id>my-patch</patch-id>

        <edit>

          <edit-id>edit1</edit-id>

          <operation>delete</operation>

          <target>

             <interface>

               <name>Ethernet0/0</name>

             </interface>

          </target>

         </edit>

       </yang-patch>

(It would still be good to add an example to the appendix in the next revision of the draft.)  So, clearly different from what you have in an edit-config.

My reason for asking was that it seems you could accomplish essentially the same through either a yang-patch, or through an edit-config.  If that’s the case, I was wondering if the way those operations are encoded in XML be aligned?    (Clearly, the data model is the same.)

There are examples in YANG Patch, appendix D.

Thanks
--- Alex

Andy

From: Andy Bierman [mailto:[email-masked]<mailto:[email-masked]>]
Sent: Friday, September 25, 2015 9:34 PM
To: Alexander Clemm (alex) <[email-masked]<mailto:[email-masked]>>
Cc: Martin Bjorklund (mbjorklu) <[email-masked]<mailto:[email-masked]>>; Kent Watsen <[email-masked]<mailto:[email-masked]>>; Netconf <[email-masked]<mailto:[email-masked]>>
Subject: Re: YANG patch with XML and Netconf edit-config

On Fri, Sep 25, 2015 at 8:25 PM, Alexander Clemm (alex) <[email-masked]<mailto:[email-masked]>> wrote:
Helo Andy, Martin, Kent,

looking at draft-ietf-netconf-yang-patch-05, I am wondering if you have examples for YANG-patch with XML encoding.  The examples in section D are all JSON-encoded.

I am wondering specifically about how the XML encoding in YANG-patch relates to the Netconf encoding of edit-config.  I was hoping the two would be aligned or even the same, but is this the case?  It seems that the yang-patch way of doing things will require a different encoding of the payload, meaning you cannot simply take the same “edit snippet” and use it both for Netconf and Restconf, instead the content/encoding will depend on the underlying transport, not be agnostic to it.  Is this understanding correct?  What is the intention?  Do we have some examples?

Why would it be the same as <edit-config> just because it is encoded in XML?
Why would the data model change because it was XML vs. JSON?

If you want to use edit-config and the server supports it through RESTCONF:

   POST /restconf/operations/edit-config

  <input>
     <target> ... </target>
     <config>
       ...
     </config>
  </input>

Otherwise just use NETCONF if you want to use <edit-config>

Andy

For example, if we have (per the example in RFC 6241) the following edit-config snippet:

       <edit-config>

         <target>

           <running/>

         </target>

         <default-operation>none</default-operation>

         <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">

           <top xmlns="http://example.com/schema/1.2/config">

             <interface xc:operation="delete">

               <name>Ethernet0/0</name>

             </interface>

           </top>

         </config>

       </edit-config>

what does the corresponding YANG-patch look like – something like this:  (edit-config style)

      Accept: application/yang.patch-status+xml

      Content-Type: application/yang.patch+xml

      <yang-patch>

        <patch-id>my-patch</patch-id>

        <edit>

         <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">

           <top xmlns="http://example.com/schema/1.2/config">

             <interface xc:operation="delete">

               <name>Ethernet0/0</name>

             </interface>

           </top>

         </config>

        </edit>

       </yang-patch>

or is it something like this:

      Accept: application/yang.patch-status+xml

      Content-Type: application/yang.patch+xml

      <yang-patch>

        <patch-id>my-patch</patch-id>

        <edit>

          <edit-id>edit1</edit-id>

          <operation>delete</operation>

          <target>

             <interface>

               <name>Ethernet0/0</name>

             </interface>

          </target>

         </edit>

       </yang-patch>

Thanks
--- Alex

---

From: Andy Bierman <[email-masked]>
Date: Tue, 29 Sep 2015 10:14:21 -0700

> Anyone looked at how that maps into CoMI?

See sec. 4.2.6 of draft-vanderstok-core-comi-07.txt

Andy

>
>
> *From:* Netconf [mailto:[email-masked]] *On Behalf Of *Alexander
> Clemm (alex)
> *Sent:* lundi 28 septembre 2015 21:05
> *To:* Andy Bierman <[email-masked]>
> *Cc:* Martin Bjorklund (mbjorklu) <[email-masked]>; Netconf <
> [email-masked]>
> *Subject:* Re: [Netconf] YANG patch with XML and Netconf edit-config
>
>
>
> Hi Andy,
>
>
>
> thanks.
>
>
>
> *From:* Andy Bierman [mailto:[email-masked] <[email-masked]>]
> *Sent:* Monday, September 28, 2015 11:47 AM
> *To:* Alexander Clemm (alex) <[email-masked]>
> *Cc:* Martin Bjorklund (mbjorklu) <[email-masked]>; Kent Watsen <
> [email-masked]>; Netconf <[email-masked]>
> *Subject:* Re: YANG patch with XML and Netconf edit-config
>
>
>
>
>
>
>
> On Mon, Sep 28, 2015 at 11:28 AM, Alexander Clemm (alex) <[email-masked]>
> wrote:
>
> Hi Andy,
>
>
>
> (It would still be good to add an example to the appendix in the next
> revision of the draft.)  So, clearly different from what you have in an
> edit-config.
>
>
>
> My reason for asking was that it seems you could accomplish essentially
> the same through either a yang-patch, or through an edit-config.  If that’s
> the case, I was wondering if the way those operations are encoded in XML be
> aligned?    (Clearly, the data model is the same.)
>
>
>
>
>
>
>
> *From:* Andy Bierman [mailto:[email-masked]]
> *Sent:* Friday, September 25, 2015 9:34 PM
> *To:* Alexander Clemm (alex) <[email-masked]>
> *Cc:* Martin Bjorklund (mbjorklu) <[email-masked]>; Kent Watsen <
> [email-masked]>; Netconf <[email-masked]>
> *Subject:* Re: YANG patch with XML and Netconf edit-config
>
>
>
>
>
>
>
> On Fri, Sep 25, 2015 at 8:25 PM, Alexander Clemm (alex) <[email-masked]>
> wrote:
>
> Helo Andy, Martin, Kent,
>
>
>
> looking at draft-ietf-netconf-yang-patch-05, I am wondering if you have
> examples for YANG-patch with XML encoding.  The examples in section D are
> all JSON-encoded.
>
>
>
> I am wondering specifically about how the XML encoding in YANG-patch
> relates to the Netconf encoding of edit-config.  I was hoping the two would
> be aligned or even the same, but is this the case?  It seems that the
> yang-patch way of doing things will require a different encoding of the
> payload, meaning you cannot simply take the same “edit snippet” and use it
> both for Netconf and Restconf, instead the content/encoding will depend on
> the underlying transport, not be agnostic to it.  Is this understanding
> correct?  What is the intention?  Do we have some examples?
>
>
>
>
>
>
>