Re: [netmod] References to the "tags" typedef

"Rob Wilton (rwilton)" <rwilton@cisco.com> Fri, 04 October 2019 10:05 UTC

Return-Path: <rwilton@cisco.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 7B6091208C3 for <netmod@ietfa.amsl.com>; Fri, 4 Oct 2019 03:05:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.501
X-Spam-Level:
X-Spam-Status: No, score=-14.501 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.com header.b=O5CDpCDE; dkim=pass (1024-bit key) header.d=cisco.onmicrosoft.com header.b=h2rKVrcb
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 5fKUY3mW60Sw for <netmod@ietfa.amsl.com>; Fri, 4 Oct 2019 03:05:01 -0700 (PDT)
Received: from alln-iport-6.cisco.com (alln-iport-6.cisco.com [173.37.142.93]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 158551208BB for <netmod@ietf.org>; Fri, 4 Oct 2019 03:05:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4989; q=dns/txt; s=iport; t=1570183501; x=1571393101; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=5UZzl1e5gBq09AbFtlC1e9/LCjZMvJEuN9zzUBLXuaM=; b=O5CDpCDEVXDpCJa1h9WLu4eaL1NoalVheN2jAHGfH9xmzQkvFaY5+0Os oqebrkOVeCrE11tgA0nUd6cOxrtutA0Kgz2VxvvSJ2ftGFhnQ28SP9M6T rl9JY8J3yxQ5LWWq7YxG9Dd1Oc78Ijgo12YnVUrmgUcjeSdeXdMuyc63s A=;
IronPort-PHdr: 9a23:Ad7NfRDipIwGc9zPzm3lUyQJPHJ1sqjoPgMT9pssgq5PdaLm5Zn5IUjD/qs13kTRU9Dd7PRJw6rNvqbsVHZIwK7JsWtKMfkuHwQAld1QmgUhBMCfDkiuNuHrazA9GuxJVURu+DewNk0GUMs=
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0AOAABkGJdd/5JdJa1iAxkBAQEBAQEBAQEBAQEMAQEBAQEBgVUCAQEBAQELAYFKUANtViAECyoKh18DikiCXIlojhGBLoEkA1QJAQEBDAEBJQgCAQGEQAKCRyM2Bw4CAwkBAQQBAQECAQUEbYUtDIVLAQEBAQMSLgEBNwELAgICAQgQAQQBAQEuGwYRHQgBAQQBDQUIEweDAYFqAx0BAgyjGQKBOIhhgieCfQEBBYFIQYMBDQuCFwMGBYEvAYwNGIFAP4FXgkw+ghpHAgIBARaBSQUaFw+CeIImjHOIUWCWV0EKgiOHCIoJhCKZQI4riCCCDY8EAgQCBAUCDgEBBYFZBC6BWHAVgydQEBSBT4NzM4RhhT90gSmPIgGBIgEB
X-IronPort-AV: E=Sophos;i="5.67,256,1566864000"; d="scan'208";a="350668064"
Received: from rcdn-core-10.cisco.com ([173.37.93.146]) by alln-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 04 Oct 2019 10:05:00 +0000
Received: from XCH-RCD-002.cisco.com (xch-rcd-002.cisco.com [173.37.102.12]) by rcdn-core-10.cisco.com (8.15.2/8.15.2) with ESMTPS id x94A509b017439 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Fri, 4 Oct 2019 10:05:00 GMT
Received: from xhs-aln-002.cisco.com (173.37.135.119) by XCH-RCD-002.cisco.com (173.37.102.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 4 Oct 2019 05:04:59 -0500
Received: from xhs-rtp-001.cisco.com (64.101.210.228) by xhs-aln-002.cisco.com (173.37.135.119) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 4 Oct 2019 05:04:58 -0500
Received: from NAM04-SN1-obe.outbound.protection.outlook.com (64.101.32.56) by xhs-rtp-001.cisco.com (64.101.210.228) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 4 Oct 2019 06:04:57 -0400
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CWfN2naX9QRh39UxWtN+V5IxOLLqT2OvMDfPLdOk/u011aK9BHPa4KdUQR/SQf33TDUZxg9iHVQxljP1QoKN/vPFvGv0tpeqnUGLagSQRWroML75hwwmjRDghJqxw1pcxWfZYOPOKeV5NqM7/9NNuVSdMhchAL3OvIOtqW45jxr/MEyTd2KrIu8rHNYvvaS9I8NwfDB8G6Si81fosycXDqTbKvwrN11II9z3rRxyanM6x71saYKQoyKheq20S/5ej1nTjAPh7yhA2iNZI1QRkLEPuwsLeXRLnvZZ4uDT8VpK6Jf3yNAdtf6ElvoapBXMo1hSo6geVlNluubFRZFhww==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z5FZFhhjFLmY/EGaUrcRA5Q7h+jqEtSAIbVgXWALpC4=; b=htFPOdujlbRR8ObnKovcfXyjw9oqd+15dX8hG2QOxG/nL7I9o1airqopb0auLPK0YistnvKePG6DjtufUtfloy9y2v2vBkEnXaqqohjh4pXPzZw4iiyUw3U0pKFY6oRphcdiEREKGa3b8LQlQzyoFWFaoSU0Ci8sOHsteaMDe/+Yl2dK8oi09znx53prmffoFZQdahmvwv6Cy/gH0o2mTi/ELe5rAn029W/Le+n3o/vPzr7qIcr3mTZV/mZ8aQubhsvt4FpNJLE6cF+bdLDc58LpZs61532scwftlzUpme+S8h4Ea8pR8rUfWatrfiV1oREJrM/GmsmiDwVtm3Bjbg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cisco.com; dmarc=pass action=none header.from=cisco.com; dkim=pass header.d=cisco.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.onmicrosoft.com; s=selector2-cisco-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z5FZFhhjFLmY/EGaUrcRA5Q7h+jqEtSAIbVgXWALpC4=; b=h2rKVrcb87wr1Dl2UC0OYfZ/XR3O1CxFxY4kmZ4DJ+2lHbMdzROHMcbR5chMDwYjwl+J+GzuNBf6JLkGtHcYW+hHbiuBu8g0WsusgAFxc/iOn7tZIds5L6815knxE30m1MVWwcyqmgXL0YOTO8BaAu56bCss5SICXlGaXQBXpWA=
Received: from MN2PR11MB4366.namprd11.prod.outlook.com (52.135.38.209) by MN2PR11MB4416.namprd11.prod.outlook.com (52.135.36.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.20; Fri, 4 Oct 2019 10:04:57 +0000
Received: from MN2PR11MB4366.namprd11.prod.outlook.com ([fe80::cca:41bd:b0bb:c549]) by MN2PR11MB4366.namprd11.prod.outlook.com ([fe80::cca:41bd:b0bb:c549%2]) with mapi id 15.20.2305.023; Fri, 4 Oct 2019 10:04:57 +0000
From: "Rob Wilton (rwilton)" <rwilton@cisco.com>
To: "Schönwälder, Jürgen" <J.Schoenwaelder@jacobs-university.de>, Balázs Lengyel <balazs.lengyel@ericsson.com>
CC: Christian Hopps <chopps@chopps.org>, Mahesh Jethanandani <mjethanandani@gmail.com>, "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] References to the "tags" typedef
Thread-Index: AdV5zjrR87+ocsTFRHuyDJWUSmakTQASvOqAAAKhPIAAGXctcAADYFqAAAA8Z0A=
Date: Fri, 04 Oct 2019 10:04:56 +0000
Message-ID: <MN2PR11MB4366FEF4B3817E3605D29BBDB59E0@MN2PR11MB4366.namprd11.prod.outlook.com>
References: <MN2PR11MB4366172C3044D238A5BE7C30B59F0@MN2PR11MB4366.namprd11.prod.outlook.com> <824BC817-DAFD-41CE-88B7-D24A32F22E19@gmail.com> <1B318BB7-9214-45DC-94AC-E164198CF97D@chopps.org> <MN2PR11MB436662777568D8D4746FCED0B59E0@MN2PR11MB4366.namprd11.prod.outlook.com> <20191004093533.cvxscnkgr5y4gh2p@anna.jacobs.jacobs-university.de>
In-Reply-To: <20191004093533.cvxscnkgr5y4gh2p@anna.jacobs.jacobs-university.de>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=rwilton@cisco.com;
x-originating-ip: [173.38.220.46]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 8a4a603e-82f1-49bf-ad84-08d748b24f7b
x-ms-traffictypediagnostic: MN2PR11MB4416:
x-ms-exchange-purlcount: 2
x-microsoft-antispam-prvs: <MN2PR11MB44166AC189A2A85A77D87A99B59E0@MN2PR11MB4416.namprd11.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:9508;
x-forefront-prvs: 018093A9B5
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(346002)(366004)(396003)(376002)(39860400002)(189003)(199004)(51444003)(13464003)(43544003)(25786009)(229853002)(966005)(14454004)(6246003)(86362001)(4326008)(71200400001)(71190400001)(6436002)(476003)(486006)(66476007)(66556008)(11346002)(478600001)(66066001)(256004)(55016002)(66946007)(66446008)(446003)(9686003)(6306002)(64756008)(76116006)(76176011)(99286004)(33656002)(52536014)(102836004)(6116002)(186003)(3846002)(5660300002)(54906003)(316002)(110136005)(26005)(8676002)(8936002)(74316002)(81166006)(7736002)(305945005)(81156014)(6506007)(2906002)(53546011)(7696005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4416; H:MN2PR11MB4366.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: cisco.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: omT+YUOE0K/lIdaO5xnIQQ/q/sfDfuZCMuTT8pBxKnOYDF8LWkQMYHZdMLoj3lzYXfmz88ph4gLGGshjzHGNRV+w0CL9o/ZZbDbDIMGKblFyMYZItUQG1/n1LWXcPeNGzQYzFy84CP6QcW3Opr5De/BYxVnVG/z/Urer+x/UyOVFeplyrOp9KV6JqWaf0DNAWLKA5DtrVyqZ1gLMJB13y/NPha50Sl2CdKEbu4fNIXnbtpJsy+EHzOe1twk1RfXxK0lqDDux0EwJvCgcUK4R8153ZcTZ58ZvO9tJmNB/JaMVbPCalnwTMvX3v46buBQAhSW7hen9XaBNhe7Up2UndH+EThalrPrE+dX6M1ai+rTqjLRWSvG2WuOmUukwkfSAIX7LS20DznKhkUMZQhNHEvuYHzKBgAMW60poLOx6zVjLqp6R1sAiAXSpjL9GCwb+67f76zfSFLBXhoExKHq0SA==
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 8a4a603e-82f1-49bf-ad84-08d748b24f7b
X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Oct 2019 10:04:56.8480 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5ae1af62-9505-4097-a69a-c1553ef7840e
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: c/Wy+ZzdZVSd4H+ar1aZlHEYfBRbrjGxz+/Njiwunkq+bkib9VuO1lUXhzhPTdFBnX6CuzAvM8zEMbXcTyxSHg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4416
X-OriginatorOrg: cisco.com
X-Outbound-SMTP-Client: 173.37.102.12, xch-rcd-002.cisco.com
X-Outbound-Node: rcdn-core-10.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/2dohyt5aU5HTJWuaV0nPzsW30zo>
Subject: Re: [netmod] References to the "tags" typedef
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
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: Fri, 04 Oct 2019 10:05:04 -0000

[Copying Balazs because this discussion is moving to instance-data document schema definitions.]

> -----Original Message-----
> From: Schönwälder, Jürgen <J.Schoenwaelder@jacobs-university.de>
> Sent: 04 October 2019 10:36
> To: Rob Wilton (rwilton) <rwilton@cisco.com>
> Cc: Christian Hopps <chopps@chopps.org>; Mahesh Jethanandani
> <mjethanandani@gmail.com>; netmod@ietf.org
> Subject: Re: [netmod] References to the "tags" typedef
> 
> On Fri, Oct 04, 2019 at 08:17:33AM +0000, Rob Wilton (rwilton) wrote:
> >
> > To use the "tags:tag" typedef, ietf-yang-package had an import on "ietf-
> module-tags" which both defines a tags type and also a "module-tags"
> container as well.  I want the typedef, but not the container, because I
> don't want the schema for the package file to be:
> >       +--ro yang-package  <-- I do want this
> >       |  +--ro name                      yang:yang-identifier
> >       |  ...
> >       +--ro module-tags   <--  I don't want this
> >          +- ...
> >
> 
> Isn't import-only-module in YANG library take care of this?
[RW] 
Yes, that is one solution.

The instance data document (probably in JSON, but I've given an XML snippet below) could use the "inline-spec" for specifying the schema.

But this means that every package instance file, needs to have some boilerplate like this before the actual package definition.:

<?xml version="1.0" encoding="UTF-8"?>
<instance-data-set xmlns=
    "urn:ietf:params:xml:ns:yang:ietf-yang-instance-data">
  <name>some-yang-package</name>
  <inline-spec>ietf-yang-library@2019-01-04.yang</inline-spec>
  <inline-content-schema>
    <yang-library xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library">
      <module-set>
        <name>all</name>
        <module>
          <name>ietf-yang-package</name>
          <revision>2019-09-11</revision>
        </module>
        <import-only-module>
          <name>ietf-yang-package-types</name>
          <revision>xxxx-xx-xx</revision>
        </module>
        <import-only-module>
          <name>ietf-module-tags</name>
          <revision>xxxx-xx-xx</revision>
        </module>
        <import-only-module>
          <name>ietf-yang-revisions</name>
          <revision>xxxx-xx-xx</revision>
        </module>
        <module>
          <name>ietf-yang-structure-ext</name>
          <revision>xxxx-xx-xx</revision>
        </module>
        <module>
          <name>ietf-yang-types</name>
          <revision>xxxx-xx-xx</revision>
        </module>
        <module>
          <name>ietf-yang-library</name>
          <revision>xxxx-xx-xx</revision>
        </module>
        <module>
          <name>ietf-inet-types</name>
          <revision>xxxx-xx-xx</revision>
        </module>
      </module-set>
    </yang-library>
  </inline-content-schema>
  <content-data>
     // Actual package information goes here.
  </content-data>
</instance-data-set>

https://datatracker.ietf.org/doc/draft-ietf-netmod-yang-instance-file-format/?include_text=1

The YANG instance data draft provides some other choices:
(1) (External Method) Don't define the schema, just assume that clients know what it will be for YANG packages.  E.g. it would be specified in the YANG packages RFC.
(2) (URI method) Put the schema in a separate instance data document and reference that.  This could be defined in the YANG packages RFC, but it might open the question of what URI can you use to retrieve it.
(3) Simplified inline schema.

It is the third one that I would ideally like to use.

Here, the package data would like something like this (sorry, in JSON this time):

  "ietf-yang-instance-data:instance-data-set": {
    "name": "example-ietf-network-device-pkg",
    "module": [ "ietf-yang-package@2019-09-11.yang" ],
    "description": "YANG package definition",
    "content-data": {
      "ietf-yang-package:yang-package": {
        "name": "example-ietf-network-device-pkg",
        // Actual package information goes here.
      }
    }
  }

Here, the schema is defined by the "module" line "ietf-yang-package@2019-09-11.yang".  I think that there are some details to work out, but I think that the import dependencies for "ietf-yang-package.yang" could be automatically resolved as import-only YANG modules.  I have also tried to minimize the required imports (e.g. don't import YANG library, perhaps don't import from module-tags).

In terms of typedefs, are two typedefs equivalent if they have exactly the same definition in two different modules?  Or does the fact that they are named given them a slightly different meaning?

Thanks,
Rob


> 
> /js
> 
> --
> Juergen Schoenwaelder           Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
> Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>