Re: [netmod] yang-data-ext issues

Martin Bjorklund <mbj@tail-f.com> Wed, 25 April 2018 06:57 UTC

Return-Path: <mbj@tail-f.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 40A8D127076 for <netmod@ietfa.amsl.com>; Tue, 24 Apr 2018 23:57:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 uIIABljQpC0B for <netmod@ietfa.amsl.com>; Tue, 24 Apr 2018 23:57:53 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 3C35612706D for <netmod@ietf.org>; Tue, 24 Apr 2018 23:57:53 -0700 (PDT)
Received: from localhost (h-80-27.A165.priv.bahnhof.se [212.85.80.27]) by mail.tail-f.com (Postfix) with ESMTPSA id 81F911AE02A7; Wed, 25 Apr 2018 08:57:51 +0200 (CEST)
Date: Wed, 25 Apr 2018 08:57:51 +0200
Message-Id: <20180425.085751.1552281751468645335.mbj@tail-f.com>
To: kwatsen@juniper.net
Cc: andy@yumaworks.com, netmod@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <403C417C-4546-48FA-AEA5-6ABA3D5A3845@juniper.net>
References: <20180423.220815.526647366558506966.mbj@tail-f.com> <CABCOCHTt3noQ5PcX57yGi5Cm7BxQA=GCB9KajrWS2WLnYM9THA@mail.gmail.com> <403C417C-4546-48FA-AEA5-6ABA3D5A3845@juniper.net>
X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="utf-8"
Content-Transfer-Encoding: base64
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/3vesZxf-x7VZMS0q5BSULmhKQtc>
Subject: Re: [netmod] yang-data-ext issues
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
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: Wed, 25 Apr 2018 06:57:55 -0000

Kent Watsen <kwatsen@juniper.net> wrote:
> 
> > People want to use YANG to define the schema for an XML or JSON
> > representation of a stand-alone document.
> 
> Agreed
> 
> 
> > The only data needed must be module + local-name.
> 
> Or maybe: module + local-name + context, where context is one of:
> 
>   - data nodes
>   - RPC/actions
>   - notifications
>   - standalone artifacts (files)

I don't think we should use yang-data to model notifications.
Presumably you meant error-info from rpc or action.

And my point it is that I think that we should make yang-data
flexible enoough in itself, and not constrain it to the one or two use
cases we know now.

> At least, it seems that these are different things.
> 
> [Note: RESTCONF places some of the context into the URL; two different
> data node resources can have identical module + local-name.]
> 
> It would be bad if two stand-alone artifacts had the same
> module+local-name (foo:bar).  However, it's okay to have a matching
> top-level data node called "foo:bar", since it is used in a different
> context.  Just like yang-data cannot be accessed as data via a
> protocol like NC or RC, so it is that traditionally-defined data nodes
> cannot be accessed as a stand-alone artifact (unless you’re a
> draft-author and need an instance document for an example).
> 
> 
> > Defining an extension that maps error-info data for a specific RPC
> > might be
> > something worth standardizing.  It should not be done with yang-data,
> > but rather a different extension just for this purpose.
> 
> Martin wrote before:
> 
>             (maybe in the future we could even have a YANG extension statement
>             to
>             formalize the description:
> 
>                rpc my-first-rpc {
>                  ...
>                  opx:error-info-structure my-first-rpc-error-info;
>                }
> 
>             but this is not point now.)
> 
> I imagined that he was hoping to limit what's needed to get
> draft-ietf-netconf-notification-messages out the door now, but I think
> another I-D should be proposed to augment the 'rpc' and 'action'
> statements with an anydata called "error-info-structure" so the YANG
> would be more like this:
> 
>                rpc my-first-rpc {
>                  ...
>                  opx:error-info-structure my-first-rpc-error-info {
>                      …
>                    }
>                }

No I was thinking along the lines of:

  ydx:yang-data my-first-rpc-error-info {
    ...
  }

  rpc my-first-rpc {
    ...
    opx:error-info-structure my-first-rpc-error-info;
  }

I.e., use yang-data to define a structure, and use another statement
to tie them together.

If we define special statements with inline structures, we probably
also need special augment statements; with your example:


  rpc my-first-rpc {
    ...
    opx:error-info-structure my-first-rpc-error-info {
      ...
    }
  }


  opx:augment-error-info-structure '/m:my-first-rpc'
                                 + '/m:my-first-rpc-error-info {
    ...
  }
  

/martin




> That is, to your point, with no reference to a yang-data data
> structure.
> 
> 
> > Andy
> 
> Kent // contributor
>