blob: e0b49a6764ab79461c84153d93e37d9de28e9562 [file] [log] [blame]
Gaurav Agrawal28920d82017-10-06 17:39:42 +05301module 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
39 set forth in Section 4.c of the IETF Trust's Legal Provisions
40 Relating to IETF Documents
41 (http://trustee.ietf.org/license-info).
42
43 This version of this YANG module is part of RFC 6470; see
44 the RFC itself for full legal notices.";
45
46 revision "2012-02-06" {
47 description
48 "Initial version.";
49 reference
50 "RFC 6470: NETCONF Base Notifications";
51 }
52
53 grouping common-session-parms {
54 description
55 "Common session parameters to identify a
56 management session.";
57
58 leaf username {
59 type string;
60 mandatory true;
61 description
62 "Name of the user for the session.";
63 }
64
65 leaf session-id {
66 type nc:session-id-or-zero-type;
67 mandatory true;
68 description
69 "Identifier of the session.
70 A NETCONF session MUST be identified by a non-zero value.
71 A non-NETCONF session MAY be identified by the value zero.";
72 }
73
74 leaf source-host {
75 type inet:ip-address;
76 description
77 "Address of the remote host for the session.";
78 }
79 }
80
81 grouping changed-by-parms {
82 description
83 "Common parameters to identify the source
84 of a change event, such as a configuration
85 or capability change.";
86
87 container changed-by {
88 description
89 "Indicates the source of the change.
90 If caused by internal action, then the
91 empty leaf 'server' will be present.
92 If caused by a management session, then
93 the name, remote host address, and session ID
94 of the session that made the change will be reported.";
95 choice server-or-user {
96 mandatory true;
97 leaf server {
98 type empty;
99 description
100 "If present, the change was caused
101 by the server.";
102 }
103
104 case by-user {
105 uses common-session-parms;
106 }
107 } // choice server-or-user
108 } // container changed-by-parms
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 notification netconf-session-start {
205 description
206 "Generated when a NETCONF server detects that a
207 NETCONF session has started. A server MAY generate
208 this event for non-NETCONF management sessions.
209 Indicates the identity of the user that started
210 the session.";
211 uses common-session-parms;
212 } // notification netconf-session-start
213
214 notification netconf-session-end {
215 description
216 "Generated when a NETCONF server detects that a
217 NETCONF session has terminated.
218 A server MAY optionally generate this event for
219 non-NETCONF management sessions. Indicates the
220 identity of the user that owned the session,
221 and why the session was terminated.";
222
223 uses common-session-parms;
224
225 leaf killed-by {
226 when "../termination-reason = 'killed'";
227 type nc:session-id-type;
228 description
229 "The ID of the session that directly caused this session
230 to be abnormally terminated. If this session was abnormally
231 terminated by a non-NETCONF session unknown to the server,
232 then this leaf will not be present.";
233 }
234
235 leaf termination-reason {
236 type enumeration {
237 enum "closed" {
238 description
239 "The session was terminated by the client in normal
240 fashion, e.g., by the NETCONF <close-session>
241 protocol operation.";
242 }
243 enum "killed" {
244 description
245 "The session was terminated in abnormal
246 fashion, e.g., by the NETCONF <kill-session>
247 protocol operation.";
248 }
249 enum "dropped" {
250 description
251 "The session was terminated because the transport layer
252 connection was unexpectedly closed.";
253 }
254 enum "timeout" {
255 description
256 "The session was terminated because of inactivity,
257 e.g., waiting for the <hello> message or <rpc>
258 messages.";
259 }
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 notification netconf-confirmed-commit {
277 description
278 "Generated when a NETCONF server detects that a
279 confirmed-commit event has occurred. Indicates the event
280 and the current state of the confirmed-commit procedure
281 in progress.";
282 reference
283 "RFC 6241, Section 8.4";
284
285 uses common-session-parms {
286 when "../confirm-event != 'timeout'";
287 }
288
289 leaf confirm-event {
290 type enumeration {
291 enum "start" {
292 description
293 "The confirmed-commit procedure has started.";
294 }
295 enum "cancel" {
296 description
297 "The confirmed-commit procedure has been canceled,
298 e.g., due to the session being terminated, or an
299 explicit <cancel-commit> operation.";
300 }
301 enum "timeout" {
302 description
303 "The confirmed-commit procedure has been canceled
304 due to the confirm-timeout interval expiring.
305 The common session parameters will not be present
306 in this sub-mode.";
307 }
308 enum "extend" {
309 description
310 "The confirmed-commit timeout has been extended,
311 e.g., by a new <confirmed-commit> operation.";
312 }
313 enum "complete" {
314 description
315 "The confirmed-commit procedure has been completed.";
316 }
317 }
318 mandatory true;
319 description
320 "Indicates the event that caused the notification.";
321 }
322
323 leaf timeout {
324 when
325 "../confirm-event = 'start' or ../confirm-event = 'extend'";
326 type uint32;
327 units "seconds";
328 description
329 "The configured timeout value if the event type
330 is 'start' or 'extend'. This value represents
331 the approximate number of seconds from the event
332 time when the 'timeout' event might occur.";
333 }
334 } // notification netconf-confirmed-commit
335
336}