Re: [Netconf] RESTCONF depth parameter

Andy Bierman <andy@yumaworks.com> Fri, 13 December 2013 17:28 UTC

Return-Path: <andy@yumaworks.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 CD88C1AE340 for <netconf@ietfa.amsl.com>; Fri, 13 Dec 2013 09:28:24 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.978
X-Spam-Level:
X-Spam-Status: No, score=-1.978 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] 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 jUJ8quMOgRky for <netconf@ietfa.amsl.com>; Fri, 13 Dec 2013 09:28:22 -0800 (PST)
Received: from mail-qe0-f44.google.com (mail-qe0-f44.google.com [209.85.128.44]) by ietfa.amsl.com (Postfix) with ESMTP id 6BA501AE126 for <netconf@ietf.org>; Fri, 13 Dec 2013 09:28:22 -0800 (PST)
Received: by mail-qe0-f44.google.com with SMTP id nd7so1836103qeb.17 for <netconf@ietf.org>; Fri, 13 Dec 2013 09:28:16 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=zjT4n+OHIf93ED1A2izQwjvi7hAJjVZsgkIdCf51Z7A=; b=ZCnKRHhteqbgvz8NcfveaTD6M4spPgkPH3aS5B1uLfcdbiaOpQ58JcP/wli+q0o700 6YKcm1NajX1NCKnYw1afQ78j/MhPEWdc0VglagbzL+7FL7DFgrxRfV8s+5Fads6IRlbh To6Eyo7Lij+D9zf2OGFaXWrfWWEm6o1j+2o7O6UHDRZOo/DC5FznqpTVL0JGEgLYQPMz Hq8Wf3kvl4/XLvFHaH8e8mowlZ8+U8s7IIOSmYcmeLD+elnqfEJ5t1wJd96bZ0G67sQQ LUo+FEpFpiGPuX9uwojsP2D8UPNVoRcDm8e26xyjwjf6i51KpgARMdt/gmfcyR9TkOHj Sz7A==
X-Gm-Message-State: ALoCoQnqeB+aW31sOxJMs74zCzIoCCsQpExaL63FAYnjf76d/DcS1ICl8KfqGfwO72qVSTWAhuhI
MIME-Version: 1.0
X-Received: by 10.49.130.135 with SMTP id oe7mr6572461qeb.41.1386955695937; Fri, 13 Dec 2013 09:28:15 -0800 (PST)
Received: by 10.140.48.75 with HTTP; Fri, 13 Dec 2013 09:28:15 -0800 (PST)
In-Reply-To: <CECF7653.37003%uprajput@cisco.com>
References: <CECF7653.37003%uprajput@cisco.com>
Date: Fri, 13 Dec 2013 09:28:15 -0800
Message-ID: <CABCOCHT4+pXDYUZWPUtvcZ+O0KrXQhFuYc6esZdAhdwfgPmUkA@mail.gmail.com>
From: Andy Bierman <andy@yumaworks.com>
To: "Upendra Rajput (uprajput)" <uprajput@cisco.com>
Content-Type: multipart/alternative; boundary="047d7bd6bc44936f6c04ed6dc9a0"
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:28:25 -0000

On Thu, Dec 12, 2013 at 2:18 PM, Upendra Rajput (uprajput) <
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