Re: [Netconf] RESTCONF depth parameter

"Upendra Rajput (uprajput)" <uprajput@cisco.com> Fri, 13 December 2013 18:28 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 C75251AE142 for <netconf@ietfa.amsl.com>; Fri, 13 Dec 2013 10:28:37 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.501
X-Spam-Level:
X-Spam-Status: No, score=-9.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, 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 NtW5ye6DwkRX for <netconf@ietfa.amsl.com>; Fri, 13 Dec 2013 10:28:35 -0800 (PST)
Received: from alln-iport-6.cisco.com (alln-iport-6.cisco.com [173.37.142.93]) by ietfa.amsl.com (Postfix) with ESMTP id 323441ADFEF for <netconf@ietf.org>; Fri, 13 Dec 2013 10:28:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=13719; q=dns/txt; s=iport; t=1386959309; x=1388168909; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=tfwYhzQQRERu3TjX+fFNYMiWPtUcCQLW8FeuL3Lttj4=; b=SVIRrb5+hX4WI5tiho26mlfKwmxkfu3py8QAWVn+GZZRHWspnkO9g09h PlY+AY4klqAeqL4W009et7s5jBqRd36bv1USddCBGRmuYL9wtCFtP2MIQ XKgwstXrxSXAVySYCyiGsXZNNDJDydSfaXIH8WpOd7q+vFDFztKIQMiPW o=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AhQFAH1Qq1KtJXG9/2dsb2JhbABZgkZEgQ24XYElFnSCJQEBAQR5EAIBCBEDAQIoBzIUCQgCBA4FiATLKhePBBEGAYQ2BJgWkhSDKoIq
X-IronPort-AV: E=Sophos;i="4.95,480,1384300800"; d="scan'208,217";a="6630665"
Received: from rcdn-core2-2.cisco.com ([173.37.113.189]) by alln-iport-6.cisco.com with ESMTP; 13 Dec 2013 18:28:28 +0000
Received: from xhc-aln-x06.cisco.com (xhc-aln-x06.cisco.com [173.36.12.80]) by rcdn-core2-2.cisco.com (8.14.5/8.14.5) with ESMTP id rBDISSOO014324 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Fri, 13 Dec 2013 18:28:28 GMT
Received: from xmb-rcd-x12.cisco.com ([169.254.2.86]) by xhc-aln-x06.cisco.com ([173.36.12.80]) with mapi id 14.03.0123.003; Fri, 13 Dec 2013 12:28:27 -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/aQCAAIrLAP//gISA
Date: Fri, 13 Dec 2013 18:28:26 +0000
Message-ID: <CED091A3.3710C%uprajput@cisco.com>
References: <CECF7653.37003%uprajput@cisco.com> <CABCOCHT4+pXDYUZWPUtvcZ+O0KrXQhFuYc6esZdAhdwfgPmUkA@mail.gmail.com> <CED085F2.370E2%uprajput@cisco.com> <CABCOCHTrLRuV6zOiOimT4iDt_AOZBfhWckU_vTaGjuxi7UUkRw@mail.gmail.com>
In-Reply-To: <CABCOCHTrLRuV6zOiOimT4iDt_AOZBfhWckU_vTaGjuxi7UUkRw@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_CED091A33710Cuprajputciscocom_"
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 18:28:38 -0000

Thank you Andy.

From: Andy Bierman <andy@yumaworks.com<mailto:andy@yumaworks.com>>
Date: Friday, December 13, 2013 10:04 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 Fri, Dec 13, 2013 at 9:47 AM, Upendra Rajput (uprajput) <uprajput@cisco.com<mailto:uprajput@cisco.com>> wrote:
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]
        }
      }


Not based on the starting point (no depth parameter given).
I will add 1 or 2 playlists in the draft example.


Thanks
~Upendra



Andy



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