Re: [netmod] structured metadata for schema nodes using YANG extensions
"Jason Sterne (Nokia)" <jason.sterne@nokia.com> Thu, 14 March 2024 22:06 UTC
Return-Path: <jason.sterne@nokia.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 64F72C14F6A4 for <netmod@ietfa.amsl.com>; Thu, 14 Mar 2024 15:06:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.107
X-Spam-Level:
X-Spam-Status: No, score=-7.107 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=nokia.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kSVJPpQAdBtJ for <netmod@ietfa.amsl.com>; Thu, 14 Mar 2024 15:06:44 -0700 (PDT)
Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2086.outbound.protection.outlook.com [40.107.94.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1A008C14F6A2 for <netmod@ietf.org>; Thu, 14 Mar 2024 15:06:43 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XeqeknyfyJ/hvM5Np64oTzEKTS2HQou3+35uzbZcuEfuu3yX0Xw+Rr1BiiN7IwFRNhA7FV7Wn8x7Hn48y/Cw+T37rZ1afHgHBIOnskfyI6A8TPEGlcflKCoScIKDokv+Hvju6yRaUdTPHR0NlEnRbMvuguuqi2uE6Dh+9ljmdUebG26s/bNJl6D1f8HD9sZpN7Vll39Dhv2gMpCdnXep3s6WMpXTN7PGj+h+eI9hP1njWdU0voyFtdpIEWppy7lqnZOJrHPUrKJnXfVo9sxE+yn0t1+xO86TZtdDLahsxFU2qMmkyVfH9V1b8TOuWwNFq0ixt9h0DKBazqzLT0No/w==
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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=z0fs/wRl1PJvbOvZVf/Qvui9p1fK/fur6aiLdjqGags=; b=MSwDu5ccUfR4PopGxdwHJPMpsdScMjDricgaOp2qYzkggXYHbW2gY87+kAuWgFWFRQMB+EwsducXVTXDGiqI9LEEbg+DIrUI11A5rSlTZ6bAp88Ce/7SM+QVu3pNtRDO90m8sqMOT6Z2R5kD+wrh6Y4RQfBJydL0w64jsBSAQocRvLd82G2I8wqg0N2/md+f0atm1x3X3lXOamewCiszwOPeL0OkFjuIJQ4atW+EbS8buaUSuijLRhnM1mkFkE98JG+qYL2RSjMem1BRJ4aR19E/GfqQfa6CEFWsdS8e0E92FRfyQrzNv2h9ZNgo6JOJ8q5VVv9oVzlFyj2WwMTF3g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nokia.com; dmarc=pass action=none header.from=nokia.com; dkim=pass header.d=nokia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z0fs/wRl1PJvbOvZVf/Qvui9p1fK/fur6aiLdjqGags=; b=LJNXcW56nAqAWrdlqEGzBkzHgcVPrIOV481rPNlKuhj8fYB1kbGbBL5nEP0fIKEmM5ASOo+WqGfA+J2vAhxVlt2NoMk6f91t+EFpI3nKR1tIDhY6mAOuUD3goVSwNCNZUBGnmQefZII60fGU8MNU1vSIU7dpujqSa843gOPKHsyGZ/zEMeQhBVFr4jiTrxBTmaK0GIPH0BoQh1iMqs8rjutOD9WgamFG5oe2UelK1h1zRKmr8KDONsUZkMRWg5Y8Lv1o4zn/pihxbSpf6ZUYWZ9mPw4ipi1et7Nqbq7H+xtWoTxd4IoReuyGUYuX0YJuCVtnHaQWpjrh5jhFP+xV0Q==
Received: from SN6PR08MB4847.namprd08.prod.outlook.com (2603:10b6:805:6b::12) by DM4PR08MB8222.namprd08.prod.outlook.com (2603:10b6:8:45::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.18; Thu, 14 Mar 2024 22:06:40 +0000
Received: from SN6PR08MB4847.namprd08.prod.outlook.com ([fe80::3b22:f1b2:178c:f6c8]) by SN6PR08MB4847.namprd08.prod.outlook.com ([fe80::3b22:f1b2:178c:f6c8%7]) with mapi id 15.20.7386.017; Thu, 14 Mar 2024 22:06:40 +0000
From: "Jason Sterne (Nokia)" <jason.sterne@nokia.com>
To: Martin Björklund <mbj+ietf@4668.se>
CC: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] structured metadata for schema nodes using YANG extensions
Thread-Index: Adp0zIh3sX0rFCQbQnysoMLgD9z3NwAWV8YAABu6KFAAFR4ngAAcpIcw
Date: Thu, 14 Mar 2024 22:06:40 +0000
Message-ID: <SN6PR08MB4847AFD24C9E98BDF1A8D5A39B292@SN6PR08MB4847.namprd08.prod.outlook.com>
References: <SN6PR08MB4847A4E43785C38E77331CC89B2B2@SN6PR08MB4847.namprd08.prod.outlook.com> <20240313.100742.1986844484799977524.id@4668.se> <SN6PR08MB48479709AB9B95C7594132579B2A2@SN6PR08MB4847.namprd08.prod.outlook.com> <20240314.092617.1402769857121666317.id@4668.se>
In-Reply-To: <20240314.092617.1402769857121666317.id@4668.se>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nokia.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SN6PR08MB4847:EE_|DM4PR08MB8222:EE_
x-ms-office365-filtering-correlation-id: f427a384-3d6f-497a-b814-08dc447306aa
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: ZYhqFNk6hJ+cTnYNQeJ3+e950QbZagq+V6btxqIKK/4doZtyuNSAgTqVAT3kWilcfCMb9qWRnu8nRFKOEOCWCoLyLixjr8oN11yvKoFnRvDgtRO8jwbwDa1650PbGhRSslwUsAuSas1pZWoDb38kPSN24m2t9qqXa49sV3uQgdPtVooS+joXjvtg57DpOGoswpYLspCzraLq6f0ZztBqN0KRGfmcJiCvagVI6owiGzZlt8z2ckiyRRg0alY1kVXnUoXEkSMKROpZQ6/erfnxQKQxfWcCT7ge0EOGRzpILD6gAblTYbcP6MBzP9L7gaXwIsxKrydqgaT7zFusF+v4KzO3ghPOilAJoT6tn1FWqNGxry722adeP062PtHr+cskegBJ3iKimnWZM3EpWLcO4dEyrE7job4NZbqV6cEe+u95Pr2zzVeiGgwGvGbwPOBcjLCMPms3pQHIFfYKDYjL1SwGwh/7SB/lhqOf1qkzOm+jAz9iQoMAV6deGqdZaey+YLnHevhmj/Kfr7Y+55syFEr8Tq0cTXClR6eGg7lbiZUIEyha+39c9I5SdcT2ycwPp4+D/BeebfOde7bH63cNooBXX4HqP9KqBgf2N0800fiVR/cONxAl1Vj3R/3SlmhMetxIWCTY2Xc6CMp9FxqeBpFpq5QRE+l0VpnfsnyUo0XkPlItLW1IFXrKjDGgZJnY
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR08MB4847.namprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(1800799015)(38070700009); DIR:OUT; SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: RdZPxCJKrHz14spzca4Utq0BARfyhc9h8LkfDltYUdt5b32I32/owGdNt3AFfgxvjkfkS5/QwsU4UVoFJ8fCV09/wkm686+d0a4w8gg7t35j3JSCYKFWyJL8Cn4ZLePZmTrokUYct79ZuUted3ABClBS2cGb/9RsBE/9xFmjs2Rh96m9jHuhNnpAcrTm5GlmXvaQlByi8Gwg1a3rRZZVNv0gNMCS37ElaObmVllL86IKODeQxXoggYjnk7r9r6b+RYBkJqDxYYmiM/t3o9NDqB9lVyUndt57J4sD0NrC8AHcJi6qLTNYaM5sITayGB8SCliH0+a/sHpq4Ba+zGRXqUSjPH3wgajr2WhsK3NDrPBktGkcMABz1p5asbeCRMQqbjsHSudcTDAY8GZFbpVtceBkzd1x69KGPay6rrrjieN1+BwEZXcy43Y6L9H/Mwa09nKW+Fmjc+OI69qa6FUsvhKcT29qNvzchNmO7w/Tp3SHyoLIuuaeziDgLdnHzV82kGhZjfJfc4mP/12bjLHiaeuP17Z5Si0IOtfms8ovepBd14dxcxQshpbmsrpCXaJIec58+9yI+YDbgSh4ZaKjQJmGXjmJ2QtEeDFbatqVCCTuYz/7TEJ0Z/LeCnYdoZZbcM/osaQLQH12c7z4961SBzVPZKY+pi2OI1GoaagIxZcrQ/NJwmQmrG4T/aEYlxnf7Yfa12rrdYcvPsxYNYmu6vSn6t4WjHrqZDs3MW0nQvCwl5sC4qUTCyWalANRG/kHPqyD5Lco1lv8I20IwP3I+iwVt4Lq+WPR/TDoWZ+XGRU89eHg4ZS/OBnAped+7yhMHnI4WbJ8bmMhntPLaZlMU9AT3c+r2vQe0Pl0Q3jsuDtrPKZFc6hrmn8zlPInc3ezky8K8BTL3BSc+xiFGv6oLsCLh1UJs7wf11C1Ba2rqj7eVPCdhpqkw4YKUjyr1UCBiVRdqiqVGaj8IaeBnQR4NZt08WTcuqoDEENG4BygirBsd5jHUEWyS90SK2vdMgxvC7eiU1/7QKUNUHOeMTVU2FDucusRBoipUVJf0reDKLas4ktq5i4vA2gUTLvZIXS5IE5QhYz0B4lBqEfQ1HRFEbsWh0AOmqIiYL/xxeIEX8LQZotzJLPN9m/dIiYxWHhQ/ZcSafg30qeIQzjW/Lo0XSXQNHuUA3cgCTGJXXkLrvrTucoqlSwWDbLFtLzAFJVcHrcqDN7w114R2JzVOkO3vM2m4D2SyzPDnFLPJ7P+YlLtIqlUsEnRpoqs632yXEj9TaYFGhR9KRM5Si0wT6THpcxMRFw8H/86aV1I4/IIytNCoMbD7iVMt7qjA/oRAF/Z1LHTaX+Q1Yba4HX/EhcEki8hQYXFwxQ9r/WD7Tl0VL6rNt5QhBivyWYWY5rWMs1LUquUQ6LJc2iwMVptaDvPHPUhx1hu2rcl9myumTuTLfaOmwVsquRjZ/KiGgxLErhQE4yD+J9dA3+ADtmZm6TTCjunrw2JuemEQdWKQpWz+KCje/Yy3LSjoQdAyKCWmrKM4fUVNkpCO3RTmK46IDBjTb7RjHuLqeM4BStrUSJHz2a2alH0eXblbCj/hzol9aHm
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: nokia.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SN6PR08MB4847.namprd08.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f427a384-3d6f-497a-b814-08dc447306aa
X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Mar 2024 22:06:40.3250 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: FEjmZdS68KrEP3u8zebH5c9L4QNrwofWFBLyWAaqQulmG0kPmSuMJ20+UzLlejlhu598jeh0qgWasrtAQwnqpQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR08MB8222
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/I-Aa3xsSo2SH9SCMgywZcKf2DqA>
Subject: Re: [netmod] structured metadata for schema nodes using YANG extensions
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.39
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: Thu, 14 Mar 2024 22:06:48 -0000
Ok thx. Appreciate the pointer and the ideas. Jason > -----Original Message----- > From: Martin Björklund <mbj+ietf@4668.se> > Sent: Thursday, March 14, 2024 4:26 AM > To: Jason Sterne (Nokia) <jason.sterne@nokia.com> > Cc: netmod@ietf.org > Subject: Re: [netmod] structured metadata for schema nodes using YANG > extensions > > > CAUTION: This is an external email. Please be very careful when clicking links or > opening attachments. See the URL nok.it/ext for additional information. > > > > "Jason Sterne (Nokia)" <jason.sterne@nokia.com> wrote: > > Thanks Martin. > > > > I can see how that approach can be used to create a structure of containers and > leafs (where each leaf could have a type). So that's helpful for some scenarios. > > > > I'm not sure how to deal with leaf-lists or lists though. > > > > If we wanted a leaf-list like this: > > myext:colors "red green" > > it isn't obvious to me how to extend the approaches in yang-next issue 54 to > specify it. I'm also not sure how to specify the format of the "instance data" in the > leaf-list or if there is any sort of "right" format for that. In my example I show > space separated names (any separator may need escape mechanisms). > > A "leaf-list" would be: > > myext:color "red"; > myext:color "green"; > > It could be specified as: > > extension color { > argument color-name { > tailf:arg-type { > type enumeration { > enum red; > enum green; > } > } > } > tailf:occurence "*"; > } > > > > > > > Similarly I'm not sure how a list could work. In theory extension "saturation" > could be a substatement of extension "color" and then "color" could have an > argument. That could act as a sort of list: > > Yes. > > But the approach we took was to be able to specify a grammar for > extension statements so that they could express what ordinary YANG can > do, rather than having a way to add "instance data" to a module. > > > /martin > > > > > > > extension color { > > argument "color-name"; > > } > > extension saturation { > > argument "saturation-level"; > > tailf:use-in "myext:color"; > > } > > > > Leaf foo { > > myext:color "red" { > > saturation "45"; > > } > > myext:color "blue" { > > saturation "12"; > > } > > > > Maybe another approach is to somehow allow full RFC 9195 instance data to be > the argument of an extension, and then also have some way to define the data > model of that instance data as part of the extension definition. > > > > Jason > > > > > -----Original Message----- > > > From: Martin Björklund <mbj+ietf@4668.se> > > > Sent: Wednesday, March 13, 2024 5:08 AM > > > To: Jason Sterne (Nokia) <jason.sterne@nokia.com> > > > Cc: netmod@ietf.org > > > Subject: Re: [netmod] structured metadata for schema nodes using YANG > > > extensions > > > > > > > > > CAUTION: This is an external email. Please be very careful when clicking links > or > > > opening attachments. See the URL nok.it/ext for additional information. > > > > > > > > > > > > "Jason Sterne \(Nokia\)" <jason.sterne=40nokia.com@dmarc.ietf.org> wrote: > > > > Hi all, > > > > > > > > I'm looking for information about doing more complex YANG extensions > > > > that the basic <name,value> type, e.g.: > > > > oc-ext:openconfig-version "2.5.0"; > > > > > > See https://github.com/netmod-wg/yang-next/issues/54 for a discussion > > > about one approach. > > > > > > > > > > > > /martin > > > > > > > > > > > > > > > > > > > > > > > > > > The node-tags approach doesn't fit what I'm trying to do (tags can't > > > > have values). > > > > > > > > RFC7950 says the following: > > > > The substatements of an > > > > extension are defined by the "extension" statement, using some > > > > mechanism outside the scope of this specification. Syntactically, > > > > the substatements MUST be YANG statements, including extensions > > > > defined using "extension" statements. > > > > > > > > Let me start with a simple example and build on it. Say I want to > > > > associate a color with any schema node. That's easy: > > > > > > > > extension color { > > > > argument "color"; > > > > description "Takes a value of red, green or blue"; > > > > } > > > > > > > > leaf foo { > > > > myext:color "red"; > > > > } > > > > > > > > But what if I want a more complex structure for my color metadata like > > > > this? (a leaf-list and leaf inside a container) > > > > > > > > leaf foo { > > > > myext:chroma-metadata { > > > > myext:colors "red green"; > > > > myext:saturation "45"; > > > > } > > > > > > > > >From what I can tell, I'd have to define it like this: > > > > > > > > extension chroma-metadata { > > > > } > > > > extension colors { > > > > argument "color-list"; > > > > description "sub-statement of chroma-metadata. Space separated list > of > > > > colors red, green and blue."; > > > > } > > > > extension saturation { > > > > argument "saturation-level"; > > > > description "sub-statement of chroma-metadata"; > > > > } > > > > > > > > Or if I wanted a list like this? > > > > > > > > myext:chroma-metadata { > > > > myext:color "red" { > > > > myext:saturation "45"; > > > > } > > > > myext:color "green" { > > > > myext:saturation "23"; > > > > } > > > > } > > > > > > > > I don't think there is any formal way to do it, but could I say that > > > > the structure of the chroma-metadata follows a grouping I define? > > > > > > > > grouping cm-struct { > > > > list color { > > > > leaf saturation { ... } > > > > } > > > > } > > > > > > > > Could another option be to just define the top level extension > > > > chroma-metadata with a single argument, and then describe that the > > > > argument itself is a json-ietf blob of instance data that conforms to > > > > YANG grouping xyz? > > > > > > > > Jason (he/him) > > > >
- [netmod] structured metadata for schema nodes usi… Jason Sterne (Nokia)
- Re: [netmod] structured metadata for schema nodes… Martin Björklund
- Re: [netmod] structured metadata for schema nodes… Jason Sterne (Nokia)
- Re: [netmod] structured metadata for schema nodes… Martin Björklund
- Re: [netmod] structured metadata for schema nodes… Jason Sterne (Nokia)