Skip to content

Commit 473e0ff

Browse files
authored
main UPDATE implement capabilities modules (#1715)
Add ietf-system-capabilities and ietf-notification-capabilities yang modules. Subscribe to provide /ietf-system-capabilities:system-capabilities operational data. Use the SR_SUBSCR_OPER_MERGE flag such as another application can overwrite the values. Provide default possible values for all the fields. Move sub_ntf_ds2ident to common.c. Link: https://datatracker.ietf.org/doc/html/rfc9196 Signed-off-by: Jeremie Leska <jeremie.leska@6wind.com>
1 parent beaf059 commit 473e0ff

7 files changed

+604
-26
lines changed
Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
module ietf-notification-capabilities {
2+
yang-version 1.1;
3+
namespace
4+
"urn:ietf:params:xml:ns:yang:ietf-notification-capabilities";
5+
prefix notc;
6+
7+
import ietf-yang-push {
8+
prefix yp;
9+
description
10+
"This module requires ietf-yang-push to be implemented.";
11+
reference
12+
"RFC 8641: Subscription to YANG Notifications for
13+
Datastore Updates";
14+
}
15+
import ietf-system-capabilities {
16+
prefix sysc;
17+
description
18+
"This module requires ietf-system-capabilities to be
19+
implemented.";
20+
reference
21+
"RFC 9196: YANG Modules Describing Capabilities for Systems
22+
and Datastore Update Notifications";
23+
}
24+
25+
organization
26+
"IETF NETCONF (Network Configuration) Working Group";
27+
contact
28+
"WG Web: <https://datatracker.ietf.org/wg/netconf/>
29+
WG List: <mailto:netconf@ietf.org>
30+
31+
Editor: Balazs Lengyel
32+
<mailto:balazs.lengyel@ericsson.com>";
33+
description
34+
"This module specifies publisher capabilities related to
35+
YANG-Push (RFC 8641).
36+
37+
The module contains:
38+
39+
- a specification of the data nodes that support 'on-change' or
40+
'periodic' notifications.
41+
42+
- capabilities related to the throughput of notification data
43+
that the publisher can support. (Note that for a specific
44+
subscription, the publisher MAY allow only longer periods
45+
or smaller updates depending on, e.g., actual load conditions.)
46+
47+
Capability values can be specified at the system/publisher
48+
level, at the datastore level, or for specific data nodes of
49+
a specific datastore (and their contained subtrees), as defined
50+
in the ietf-system-capabilities module.
51+
52+
If different data nodes covered by a single subscription
53+
have different values for a specific capability, then using
54+
values that are only acceptable for some of these data nodes,
55+
but not for others, may result in the rejection of the
56+
subscription.
57+
58+
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
59+
'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
60+
'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
61+
are to be interpreted as described in BCP 14 (RFC 2119)
62+
(RFC 8174) when, and only when, they appear in all
63+
capitals, as shown here.
64+
65+
Copyright (c) 2022 IETF Trust and the persons identified as
66+
authors of the code. All rights reserved.
67+
68+
Redistribution and use in source and binary forms, with or
69+
without modification, is permitted pursuant to, and subject to
70+
the license terms contained in, the Revised BSD License set
71+
forth in Section 4.c of the IETF Trust's Legal Provisions
72+
Relating to IETF Documents
73+
(https://trustee.ietf.org/license-info).
74+
75+
This version of this YANG module is part of RFC 9196
76+
(https://www.rfc-editor.org/info/rfc9196); see the RFC itself
77+
for full legal notices.";
78+
79+
revision 2022-02-17 {
80+
description
81+
"Initial version";
82+
reference
83+
"RFC 9196: YANG Modules Describing Capabilities for Systems
84+
and Datastore Update Notifications";
85+
}
86+
87+
grouping subscription-capabilities {
88+
description
89+
"Capabilities related to YANG-Push subscriptions
90+
and notifications";
91+
container subscription-capabilities {
92+
description
93+
"Capabilities related to YANG-Push subscriptions
94+
and notifications";
95+
typedef notification-support {
96+
type bits {
97+
bit config-changes {
98+
description
99+
"The publisher is capable of sending
100+
notifications for 'config true' nodes for the
101+
relevant scope and subscription type.";
102+
}
103+
bit state-changes {
104+
description
105+
"The publisher is capable of sending
106+
notifications for 'config false' nodes for the
107+
relevant scope and subscription type.";
108+
}
109+
}
110+
description
111+
"Type for defining whether 'on-change' or
112+
'periodic' notifications are supported for all data nodes,
113+
'config false' data nodes, 'config true' data nodes, or
114+
no data nodes.
115+
116+
The bits config-changes or state-changes have no effect
117+
when they are set for a datastore or for a set of nodes
118+
that does not contain nodes with the indicated config
119+
value. In those cases, the effect is the same as if no
120+
support was declared. One example of this is indicating
121+
support for state-changes for a candidate datastore that
122+
has no effect.";
123+
}
124+
125+
leaf max-nodes-per-update {
126+
type uint32 {
127+
range "1..max";
128+
}
129+
description
130+
"Maximum number of data nodes that can be sent
131+
in an update. The publisher MAY support more data nodes
132+
but SHOULD support at least this number.
133+
134+
May be used to avoid the 'update-too-big' error
135+
during subscription.";
136+
reference
137+
"RFC 8641: Subscription to YANG Notifications for
138+
Datastore Updates, the 'update-too-big' error/identity";
139+
}
140+
leaf periodic-notifications-supported {
141+
type notification-support;
142+
description
143+
"Specifies whether the publisher is capable of
144+
sending 'periodic' notifications for the selected
145+
data nodes, including any subtrees that may exist
146+
below them.";
147+
reference
148+
"RFC 8641: Subscription to YANG Notifications for
149+
Datastore Updates, 'periodic' subscription concept";
150+
}
151+
choice update-period {
152+
description
153+
"Supported update period value or values for
154+
'periodic' subscriptions.";
155+
leaf minimum-update-period {
156+
type uint32;
157+
units "centiseconds";
158+
description
159+
"Indicates the minimal update period that is
160+
supported for a 'periodic' subscription.
161+
162+
A subscription request to the selected data nodes with
163+
a smaller period than what this leaf specifies is
164+
likely to result in a 'period-unsupported' error.";
165+
reference
166+
"RFC 8641: Subscription to YANG Notifications for
167+
Datastore Updates, the period leaf in the ietf-yang-push
168+
YANG module";
169+
}
170+
leaf-list supported-update-period {
171+
type uint32;
172+
units "centiseconds";
173+
description
174+
"Supported update period values for a 'periodic'
175+
subscription.
176+
177+
A subscription request to the selected data nodes with a
178+
period not included in the leaf-list will result in a
179+
'period-unsupported' error.";
180+
reference
181+
"RFC 8641: Subscription to YANG Notifications for
182+
Datastore Updates, the period leaf in the ietf-yang-push
183+
YANG module";
184+
}
185+
}
186+
leaf on-change-supported {
187+
if-feature "yp:on-change";
188+
type notification-support;
189+
description
190+
"Specifies whether the publisher is capable of
191+
sending 'on-change' notifications for the selected
192+
data nodes and the subtree below them.";
193+
reference
194+
"RFC 8641: Subscription to YANG Notifications for Datastore
195+
Updates, on-change concept";
196+
}
197+
leaf minimum-dampening-period {
198+
if-feature "yp:on-change";
199+
type uint32;
200+
units "centiseconds";
201+
description
202+
"The minimum dampening period supported for 'on-change'
203+
subscriptions for the selected data nodes.
204+
205+
If this value is present and greater than zero,
206+
that implies dampening is mandatory.";
207+
reference
208+
"RFC 8641: Subscription to YANG Notifications for
209+
Datastore Updates, the dampening-period leaf in the
210+
ietf-yang-push YANG module";
211+
}
212+
leaf-list supported-excluded-change-type {
213+
if-feature "yp:on-change";
214+
type union {
215+
type enumeration {
216+
enum none {
217+
value -2;
218+
description
219+
"None of the change types can be excluded.";
220+
}
221+
enum all {
222+
value -1;
223+
description
224+
"Any combination of change types can be excluded.";
225+
}
226+
}
227+
type yp:change-type;
228+
}
229+
description
230+
"The change types that can be excluded in
231+
YANG-Push subscriptions for the selected data nodes.";
232+
reference
233+
"RFC 8641: Subscription to YANG Notifications for Datastore
234+
Updates, the change-type typedef in the ietf-yang-push
235+
YANG module";
236+
}
237+
}
238+
}
239+
240+
augment "/sysc:system-capabilities" {
241+
description
242+
"Add system level capabilities";
243+
uses subscription-capabilities {
244+
refine
245+
"subscription-capabilities/supported-excluded-change-type" {
246+
default "none";
247+
}
248+
}
249+
}
250+
251+
augment "/sysc:system-capabilities/sysc:datastore-capabilities"
252+
+ "/sysc:per-node-capabilities" {
253+
description
254+
"Add datastore and node-level capabilities";
255+
uses subscription-capabilities {
256+
refine
257+
"subscription-capabilities/supported-excluded-change-type" {
258+
default "none";
259+
}
260+
}
261+
}
262+
}

0 commit comments

Comments
 (0)