Re: [Netconf] RESTCONF depth parameter

"Upendra Rajput (uprajput)" <uprajput@cisco.com> Fri, 13 December 2013 17:48 UTC

Return-Path: <uprajput@cisco.com>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C2A241AE364 for <netconf@ietfa.amsl.com>; Fri, 13 Dec 2013 09:48:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.501
X-Spam-Level:
X-Spam-Status: No, score=-14.501 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gbUhuFS1tTlZ for <netconf@ietfa.amsl.com>; Fri, 13 Dec 2013 09:48:06 -0800 (PST)
Received: from rcdn-iport-6.cisco.com (rcdn-iport-6.cisco.com [173.37.86.77]) by ietfa.amsl.com (Postfix) with ESMTP id 6DC321AE363 for <netconf@ietf.org>; Fri, 13 Dec 2013 09:48:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=11031; q=dns/txt; s=iport; t=1386956880; x=1388166480; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=13fZPiO/XhyeabmccOS22Uty1Wi9uabX9LFp+XMHu/0=; b=RFL1IgKvtK0OVN3bIfFAzLOjORWyQUJSpkDYM3IQ7mA+eBTRh+4CG5h9 P08cnZw4zoKNUnpDBo6lwPpDBowN0RmQRGD1H0sHXlduCdugPOudJGxJt ZwuElY4fQ5rOJXm8rqd8Uk5DNmS13ALrF2sHzyYsvnORULCiMdnIa1NaW 0=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AhQFAApIq1KtJV2c/2dsb2JhbABZgkZEgQ24XYElFnSCJQEBAQR5EAIBCBEDAQIoBzIUCQgCBA4FiATLHhePBBEGAYQ2BJgWkhSDKoIq
X-IronPort-AV: E=Sophos; i="4.95,480,1384300800"; d="scan'208,217"; a="291426647"
Received: from rcdn-core-5.cisco.com ([173.37.93.156]) by rcdn-iport-6.cisco.com with ESMTP; 13 Dec 2013 17:47:59 +0000
Received: from xhc-rcd-x09.cisco.com (xhc-rcd-x09.cisco.com [173.37.183.83]) by rcdn-core-5.cisco.com (8.14.5/8.14.5) with ESMTP id rBDHlxAa016086 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Fri, 13 Dec 2013 17:48:00 GMT
Received: from xmb-rcd-x12.cisco.com ([169.254.2.86]) by xhc-rcd-x09.cisco.com ([173.37.183.83]) with mapi id 14.03.0123.003; Fri, 13 Dec 2013 11:47:59 -0600
From: "Upendra Rajput (uprajput)" <uprajput@cisco.com>
To: Andy Bierman <andy@yumaworks.com>
Thread-Topic: [Netconf] RESTCONF depth parameter
Thread-Index: AQHO94glJ0RF/hpcY02i2VylCz74vppSxu2A//9/aQA=
Date: Fri, 13 Dec 2013 17:47:58 +0000
Message-ID: <CED085F2.370E2%uprajput@cisco.com>
References: <CECF7653.37003%uprajput@cisco.com> <CABCOCHT4+pXDYUZWPUtvcZ+O0KrXQhFuYc6esZdAhdwfgPmUkA@mail.gmail.com>
In-Reply-To: <CABCOCHT4+pXDYUZWPUtvcZ+O0KrXQhFuYc6esZdAhdwfgPmUkA@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/14.3.9.131030
x-originating-ip: [10.21.101.11]
Content-Type: multipart/alternative; boundary="_000_CED085F2370E2uprajputciscocom_"
MIME-Version: 1.0
Cc: "netconf@ietf.org" <netconf@ietf.org>
Subject: Re: [Netconf] RESTCONF depth parameter
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Network Configuration WG mailing list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Dec 2013 17:48:09 -0000

Thanks Andy.

In your example for depth=2 why is LIST "playlist" omitted. It is at the same level as CONTAINER "library" and "player" are. So I was thinking it will be part of depth=2 output for the example module that is being used in the draft.

GET /restconf/config/example-jukebox:jukebox?depth=2

     {
        "example-jukebox:jukebox" : {
          "library" : [null],

    "playlist": [null],   <<== Missing in your example for depth=2

          "player" : [null]
        }
      }

Thanks
~Upendra


From: Andy Bierman <andy@yumaworks.com<mailto:andy@yumaworks.com>>
Date: Friday, December 13, 2013 9:28 AM
To: Cisco Employee <uprajput@cisco.com<mailto:uprajput@cisco.com>>
Cc: "netconf@ietf.org<mailto:netconf@ietf.org>" <netconf@ietf.org<mailto:netconf@ietf.org>>
Subject: Re: [Netconf] RESTCONF depth parameter




On Thu, Dec 12, 2013 at 2:18 PM, Upendra Rajput (uprajput) <uprajput@cisco.com<mailto:uprajput@cisco.com>> wrote:
Hi,

I was looking at the "depth" parameter example in RESTCONF draft version 2 in section 3.8.1. There they have an example that will retrieve 2 levels of configuration data nodes from "example-jukebox" module. And the result of retrieval is shown as:

      {
        "example-jukebox:jukebox" : {
          "library" : {
            "artist" : {
              "name" : "Foo Fighters"
            }
          },
          "player" : {
            "gap" : 0.5
          }
        }
      }




This example is wrong and needs to be fixed.
The depth parameter is affected by the decision to make
all YANG nodes be resources instead of just containers and lists.
The example did not get updated to adjust for this change.

The example will be clarified so the starting data is shown, so it is
clear what is begin filtered by the depth parameter:


GET /restconf/config/example-jukebox:jukebox

      {
        "example-jukebox:jukebox" : {
          "library" : {
            "artist" : {
              "name" : "Foo Fighters"
            }
          },
          "player" : {
            "gap" : 0.5
          }
        }
      }

GET /restconf/config/example-jukebox:jukebox?depth=1

     {
        "example-jukebox:jukebox" : [null]
     }


GET /restconf/config/example-jukebox:jukebox?depth=2

     {
        "example-jukebox:jukebox" : {
          "library" : [null],
          "player" : [null]
        }
      }


GET /restconf/config/example-jukebox:jukebox?depth=3

     {
        "example-jukebox:jukebox" : {
          "library" : {
            "artist" : [null]
          },
          "player" : {
            "gap" : 0.5
          }
        }
      }


My question is since both containers and lists are defined as resources then why "list playlist" is not included in the result shown above ?

Will an error be returned when level is less then 1 ?


yes

Also I will appreciate if you can provide sample of what will be returned when depth is 1 and 3.


Thanks
~Upendra



Andy