[netconf] get-data origin filters

Andy Bierman <andy@yumaworks.com> Sun, 06 October 2019 01:12 UTC

Return-Path: <andy@yumaworks.com>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4FCB012001E for <netconf@ietfa.amsl.com>; Sat, 5 Oct 2019 18:12:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.889
X-Spam-Level:
X-Spam-Status: No, score=-1.889 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.com
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 3NUsegt8Jq_d for <netconf@ietfa.amsl.com>; Sat, 5 Oct 2019 18:12:12 -0700 (PDT)
Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 43B7712000F for <netconf@ietf.org>; Sat, 5 Oct 2019 18:12:12 -0700 (PDT)
Received: by mail-lj1-x22c.google.com with SMTP id v24so10103881ljj.3 for <netconf@ietf.org>; Sat, 05 Oct 2019 18:12:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=OePn6ZdQMCK5QTfq6VzOcPK1HQX3NJ6BzL87EY3cXvo=; b=l32KOlUcL2rQR18LkL6wREb5I1mrnIabcPqiz1Cpk5ODdn+BfcG0C2F8Spq0DnT+Y6 Y596TWQQJzq4ApIailUm9Zbew/FxLMfb9bWYLJyDA/9psa7n4Fic3ThjH40G1zvdXB8J DpxHau5oyUYcSUm+NX4KenObKzBccIc3fHCqxPe/pQLLxPxHNboIcGeUOz+XqmPg4j+1 B/I1GYYTgAmbrYv6JE1+8xYZr7dOEhJpGwiIY3D4+S4fLosm8eK5bhChcyd0Fwwie+l4 8KVX3YWMaiBvSAxJx7EzG5TUQgqUrMn3as9CZ/W8AvAVfajFjAJ4gzNXKxey2dzaRpnl XpMQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=OePn6ZdQMCK5QTfq6VzOcPK1HQX3NJ6BzL87EY3cXvo=; b=spTpLPQgitRXdVeyKhG+5ajryl6wEneWoYaVCN/rJbDSzUqr27avhCK3fM0lpj+kqK FyAPO+BJ2C1Wc2SY5x9SSrzj7f8RxHQnT1tBiWk4XF8moz9m2V5h8RflrVQRLYsTIink 0YgiWMGH9dTe8WoUGrgZswCbxwqXcMV05a3Jxbvbuf1aIx9RyqUfr2K4A9fXsI99vMTO o99XbUPAwXBP5d7VA/RRx984QSzhtKtYQzdYepc+zMd7D0Wr8v7Avi6mJTvxOsmp3daz iTQQzwp370ijfmYcqTsTqYe/XT9/o4DVJkzr5AZIXXdTs9pe/HB4Op4F72+VQLAXvhKD HZzw==
X-Gm-Message-State: APjAAAXyd0QKqzlZu/nXxHB0MozPfD3j24/B/HhPll2shXiP1C7rKGGQ AKVXraUR2gMJ2MWN7D9Fn+dDT1greAflBewOW9kqkDeSalc=
X-Google-Smtp-Source: APXvYqzvZdspzlaxTcWWMDu5Dh/+0aPw1xl8pXPiPqGYKBtToaoVbIXMGcxjEqNiBolBDK//H1OR0xh5K6TG8VktJRY=
X-Received: by 2002:a2e:b607:: with SMTP id r7mr14105375ljn.100.1570324329873; Sat, 05 Oct 2019 18:12:09 -0700 (PDT)
MIME-Version: 1.0
From: Andy Bierman <andy@yumaworks.com>
Date: Sat, 05 Oct 2019 18:11:59 -0700
Message-ID: <CABCOCHSM0XO2tRDw44=jp3eaBxnhJciWOVvp8QJ+SgACjRZkEg@mail.gmail.com>
To: Netconf <netconf@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000dd5cbf0594339fb2"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/yHWoKVGHRhcZTv0lgfZMaHpxD8U>
Subject: [netconf] get-data origin filters
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETCONF WG list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/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: Sun, 06 Oct 2019 01:12:14 -0000

Hi,

I am trying to figure out how to use the origin-filter and
negated-origin-filter
in the <get-data> operation in RFC 8526.


          leaf-list origin-filter {
             type or:origin-ref;
             description
               "Filter based on the 'origin' annotation.  A
                configuration node matches the filter if its 'origin'
                annotation is derived from or equal to any of the given
                filter values.";
           }


These filters seem kind of worthless if implemented according to the text.
Consider a simple example where there is 1 learned leaf within a list:

module: address
  +--rw addresses
     +--rw address* [last-name first-name]
        +--rw last-name     string
        +--rw first-name    string
        +--rw street?       string
        +--rw city?         string
        +--rw zipcode?      string
        +--rw phone* [phone-type]
           +--rw phone-type      enumeration
           +--rw phone-number    string

Let's say the "zipcode" field is learned in <operational>
(e.g. ZIP code lookup expands missing or 5 digit zipcode to full 9 digit
zipcode).
So /addresses and /addresses/address have origin "intended".
Only the /addresses/address/zipcode leaf has origin "learned".

So how does origin-filter=learned find all the learned leafs?
What filters are required to return only the learned entries + ancestors +
ancestor-or-self keys?  Seems like this filter mechanism has to be used
to retrieve the exact leaf that might be learned, and the client
needs to know in advance all the possible nodes that might be learned.

Want to be able to retrieve an ancestor that is intended and still find the
learned entries

   get-data xpath-filter=/addresses/address origin-filtter=learned

The draft shows an example where both "intended" and "system" are given
as filters.  This will work but will include all the "intended" leafs as
well.
What if a "learned" node is within a "system" node within an "intended"
node?
Seems like the client needs to know a lot about the server implementation
details
in order to use the origin filters.


Andy