Revert "Better FIXME comment in ietf-netconf-notifications model"
[netconf.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         //FIXME: Use shorthand version of case statement, if possible
107         case server {
108           leaf server {
109             type empty;
110             description
111             "If present, the change was caused
112             by the server.";
113           }
114         }
115         case by-user {
116           uses common-session-parms;
117         }
118       } // choice server-or-user
119     } // container changed-by-parms
120   }
121
122
123   notification netconf-config-change {
124     description
125       "Generated when the NETCONF server detects that the
126        <running> or <startup> configuration datastore
127        has been changed by a management session.
128        The notification summarizes the edits that
129        have been detected.
130
131        The server MAY choose to also generate this
132        notification while loading a datastore during the
133        boot process for the device.";
134
135     uses changed-by-parms;
136
137
138
139
140
141     leaf datastore {
142       type enumeration {
143         enum running {
144           description "The <running> datastore has changed.";
145         }
146         enum startup {
147           description "The <startup> datastore has changed";
148         }
149       }
150       default "running";
151       description
152         "Indicates which configuration datastore has changed.";
153     }
154
155     list edit {
156       description
157         "An edit record SHOULD be present for each distinct
158          edit operation that the server has detected on
159          the target datastore.  This list MAY be omitted
160          if the detailed edit operations are not known.
161          The server MAY report entries in this list for
162          changes not made by a NETCONF session (e.g., CLI).";
163
164       leaf target {
165         type instance-identifier;
166         description
167           "Topmost node associated with the configuration change.
168            A server SHOULD set this object to the node within
169            the datastore that is being altered.  A server MAY
170            set this object to one of the ancestors of the actual
171            node that was changed, or omit this object, if the
172            exact node is not known.";
173       }
174
175       leaf operation {
176         type nc:edit-operation-type;
177         description
178           "Type of edit operation performed.
179            A server MUST set this object to the NETCONF edit
180            operation performed on the target datastore.";
181       }
182     } // list edit
183   } // notification netconf-config-change
184
185
186
187
188
189
190   notification netconf-capability-change {
191     description
192       "Generated when the NETCONF server detects that
193        the server capabilities have changed.
194        Indicates which capabilities have been added, deleted,
195        and/or modified.  The manner in which a server
196        capability is changed is outside the scope of this
197        document.";
198
199     uses changed-by-parms;
200
201     leaf-list added-capability {
202       type inet:uri;
203       description
204         "List of capabilities that have just been added.";
205     }
206
207     leaf-list deleted-capability {
208       type inet:uri;
209       description
210         "List of capabilities that have just been deleted.";
211     }
212
213     leaf-list modified-capability {
214       type inet:uri;
215       description
216         "List of capabilities that have just been modified.
217          A capability is considered to be modified if the
218          base URI for the capability has not changed, but
219          one or more of the parameters encoded at the end of
220          the capability URI have changed.
221          The new modified value of the complete URI is returned.";
222     }
223   } // notification netconf-capability-change
224
225
226   notification netconf-session-start {
227     description
228       "Generated when a NETCONF server detects that a
229        NETCONF session has started.  A server MAY generate
230        this event for non-NETCONF management sessions.
231        Indicates the identity of the user that started
232        the session.";
233     uses common-session-parms;
234   } // notification netconf-session-start
235
236
237
238
239   notification netconf-session-end {
240     description
241       "Generated when a NETCONF server detects that a
242        NETCONF session has terminated.
243        A server MAY optionally generate this event for
244        non-NETCONF management sessions.  Indicates the
245        identity of the user that owned the session,
246        and why the session was terminated.";
247
248     uses common-session-parms;
249
250     leaf killed-by {
251       when "../termination-reason = 'killed'";
252       type nc:session-id-type;
253       description
254         "The ID of the session that directly caused this session
255          to be abnormally terminated.  If this session was abnormally
256          terminated by a non-NETCONF session unknown to the server,
257          then this leaf will not be present.";
258     }
259
260     leaf termination-reason {
261       type enumeration {
262         enum "closed" {
263           description
264             "The session was terminated by the client in normal
265              fashion, e.g., by the NETCONF <close-session>
266              protocol operation.";
267         }
268         enum "killed" {
269           description
270             "The session was terminated in abnormal
271              fashion, e.g., by the NETCONF <kill-session>
272              protocol operation.";
273         }
274         enum "dropped" {
275           description
276             "The session was terminated because the transport layer
277              connection was unexpectedly closed.";
278         }
279         enum "timeout" {
280           description
281             "The session was terminated because of inactivity,
282              e.g., waiting for the <hello> message or <rpc>
283              messages.";
284         }
285
286
287
288         enum "bad-hello" {
289           description
290             "The client's <hello> message was invalid.";
291         }
292         enum "other" {
293           description
294             "The session was terminated for some other reason.";
295         }
296       }
297       mandatory true;
298       description
299         "Reason the session was terminated.";
300     }
301   } // notification netconf-session-end
302
303
304   notification netconf-confirmed-commit {
305     description
306       "Generated when a NETCONF server detects that a
307        confirmed-commit event has occurred.  Indicates the event
308        and the current state of the confirmed-commit procedure
309        in progress.";
310     reference
311       "RFC 6241, Section 8.4";
312
313     uses common-session-parms {
314       when "confirm-event != 'timeout'";
315     }
316
317     leaf confirm-event {
318       type enumeration {
319         enum "start" {
320           description
321             "The confirmed-commit procedure has started.";
322         }
323         enum "cancel" {
324           description
325             "The confirmed-commit procedure has been canceled,
326              e.g., due to the session being terminated, or an
327              explicit <cancel-commit> operation.";
328         }
329         enum "timeout" {
330           description
331             "The confirmed-commit procedure has been canceled
332              due to the confirm-timeout interval expiring.
333              The common session parameters will not be present
334              in this sub-mode.";
335         }
336
337         enum "extend" {
338           description
339             "The confirmed-commit timeout has been extended,
340              e.g., by a new <confirmed-commit> operation.";
341         }
342         enum "complete" {
343           description
344             "The confirmed-commit procedure has been completed.";
345         }
346       }
347       mandatory true;
348       description
349         "Indicates the event that caused the notification.";
350     }
351
352     leaf timeout {
353       when
354         "../confirm-event = 'start' or ../confirm-event = 'extend'";
355       type uint32;
356       units "seconds";
357       description
358         "The configured timeout value if the event type
359          is 'start' or 'extend'.  This value represents
360          the approximate number of seconds from the event
361          time when the 'timeout' event might occur.";
362     }
363   } // notification netconf-confirmed-commit
364
365 }