Re: [netmod] Module tags

Andy Bierman <andy@yumaworks.com> Sat, 11 February 2017 20:05 UTC

Return-Path: <andy@yumaworks.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id CAA831293DA for <netmod@ietfa.amsl.com>; Sat, 11 Feb 2017 12:05:24 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] 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 XJB7QWS6jZuU for <netmod@ietfa.amsl.com>; Sat, 11 Feb 2017 12:05:23 -0800 (PST)
Received: from mail-wr0-x22e.google.com (mail-wr0-x22e.google.com [IPv6:2a00:1450:400c:c0c::22e]) (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 7F8E3128BA2 for <netmod@ietf.org>; Sat, 11 Feb 2017 12:05:22 -0800 (PST)
Received: by mail-wr0-x22e.google.com with SMTP id o16so128985540wra.1 for <netmod@ietf.org>; Sat, 11 Feb 2017 12:05:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=xoxI7Oquo/cbrmNNVacbKLR2YBk4994H4lSi+B0IBVI=; b=FDrReHX2SOIVVNpvYOLO7TVUBzRRpr3IS2egUj7c6JdmJwXRcUeEXuqR+J2u1ZsLqh lcYJO3UK9wmcd7bDlfctsy/nPyV8hVhKv/6v0HZooL3qmbvd5BjFxhgmBgj0xP81as91 WVcmE4zZHWHJc08M0Z88D5uBWaNiDkCSenacUzPEjsZmK6/YNsRMEAML7apLtErCiBIK BHEtNMG4GQ5LjAtuJsIcGo536SRjq+9SCYaEXsqBz/IpjNA6lIkAulmg85j/KA3/JFIu 9iQefhSlT4f+fqi+dS7dCQqKsfpy3jE8Otr42b+sAhzWJrIvgqneMceS9JXyspBlYJFD s+wA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xoxI7Oquo/cbrmNNVacbKLR2YBk4994H4lSi+B0IBVI=; b=slnBbyinl3q0doWk6BIk9BcdPWaI39fAEd6Bs+6P22JBy0A/Bah0W8mMCza/xjU3nK 2Qagv7gCyebGXnvo/Pe4gYnayTZMmffn+4bG0M+MQwISLtAvi878PiMy9+r8yKN/Auaf OB67vfdU812zowW9YK47lO9Kbb5jKJGpcR0wGOHHfvG3o5u7kHsM89yL/lJg/rQrFV9S ba8wT7+WB5ZNVg8JwZlSOxHFUpROdcXoEHsZoZg3QLZVNLNzqs3Nifk2nPLxaCdjSNa2 KIfIGaoTbb1e+yvw98Ks6nkzhf+iyK0ZDjx21kwebdThg9oGe8w3rZUPiCyvjvB1TJGR Cjpg==
X-Gm-Message-State: AMke39leYCXi/wNsw/IhAYd6pNFjKffOmxoIQuJtmz0QTxaPgD0TfxJgRzsg5ew9I74UMgnQt8Gg+iTNrU3wmA==
X-Received: by 10.223.139.137 with SMTP id o9mr14125622wra.88.1486843520917; Sat, 11 Feb 2017 12:05:20 -0800 (PST)
MIME-Version: 1.0
Received: by 10.223.131.67 with HTTP; Sat, 11 Feb 2017 12:05:20 -0800 (PST)
In-Reply-To: <20170211.173214.1818067131932995126.mbj@tail-f.com>
References: <20170208.231709.2214078600549867460.mbj@tail-f.com> <CABCOCHQJ+ef4C=TAfH9NK47mWgO0XOy1gg-cggigWq7Fqdfkgw@mail.gmail.com> <87d1eouby0.fsf@chopps.org> <20170211.173214.1818067131932995126.mbj@tail-f.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Sat, 11 Feb 2017 12:05:20 -0800
Message-ID: <CABCOCHTXwr3VbkfuKninn-OuRnAWWSNwHAF1eAsJSfR+O9Q0TQ@mail.gmail.com>
To: Martin Bjorklund <mbj@tail-f.com>
Content-Type: multipart/alternative; boundary="f403045e9ec4e6ce9a054846bbf2"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/wIrsPArjCX2A5hOrppFOxMqDOQI>
Cc: "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [netmod] Module tags
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 11 Feb 2017 20:05:24 -0000

On Sat, Feb 11, 2017 at 8:32 AM, Martin Bjorklund <mbj@tail-f.com> wrote:

> Christian Hopps <chopps@chopps.org> wrote:
> >
> > Andy Bierman <andy@yumaworks.com> writes:
> > > On Wed, Feb 8, 2017 at 2:17 PM, Martin Bjorklund <mbj@tail-f.com>
> wrote:
> > >      I meant that instead of using the grouping in every module, you
> could
> > >      have a separate structure in your module:
> > >
> > >       container module-tags {
> > >        list module {
> > >         key "name revision";
> > >         leaf name { ... }
> > >         leaf revisoin { ...}
> > >         leaf-list tag { ... }
> > >        }
> > >       }
> > >
> > >      This way you will handle configuration of tags for all modules,
> and
> > >      they don't have to have a special uses statement.
> > >
> > >
> > > +1.
> > >
> > > I read the draft, and I agree with you that the single container
> solution
> > > is best. Looks like configuration data to me, and no need for any
> special
> > > case editing models.
> >
> > We do get this with the yang library augmentation I believe. I hope
> > the yang library will be implemented by most servers. Do you think this
> > is not sufficient?
>
> The augmentation of yang-library is not sufficient b/c it is config
> false only.  That's why a separate config list is also needed.
>


So what would qualify as the corresponding configuration that would
warrant the creation of the /modules subtree?  How many different subtrees
of configuration do we need per module-name/revision pair?



>
> > Again the in module list allows for single xpath selection of a given
> > node for all modules that have a certain tag set. I found this rather
> > elegant, so that's why I've argued to keep it. I want to make sure that
> > people have considered this before we abandon it.
>
> Just to be clear, the use case is only for the case where several
> different modules implement the exact same structure, right?  Do you
> have any example where this is the case?  Or maybe I didn't understand
> the use case; if so, could you provide a more complete use case?
>
>
> > I'm OK with removing the add/delete RPCs as they do seem redundant.
> >
> > Is there a way to get the reset to default behavior? We do allow the
> > user to remove default set tags, so I think that's why Lou added that
> > RPC.
>
> I assume that reset to default would be to remove all configured tags
> from the config.  If so that is clearly supported.
>
>
> >
> > > Oddly, the draft relies on XPath filtering to retrieve modules with a
> certain tag.
> > > There is no <find-tags> operation.
> > > That is the 1 RPC operation that might be justified.
> > >
> > > e.g.:
> > >
> > >  rpc find-tags {
> > >   description "find all modules with the specified tag(s).";
> > >   input {
> > >    leaf-list tag { type string; }
> > >   }
> > >   output {
> > >    leaf-list module-name { type string; }
> > >   }
> > >  }
> >
> > This does seem useful, we can add it.
>
> But this is an XPath one-liner:
>
>   /modules-state/modules/name[../module-tag = 'foo']
>


XPath is optional to implement, but I agree this is not an important
feature.

I actually question the usability of per-module tags.
I do not think it will be granular enough for selection of yang-push
content (for example).

I suggested a YANG module called topic.yang last December:
https://www.ietf.org/mail-archive/web/netconf/current/msg12006.html

IMO the tagging needs to be on schema tree, not the module-set.
See the 'topic-maps' container below.  I made it config false
but it could be config true instead.

I also do not like relying on conventions instead of deterministic rules.
Use of identityref in topic.yang is fully distributed, but without requiring
any prefix strings to be assigned in advance and maintained.

(from attachment to msg above)
module topic {
  namespace "urn:test:topic";
  prefix top;

  import filter { prefix fil; }

  revision 2016-12-01;

  extension event-topic {
    argument id;
    description
      "An extension to map a schema node to a specific topic
       identifier. An rpc, notification, action, or data-def
       statement containing this external statement is mapped
       to the event-topic identity represented by the 'id'
       parameter.

       The syntax of the 'id' argument is the identityref
       data type.

       Example:

         container example-vpn {
           top:event-topic 'example:vpn-event';
           ...
         }
         container example-vpn-state {
           top:event-topic 'example:vpn-event';
           ...
         }
         notification example-vpn-event {
           top:event-topic 'example:vpn-event';
           ...
         }
      ";
  }

  identity topic-filter {
    base fil:filter-type;
    description
      "Filter type identifier for topic filters.";
  }

  identity topic-id {
    description
      "Base identity from which topic identifiers are derived.";
  }

  /********************************
     example topic subtree

    + topic-id
      |
      + service-topic
        |
        + routing-topic
          |
          + bgp-topic
          |
          + isis-topic

  **********************************/

  identity service-topic {
    base topic-id;
    description
      "Base identity from which service-related topic identifiers
        are derived.";
  }

  identity routing-topic {
    base service-topic;
    description
      "Base identity from which routing related topic identifiers
        are derived.";
  }

  identity bgp-topic {
    base routing-topic;
    description
      "Base identity from which BGP related topic identifiers
        are derived.";
  }

  identity isis-topic {
    base routing-topic;
    description
      "Base identity from which IS-IS related topic identifiers
        are derived.";
  }

  container topic-maps {
    config false;
    description
      "The set of topic-id to schema node mappings used by
       the server";

    list topic-map {
      key "id node";
      leaf id {
        type identityref {
          base topic-id;
        }
        description "The topic identifier for this mapping";
      }
      leaf node {
        type string; // really schema-node-identifier from 6535bis
        description "The schema node for this mapping";
      }
    }
  }

  augment "/fil:filters/fil:filter" {
    when "derived-from-or-self(fil:type, 'top:topic-filter')";

    description "Set of topic filter parameters";

    leaf-list topic-filter {
      type identityref {
        base topic-id;
      }
      description
        "Identifies a topic that is included in the
         subscription. Multiple instances represent a
         logical AND expression. Each topic-filter
         instance must evaluate to 'true' in order for
         the subscription to accept the event.

         A topic matches the filter if there is at least one
         topic-id associated with the event node or notification
         that is derived from or equal to the topic-filter value.";
    }
  }

}





>
>
>
> /martin
>


Andy