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