Subject: [Netconf] RESTCONF Fields Interpretation Request

From: "Clyde Wildes (cwildes)" <[email-masked]>
Date: Tue, 4 Jul 2017 21:58:58 +0000

Hi,

We are using a native interface model with a list of interfaces. The native GigabitEthernet interface has some leaves that are defined in an imported module such as “channel-group” and “negotiation” in the example below.

Here is the config under one of the interfaces – note the “Cisco-IOS-XE-ethernet:” leaf prefix from the imported module.
{
 "Cisco-IOS-XE-native:GigabitEthernet": {
   "name": "0/0/0",
   "ip": {
     "no-address": {
       "address": false
     }
   },
   "mtu": 6700,
   "Cisco-IOS-XE-ethernet:channel-group": {
     "number": 37,
     "mode": "passive"
   },
   "Cisco-IOS-XE-ethernet:negotiation": {
     "auto": true
   }
 }
}

The following use of fields in a GET works correctly.

GET https://10.104.50.97/restconf/data/Cisco-IOS-XE-native:native/interface?fields=GigabitEthernet(mtu)
{
 "Cisco-IOS-XE-native:interface": {
   "GigabitEthernet": [
     {
       "mtu": 6700
     },
     {
       "mtu": 6700
     }
  ]
 }
}

The following GET fails to return the leaves contained in the imported module which seems like an error.

GET https://10.104.50.97/restconf/data/Cisco-IOS-XE-native:native/interface?fields=GigabitEthernet(Cisco-IOS-XE-ethernet:channel-group)
{
 "Cisco-IOS-XE-native:interface": {
   "GigabitEthernet": []
 }
}

8040 says:

fields-expr = path "(" fields-expr ")" / path ";" fields-expr / path
path = api-identifier [ "/" path ]

And one of the forms of api-identifier can be:
api-identifier = [module-name ":"] identifier

Can the fields-expr in a fields query parameter name an element from an imported module? I say “yes” from the RFC. Please comment.

Thanks,

Clyde

---

From: "Steve Truong (struong)" <[email-masked]>
Date: Wed, 5 Jul 2017 04:35:08 +0000

Hi Clyde,

I agree.

steve

-----Original Message-----
From: Netconf [mailto:[email-masked]] On Behalf Of Clyde Wildes (cwildes)
Sent: Tuesday, July 04, 2017 2:59 PM
To: [email-masked]
Subject: [Netconf] RESTCONF Fields Interpretation Request

Hi,

8040 says:

fields-expr = path "(" fields-expr ")" / path ";" fields-expr / path path = api-identifier [ "/" path ]

Thanks,

Clyde

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

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 06 Jul 2017 14:15:01 +0200 (CEST)

"Clyde Wildes (cwildes)" <[email-masked]> wrote:
> Hi,
> 
> We are using a native interface model with a list of interfaces. The
> native GigabitEthernet interface has some leaves that are defined in
> an imported module such as “channel-group” and “negotiation” in the
> example below.
> 
> Here is the config under one of the interfaces – note the
> “Cisco-IOS-XE-ethernet:” leaf prefix from the imported module.

What do you mean that these are defined in an imported module?  If
module "Cisco-IOS-XE-native" imports "Cisco-IOS-XE-ethernet", the only
way it can add nodes from "Cisco-IOS-XE-native" can add nodes defined
in "Cisco-IOS-XE-ethernet" is if "Cisco-IOS-XE-ethernet" defines a
grouping that "Cisco-IOS-XE-native" uses.  But in this case the nodes
in the grouping are incorporated into the "Cisco-IOS-XE-native"
module's namespace, and thus you wouldn't have the
"Cisco-IOS-XE-ethernet" prefix on these nodes.

OTOH, in order to get the "Cisco-IOS-XE-ethernet" prefix like below,
"Cisco-IOS-XE-ethernet" would have to augment "Cisco-IOS-XE-native".
But then "Cisco-IOS-XE-native" cannot import "Cisco-IOS-XE-ethernet".

> GET
> https://10.104.50.97/restconf/data/Cisco-IOS-XE-native:native/interface?fields=GigabitEthernet(mtu)
> {
> GET
> https://10.104.50.97/restconf/data/Cisco-IOS-XE-native:native/interface?fields=GigabitEthernet(Cisco-IOS-XE-ethernet:channel-group)
> {
> Can the fields-expr in a fields query parameter name an element from
> an imported module? I say “yes” from the RFC. Please comment.

If you mean that "Cisco-IOS-XE-ethernet" augments
"Cisco-IOS-XE-native" then yes, the "fields" expression can refer to
these nodes.

/martin

---

From: "Clyde Wildes (cwildes)" <[email-masked]>
Date: Thu, 6 Jul 2017 16:00:42 +0000

Martin,

“If you mean that "Cisco-IOS-XE-ethernet" augments "Cisco-IOS-XE-native" then yes, the "fields" expression can refer to these nodes.”

This is the case, "Cisco-IOS-XE-ethernet" augments "Cisco-IOS-XE-native".

Thanks,

Clyde

On 7/6/17, 5:15 AM, "Martin Bjorklund" <[email-masked]> wrote:

    

    /martin