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