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