[Rtg-yang-coord] apply to subset of all configuration in YANG model
"Tarek Saad (tsaad)" <tsaad@cisco.com> Thu, 29 January 2015 23:38 UTC
Return-Path: <tsaad@cisco.com>
X-Original-To: rtg-yang-coord@ietfa.amsl.com
Delivered-To: rtg-yang-coord@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1])
by ietfa.amsl.com (Postfix) with ESMTP id 3480E1A1B18
for <rtg-yang-coord@ietfa.amsl.com>; Thu, 29 Jan 2015 15:38:09 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.51
X-Spam-Level:
X-Spam-Status: No, score=-14.51 tagged_above=-999 required=5
tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5,
SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_DKIM_WL=-7.5]
autolearn=ham
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 Y-WdG2oV92CO for <rtg-yang-coord@ietfa.amsl.com>;
Thu, 29 Jan 2015 15:38:07 -0800 (PST)
Received: from rcdn-iport-1.cisco.com (rcdn-iport-1.cisco.com [173.37.86.72])
(using TLSv1 with cipher RC4-SHA (128/128 bits))
(No client certificate requested)
by ietfa.amsl.com (Postfix) with ESMTPS id A18C61A1AB8
for <rtg-yang-coord@ietf.org>; Thu, 29 Jan 2015 15:38:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
d=cisco.com; i=@cisco.com; l=6025; q=dns/txt; s=iport;
t=1422574687; x=1423784287;
h=from:to:cc:subject:date:message-id:mime-version;
bh=Ie7W3YiCQ0Dgc2b4TUrfm4kH5C1FiV8pN6cs24M285U=;
b=jKXFeyi+E/h/Sx1oxP7oYXc0kD9p3Tbs/D+DZG1yVM9SE7SgyWlR72q0
YFFOBqGDoxYpkA6S5hyeyfX40lYaAaM1Cg7QOrYdU3PZPd95HjMw8XU9+
aGcqBLd96WMN08jvhypSXpsfyXmY1mm7PRi+gr2fo3VknP9q6RlOlSApG U=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AgcFAHbDylStJA2F/2dsb2JhbABagkNDgS/KU4EcQwEBAQEBfYQTaw4SAYEAJwQOiDHXPwEBAQEBAQQBAQEBAQEBG494hDAFjnyJIpJRIoNugjN+AQEB
X-IronPort-AV: E=Sophos;i="5.09,489,1418083200";
d="scan'208,217";a="388807235"
Received: from alln-core-11.cisco.com ([173.36.13.133])
by rcdn-iport-1.cisco.com with ESMTP; 29 Jan 2015 23:38:06 +0000
Received: from xhc-aln-x07.cisco.com (xhc-aln-x07.cisco.com [173.36.12.81])
by alln-core-11.cisco.com (8.14.5/8.14.5) with ESMTP id t0TNc6VC015877
(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL);
Thu, 29 Jan 2015 23:38:06 GMT
Received: from xmb-aln-x08.cisco.com ([169.254.3.210]) by
xhc-aln-x07.cisco.com ([173.36.12.81]) with mapi id 14.03.0195.001; Thu, 29
Jan 2015 17:38:06 -0600
From: "Tarek Saad (tsaad)" <tsaad@cisco.com>
To: "rtg-yang-coord@ietf.org" <rtg-yang-coord@ietf.org>
Thread-Topic: apply to subset of all configuration in YANG model
Thread-Index: AQHQPByhp36o5ILhtEiRfR2LCtBLMQ==
Date: Thu, 29 Jan 2015 23:38:05 +0000
Message-ID: <D0F02E89.16C4E0%tsaad@cisco.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/14.4.7.141117
x-originating-ip: [10.86.247.214]
Content-Type: multipart/alternative;
boundary="_000_D0F02E8916C4E0tsaadciscocom_"
MIME-Version: 1.0
Archived-At: <http://mailarchive.ietf.org/arch/msg/rtg-yang-coord/-9er39YdyNvSLnsUFmLOGfmzn0k>
Cc: Xufeng Liu <xufeng.liu@ericsson.com>
Subject: [Rtg-yang-coord] apply to subset of all configuration in YANG model
X-BeenThere: rtg-yang-coord@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "\"List to discuss coordination between the Routing related YANG
models\"" <rtg-yang-coord.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rtg-yang-coord>,
<mailto:rtg-yang-coord-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/rtg-yang-coord/>
List-Post: <mailto:rtg-yang-coord@ietf.org>
List-Help: <mailto:rtg-yang-coord-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rtg-yang-coord>,
<mailto:rtg-yang-coord-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 29 Jan 2015 23:38:09 -0000
Hi YANG experts,
There are cases where the same configuration data is to be applied on all (or some) nodes of a list and we’re seeking for advice. for example, if we have a list of interfaces (under a routing protocol "routing-proto" and I am trying to enable property foo on all such interfaces. We thought this could be done in several ways, and seeking thoughts and/or if consensus has been reach on it..
1) The trivial way is to configure foo repeatedly under all interfaces:
routing-proto
interface A
foo 20
interface B
foo 30
interface C
foo 20
2) If apply “all” is sought, hierarchy can be used so to allow overriding defaults on all interfaces:
routing-proto
foo 20
interface A
interface B
foo 30
interface C
3) Alternatively, an apply-group (or template) or a reference to a set of configs can be used. In the referenced configuration set (apply-group or template), attribute foo is configured once and it applies to all interfaces referencing it. The apply-group ALL association with interfaces association can be *implicit* (not needing to configure it under every interface), but when configured for non-ALL case, it is flexible such that different apply-groups NAMES can be associated with different interfaces.
apply-group ALL
interface ‘*’
foo
routing-proto
interface A
apply-group ALL
interface B
apply-group ALL
….
We can see this can be translated to YANG as:
For this, an approach can be
container ALL {
list interface {
key "interface";
leaf interface {
type if:interface-ref;
}
leaf foo { type uint32; }
leaf apply-group { type leafref "/apply-group/name" }
}
Is there any recommendation or preference on adopting 2) or 3) or both?
Regards,
Tarek
- [Rtg-yang-coord] apply to subset of all configura… Tarek Saad (tsaad)
- Re: [Rtg-yang-coord] apply to subset of all confi… Ladislav Lhotka