Subject: [Netconf] restconf data namespace

From: "Lisa (Yi) Huang" <[email-masked]>
Date: Thu, 22 Oct 2015 08:14:26 +0000

Hi netconf experts,

I have some questions regarding namespace specified in RESTCONF Protocol draft-ietf-netconf-restconf-08.

For this notification example:

module example-mod {
       namespace "http://example.com/event/1.0";

       notification event {
        leaf event-class { type string; }
        container reporting-entity {
          leaf card { type string; }
        }
        leaf severity { type string; }
       }
     }

In RFC6020

<notification
       xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
       <eventTime>2008-07-08T00:01:00Z</eventTime>
       <event xmlns="http://example.com/event">
         <event-class>fault</event-class>
         <reporting-entity>
           <card>Ethernet0</card>
         </reporting-entity>
         <severity>major</severity>
       </event>
     </notification>

In restconf I-D

data: <notification
   data:    xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">
   data:    <event-time>2013-12-21T00:01:00Z</event-time>
   data:    <event xmlns="http://example.com/event/1.0">
   data:       <event-class>fault</event-class>
   data:       <reporting-entity>
   data:           <card>Ethernet0</card>
   data:       </reporting-entity>
   data:       <severity>major</severity>
   data:     </event>
   data: </notification>

1. The name space changed from netconf:notification to yang:ietf-restconf. Here are my questions: What is the rule for the namespace change?

Json data:

data: {
   data:   "ietf-restconf:notification": {
   data:     "event-time": "2013-12-21T00:01:00Z",
   data:     "example-mod:event": {
   data:       "event-class": "fault",
   data:       "reporting-entity": { "card": "Ethernet0" },
   data:       "severity": "major"
   data:     }
   data:   }
   data: }

2. How does example-mod namespace in json map to http://example.com/event/1.0 in xml?

Section D.3.6 explained how filter looks like. Question and comments follows:

               // filter = /event/event-class='fault'

      GET /mystreams/NETCONF?filter=%2Fevent%2Fevent-class%3D'fault'

      // Note: the module name is used as prefix.
      // filter = (/example-mod:event1/name='joe' and
      //           /example-mod:event1/status='online')
      GET /mystreams/NETCONF?
        filter=(%2Fexample-mod%3Aevent1%2Fname%3D'joe'%20and
                %20%2Fexample-mod%3Aevent1%2Fstatus%3D'online')

3. The url /mystreams/NETCONF is not consistent with /streams/NETCONF used for stream subscription.

4. For the first filter without namespace, what events will be streamed if the two yang modules have the same notification name (different data ) in the server?

Thanks,

Lisa

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 22 Oct 2015 10:47:58 +0200 (CEST)

Hi,

"Lisa (Yi) Huang" <[email-masked]> wrote:
> 1. The name space changed from netconf:notification to
> yang:ietf-restconf. Here are my questions: What is the rule for the
> namespace change?

The element "notification" in the namespace
"urn:ietf:params:xml:ns:netconf:notification:1.0" is used in NETCONF
to send a notification.

The element "notification" in the namespace
"urn:ietf:params:xml:ns:yang:ietf-restconf" is used in RESTCONF to
send a notification.

These are simply protocol-specific wrappers.

> http://example.com/event/1.0 in xml?

"example-mod" is the name of the module that defines the xml namespace 
"http://example.com/event/1.0".

The JSON mapping uses the module name instead of the namespace, see
draft-ietf-netmod-yang-json.

> used for stream subscription.

Ok, I changed the examples to make them consistent.

But note that the "/streams/NETCONF" is just an example.  A server is
free to use any location for the streams.   The client learns where
the stream is found by looking at the "location" leaf for the stream.

> 4. For the first filter without namespace, what events will be
> streamed if the two yang modules have the same notification name
> (different data ) in the server?

All events that match the filter are streamed.  So in your example,
events from both modules will be streamed.

/martin

---

From: "Lisa (Yi) Huang" <[email-masked]>
Date: Thu, 22 Oct 2015 16:43:48 +0000

Hmm. This "no namespace" filter doesn¹t seem to be consistent with rfc5277
which this draft referenced. There are two filtering illustrated in
Rfc5277-- subtree filtering and xpath filtering. Both examples of section
5.1 and 5.2 included namespace. Could you clarify which type of this ³no
namespace² belongs to?

Thanks,
Lisa