Re: [netmod] structured metadata for schema nodes using YANG extensions

"Jason Sterne (Nokia)" <jason.sterne@nokia.com> Wed, 13 March 2024 22:51 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 E524BC14F68E for <netmod@ietfa.amsl.com>; Wed, 13 Mar 2024 15:51:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.108
X-Spam-Level:
X-Spam-Status: No, score=-7.108 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_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 mRhcWFKwiLaH for <netmod@ietfa.amsl.com>; Wed, 13 Mar 2024 15:51:30 -0700 (PDT)
Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2083.outbound.protection.outlook.com [40.107.94.83]) (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 A295DC14F60D for <netmod@ietf.org>; Wed, 13 Mar 2024 15:51:30 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kiEfS64usjOQ4wF1DayAW2f2p/QcPUt4byUXSTPBh5dxIkbkpV6jFzk41IpbZtIqOQex4BMcLCjfySAyuKKREpLbT8805WzhicEsVsCp6nmPVBhhhjrXnJ8zfuqMbeyGbU6G176bCcRQ78ZUSsdeey1Ly04RCsAge3MbBYY3Pj1liCiNze/ym2fUv6P9na24fQEIhyOFb3mjseEqSGEypIxZfNesJf6cDeXGVwBZkg0bapGZtUEGkxGmlJ/3XUkNwVmNfbhKIEIbNBvohaWvst8VHVGH0et2inq7iH+vdtsKXBwkfdyaznQOUi/G7B3rKlGEgzijOpkpk26QTokL/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=T0E1YcGYX3PRrXAetZJ9z30Cs1C6ItYYKpa6Zc1jLdU=; b=MlabASKr8aSkVuLl62/O/0BAm1/S8n6paCkiJoE7vGrrEzIv4OIM8tRIKrwpJOAtVhHapIujLnvGm9hEFaWZOB8HmZ/biB912mbNPK3Cmxf41V+2jD578hvW9e7qR0ez7mcQqtrcArsAjLTXd9pFrPsiT//Vb9QB3rG8aM8vIT/4iPTcLryndqNKdujxoi5StY6DO/Prd6bFRVzfP8mr7ZULQCqksX9xa5u2ZBRSYVtECoBV/mTzKckdpgo7BFShj5HYALJRcQA3vdl7A9ahPOsmkicw2LBkBKqcmvRntHH7R8S+EqRw2+KianIIn8ffETTf4/O7b3ONlUyQgwc3IA==
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=T0E1YcGYX3PRrXAetZJ9z30Cs1C6ItYYKpa6Zc1jLdU=; b=mGghHWjwESMNTaesMGupkPibVT26bmOUuGn0c1o7xfowUeRu6c4sUs0bL5sjuaNIC59sGzCq+41eqfBhIRxbz8SYIk7zdRoJI5N08TlVRRvUaKFbuROIyWTlqe6KABycXHJSWANtTMcJuwPT5rHo+L137oY++6Xk7BS+IjV1ERKPKCnRJqfzooFqFVFQDUbSYYSB6yf/qF5uOLGIqGuQiVEKVp95CoulpFx+p3gx5XhkijkamVTNP8T8JAV37k9ZiZ3lu23dkJGM56Q3sD9GLJJwifZiR2xSErsrB3PI/DUv0/5cdd0S+p5HPQWe2yvalNEz2UHFLhWfOaHp0je9iA==
Received: from SN6PR08MB4847.namprd08.prod.outlook.com (2603:10b6:805:6b::12) by MW5PR08MB8317.namprd08.prod.outlook.com (2603:10b6:303:1cc::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.20; Wed, 13 Mar 2024 22:51:26 +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; Wed, 13 Mar 2024 22:51:26 +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: Adp0zIh3sX0rFCQbQnysoMLgD9z3NwAWV8YAABu6KFA=
Date: Wed, 13 Mar 2024 22:51:26 +0000
Message-ID: <SN6PR08MB48479709AB9B95C7594132579B2A2@SN6PR08MB4847.namprd08.prod.outlook.com>
References: <SN6PR08MB4847A4E43785C38E77331CC89B2B2@SN6PR08MB4847.namprd08.prod.outlook.com> <20240313.100742.1986844484799977524.id@4668.se>
In-Reply-To: <20240313.100742.1986844484799977524.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_|MW5PR08MB8317:EE_
x-ms-office365-filtering-correlation-id: 72713e6d-bf60-4a2f-dad4-08dc43b01d78
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: WMCU+K+93kBn1j02Qe+EV7gbu02X2j6OmPBiFffmAkuqw79v1n6/0VvQIJXP3hXV3IQNTi7WbfL+fuax+oXOvY/x+fKHXi83MZ1YSreZDpQXyeBK7ZEol2KmLpM0YvsNYjp9fsspZSEmv+kiaVpgUiWUTkqlrNkm5nCmly7tBWa90JFWXbofmgNczT4wWvH5/YjG+y+Yo3zM715pLIdrb+GrhkTnliFXkz1LXkY7WO5zwZlZcjkoE9cJVRcxGrijhrPmQpBKNERf6obydmOzlUl02Ilmdmh3MLkj+IcPe+0O+G61ltKoaoTUudzlQ3jWZ0VLDblRsDqDmTrrTlDAUYZmTM1BNEPud5HANsebuW/pNzJlrJPETC9VlHz4dCRR9YP0rVJhpzbuiMaAyoAavsK1HJBvBvI6TcAxOWb0dtH2GIb7AN/TNN2Ei8WhBjH/HV8YsVSEbelEF3v4+DcF3P+k4l0hCK0E9c6baL4jnlGZVqqxuKnVcllTsDztbXPPExMDBn+u/qZqAMa7tvAIH3Q0BFv/EaqDEqmTn9AVBS3JYqqGS0niQhKaamGuIXD/ozxO27D4U55UwEabZ7+c7HnggWTHjgoIZ+8OYON5tZ2f85AxlfkLd3r46hbLLaLumLAKWEaSm0ifWZHTn2FUtGjUJL/qVeUXAEyxcEo3ollS4AViajEjIg67W447NEu0
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: EoLD7IzBEvL2JkREB3T7x0mseX4u0uX+Dn3vo0C0xiBL7mGxNmx88KflUiNh4wBAjRfrtdFkakqdBmdYFs8/VObz02GZJKmUhSFzvwxPBdq3QwOxWBOPJgzAeHxKThTuKNG/Mx9HlUv5JsQYaG3PasbLgDECDb/Qip8Wx3HaF6k2DJSh8AwsUyq8G/bV5c8CPUG92bpAQeiDrUi160jbxAudIYgZtW7A1GWewX+B7eWP9IzXf3P7d8NkVdozpYtG3Dh4gxqbKsuAKF3lMAOuUJh+JwUSGK0N6SH+GQAPwKU6XflhK5mTz13XE/zf8P+iBmQ9zke+qr92rDpMRG0o2dzv64Gu/xyUFfUpYokahM6NhDO1HKe63argIGrNze7/cjupxG3E4D5viJd/APQ3KqukmFseChcd2km1ENq5f1C5s/v0mifPn7CsMUzOlUj/wBjrwin1zBhjmgvnxlwa8FhglC6M3Ewsz0CkJk/R4hiUzitd+AEyGxZl5rA6ttDU9NMHsh4H0V+vDwOJvMf/oPcV7t8jmfmuxYJ3YkJm2UUOJHNALrLnyviBBK92H7rLiu5mACbVwtedW+34rV2urMscpUq3Vnfz10n0rf6whORhiR7xJoI+4PQwUu78+99qCaWRqWVe7NthODEq9HrhNzIUaacEANIvWWaTxik1Xxend/xyeZZuM6D0s0XNkYfQFvaw/DxGCv5hFukYZtoBMQ30+ygazrcSnJmyNxZvVaZWRUh0UgYL38YmZ/fvUgxOyDMy0AVpxGR/kjT32HV5CsV3BgAC2gDR38aZfs3w67X27+MSVqqQveLLkxzO2VX5M3bkmd6vVFg/4lxtmz8cF181mrjEj+Wtip8G7j8zomrjmqnJbyVKKYpfp4jA9IGD5eKTmx3Jh7gbffALmSVSVKqYqoBRm49+apC3rTVsq5IZJeInqG4BQ9DYFFFwBieytJx4ar7rRwRpsqt3EWNaY3TiUGjUyeYVEbOSbXSuNK1q9xVTAullJdgmJqe7JDye3jtce3+ODsw82mF4DTp2Q1Z/PgaT0NxvTu6PyWmaP0dUWv3+h8l0ssv8Pxq6J7ujToowYN+7WJHkvzf36sCf9DvGU+7x8+tGZqAXwBwOdZ8w5TX9jUlBxdIYMvsFKlL7WoPP7DIRxy6IbSR+wT971DpoqqXxSzqdBH3eE7lEw0GnTt38PcTEPQZr1C42py1Mmq4OF+brwnCCbd2PjnVKUb8QHbTBZwmzrZXAPKspersQkDJBBkyz6lj2XyedfEVsL8bbLHCk6sGHjoXUjgUab8AES4cIMAPtXsIYadbgmXw5oI1y8SmVrzYuoY8CbGXsm2AWr7/gkZKj6LWyKzamLtn2mrAFbpkYtDESa1w2v2or4ZHaERLcouGry6krvAhT+g0sDpj9TFR+uZ9HnpHTU7i5KVdfhG2xMBeYvu2d7WAYW337rQ/J7r9kikw95nnWCheWrGtCkhx7+gnuiwQ7mPxM05EW7KpSB1mAyrKkpVfH7mFrtEYWo6R1ca5rTLD931HxEd4zsJFxjwOw6CNlMzONRpWM0/bGnmIEVYm7p62IFuZ5sXlhLt4prZpqrjVm
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: 72713e6d-bf60-4a2f-dad4-08dc43b01d78
X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Mar 2024 22:51:26.6945 (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: gTwRdxdG5uzFgcC7/UD/6oWx43mpWLPHE6j0G3t4T8Jp+KTMU8He3GUF90mZwIsvw/4l9IjsCbExzoQUUCQWVA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR08MB8317
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/Qf3__mLvsJa-1qk6PjWHje8RBSs>
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: Wed, 13 Mar 2024 22:51:35 -0000

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).

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:

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)
> >