blob: 4ec1dead4120cb55399a8686dba99d3b9e506537 [file] [log] [blame]
Sean Condonfae8e662016-12-15 10:25:13 +00001module ietf-netconf-notifications {
2
3 namespace
4 "urn:ietf:params:xml:ns:yang:ietf-netconf-notifications";
5
6 prefix ncn;
7
8 import ietf-inet-types { prefix inet; }
9 import ietf-netconf { prefix nc; }
10
11 organization
12 "IETF NETCONF (Network Configuration Protocol) Working Group";
13
14 contact
15 "WG Web: <http://tools.ietf.org/wg/netconf/>
16 WG List: <mailto:netconf@ietf.org>
17
18 WG Chair: Bert Wijnen
19 <mailto:bertietf@bwijnen.net>
20
21 WG Chair: Mehmet Ersue
22 <mailto:mehmet.ersue@nsn.com>
23
24 Editor: Andy Bierman
25 <mailto:andy@netconfcentral.org>";
26
27 description
28 "This module defines a YANG data model for use with the
29 NETCONF protocol that allows the NETCONF client to
30 receive common NETCONF base event notifications.
31
32 Copyright (c) 2012 IETF Trust and the persons identified as
33 the document authors. All rights reserved.
34
35 Redistribution and use in source and binary forms, with or
36 without modification, is permitted pursuant to, and subject
37 to the license terms contained in, the Simplified BSD License
38 set forth in Section 4.c of the IETF Trust's Legal Provisions
39 Relating to IETF Documents
40 (http://trustee.ietf.org/license-info).
41
42 This version of this YANG module is part of RFC 6470; see
43 the RFC itself for full legal notices.";
44
45 revision "2012-02-06" {
46 description
47 "Initial version.";
48 reference
49 "RFC 6470: NETCONF Base Notifications";
50 }
51
52 grouping common-session-parms {
53 description
54 "Common session parameters to identify a
55 management session.";
56
57 leaf username {
58 type string;
59 mandatory true;
60 description
61 "Name of the user for the session.";
62 }
63
64 leaf session-id {
65 type nc:session-id-or-zero-type;
66 mandatory true;
67 description
68 "Identifier of the session.
69 A NETCONF session MUST be identified by a non-zero value.
70 A non-NETCONF session MAY be identified by the value zero.";
71 }
72
73 leaf source-host {
74 type inet:ip-address;
75 description
76 "Address of the remote host for the session.";
77 }
78 }
79
80 grouping changed-by-parms {
81 description
82 "Common parameters to identify the source
83 of a change event, such as a configuration
84 or capability change.";
85
86 container changed-by {
87 description
88 "Indicates the source of the change.
89 If caused by internal action, then the
90 empty leaf 'server' will be present.
91 If caused by a management session, then
92 the name, remote host address, and session ID
93 of the session that made the change will be reported.";
94 choice server-or-user {
95 mandatory true;
96 leaf server {
97 type empty;
98 description
99 "If present, the change was caused
100 by the server.";
101 }
102
103 case by-user {
104 uses common-session-parms;
105 }
106 } // choice server-or-user
107 } // container changed-by-parms
108 }
109
110
111 notification netconf-config-change {
112 description
113 "Generated when the NETCONF server detects that the
114 <running> or <startup> configuration datastore
115 has been changed by a management session.
116 The notification summarizes the edits that
117 have been detected.
118
119 The server MAY choose to also generate this
120 notification while loading a datastore during the
121 boot process for the device.";
122
123 uses changed-by-parms;
124
125 leaf datastore {
126 type enumeration {
127 enum running {
128 description "The <running> datastore has changed.";
129 }
130 enum startup {
131 description "The <startup> datastore has changed";
132 }
133 }
134 default "running";
135 description
136 "Indicates which configuration datastore has changed.";
137 }
138
139 list edit {
140 description
141 "An edit record SHOULD be present for each distinct
142 edit operation that the server has detected on
143 the target datastore. This list MAY be omitted
144 if the detailed edit operations are not known.
145 The server MAY report entries in this list for
146 changes not made by a NETCONF session (e.g., CLI).";
147
148 leaf target {
149 type instance-identifier;
150 description
151 "Topmost node associated with the configuration change.
152 A server SHOULD set this object to the node within
153 the datastore that is being altered. A server MAY
154 set this object to one of the ancestors of the actual
155 node that was changed, or omit this object, if the
156 exact node is not known.";
157 }
158
159 leaf operation {
160 type nc:edit-operation-type;
161 description
162 "Type of edit operation performed.
163 A server MUST set this object to the NETCONF edit
164 operation performed on the target datastore.";
165 }
166 } // list edit
167 } // notification netconf-config-change
168
169 notification netconf-capability-change {
170 description
171 "Generated when the NETCONF server detects that
172 the server capabilities have changed.
173 Indicates which capabilities have been added, deleted,
174 and/or modified. The manner in which a server
175 capability is changed is outside the scope of this
176 document.";
177
178 uses changed-by-parms;
179
180 leaf-list added-capability {
181 type inet:uri;
182 description
183 "List of capabilities that have just been added.";
184 }
185
186 leaf-list deleted-capability {
187 type inet:uri;
188 description
189 "List of capabilities that have just been deleted.";
190 }
191
192 leaf-list modified-capability {
193 type inet:uri;
194 description
195 "List of capabilities that have just been modified.
196 A capability is considered to be modified if the
197 base URI for the capability has not changed, but
198 one or more of the parameters encoded at the end of
199 the capability URI have changed.
200 The new modified value of the complete URI is returned.";
201 }
202 } // notification netconf-capability-change
203
204
205 notification netconf-session-start {
206 description
207 "Generated when a NETCONF server detects that a
208 NETCONF session has started. A server MAY generate
209 this event for non-NETCONF management sessions.
210 Indicates the identity of the user that started
211 the session.";
212 uses common-session-parms;
213 } // notification netconf-session-start
214
215 notification netconf-session-end {
216 description
217 "Generated when a NETCONF server detects that a
218 NETCONF session has terminated.
219 A server MAY optionally generate this event for
220 non-NETCONF management sessions. Indicates the
221 identity of the user that owned the session,
222 and why the session was terminated.";
223
224 uses common-session-parms;
225
226 leaf killed-by {
227 when "../termination-reason = 'killed'";
228 type nc:session-id-type;
229 description
230 "The ID of the session that directly caused this session
231 to be abnormally terminated. If this session was abnormally
232 terminated by a non-NETCONF session unknown to the server,
233 then this leaf will not be present.";
234 }
235
236 leaf termination-reason {
237 type enumeration {
238 enum "closed" {
239 description
240 "The session was terminated by the client in normal
241 fashion, e.g., by the NETCONF <close-session>
242 protocol operation.";
243 }
244 enum "killed" {
245 description
246 "The session was terminated in abnormal
247 fashion, e.g., by the NETCONF <kill-session>
248 protocol operation.";
249 }
250 enum "dropped" {
251 description
252 "The session was terminated because the transport layer
253 connection was unexpectedly closed.";
254 }
255 enum "timeout" {
256 description
257 "The session was terminated because of inactivity,
258 e.g., waiting for the <hello> message or <rpc>
259 messages.";
260 }
261 enum "bad-hello" {
262 description
263 "The client's <hello> message was invalid.";
264 }
265 enum "other" {
266 description
267 "The session was terminated for some other reason.";
268 }
269 }
270 mandatory true;
271 description
272 "Reason the session was terminated.";
273 }
274 } // notification netconf-session-end
275
276
277 notification netconf-confirmed-commit {
278 description
279 "Generated when a NETCONF server detects that a
280 confirmed-commit event has occurred. Indicates the event
281 and the current state of the confirmed-commit procedure
282 in progress.";
283 reference
284 "RFC 6241, Section 8.4";
285
286 uses common-session-parms {
287 when "../confirm-event != 'timeout'";
288 }
289
290 leaf confirm-event {
291 type enumeration {
292 enum "start" {
293 description
294 "The confirmed-commit procedure has started.";
295 }
296 enum "cancel" {
297 description
298 "The confirmed-commit procedure has been canceled,
299 e.g., due to the session being terminated, or an
300 explicit <cancel-commit> operation.";
301 }
302 enum "timeout" {
303 description
304 "The confirmed-commit procedure has been canceled
305 due to the confirm-timeout interval expiring.
306 The common session parameters will not be present
307 in this sub-mode.";
308 }
309 enum "extend" {
310 description
311 "The confirmed-commit timeout has been extended,
312 e.g., by a new <confirmed-commit> operation.";
313 }
314 enum "complete" {
315 description
316 "The confirmed-commit procedure has been completed.";
317 }
318 }
319 mandatory true;
320 description
321 "Indicates the event that caused the notification.";
322 }
323
324 leaf timeout {
325 when
326 "../confirm-event = 'start' or ../confirm-event = 'extend'";
327 type uint32;
328 units "seconds";
329 description
330 "The configured timeout value if the event type
331 is 'start' or 'extend'. This value represents
332 the approximate number of seconds from the event
333 time when the 'timeout' event might occur.";
334 }
335 } // notification netconf-confirmed-commit
336
337}