Adding TestVNF netconf server
[demo.git] / vnfs / TestVNF / netconftemplates / netconftemplates / ietf-netconf-server@2016-11-02.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-server {
3   yang-version 1.1;
4   namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-server";
5   prefix ncs;
6
7   import ietf-inet-types {
8     prefix inet;
9     reference
10       "RFC 6991: Common YANG Data Types";
11   }
12
13   import ietf-x509-cert-to-name {
14     prefix x509c2n;
15     reference
16       "RFC 7407: A YANG Data Model for SNMP Configuration";
17   }
18
19   import ietf-ssh-server {
20     prefix ss;
21     revision-date 2016-11-02;
22     reference
23       "RFC YYYY: SSH Client and Server Models";
24   }
25
26   import ietf-tls-server {
27     prefix ts;
28     revision-date 2016-11-02;
29     reference
30       "RFC ZZZZ: TLS Client and Server Models";
31   }
32
33   organization
34     "IETF NETCONF (Network Configuration) Working Group";
35   contact
36     "WG Web:   &lt;http://tools.ietf.org/wg/netconf/&gt;
37      WG List:  &lt;mailto:netconf@ietf.org&gt;
38
39      WG Chair: Mehmet Ersue
40                &lt;mailto:mehmet.ersue@nsn.com&gt;
41
42      WG Chair: Mahesh Jethanandani
43                &lt;mailto:mjethanandani@gmail.com&gt;
44
45      Editor:   Kent Watsen
46                &lt;mailto:kwatsen@juniper.net&gt;";
47   description
48     "This module contains a collection of YANG definitions for
49      configuring NETCONF servers.
50
51      Copyright (c) 2014 IETF Trust and the persons identified as
52      authors of the code. All rights reserved.
53
54      Redistribution and use in source and binary forms, with or
55      without modification, is permitted pursuant to, and subject
56      to the license terms contained in, the Simplified BSD
57      License set forth in Section 4.c of the IETF Trust's
58      Legal Provisions Relating to IETF Documents
59      (http://trustee.ietf.org/license-info).
60
61      This version of this YANG module is part of RFC XXXX; see
62      the RFC itself for full legal notices.";
63
64   revision 2016-11-02 {
65     description
66       "Initial version";
67     reference
68       "RFC XXXX: NETCONF Client and Server Models";
69   }
70
71   feature listen {
72     description
73       "The 'listen' feature indicates that the NETCONF server
74        supports opening a port to accept NETCONF client connections
75        using at least one transport (e.g., SSH, TLS, etc.).";
76   }
77
78   feature ssh-listen {
79     description
80       "The 'ssh-listen' feature indicates that the NETCONF server
81        supports opening a port to accept NETCONF over SSH
82        client connections.";
83     reference
84       "RFC 6242: Using the NETCONF Protocol over Secure Shell (SSH)";
85   }
86
87   feature tls-listen {
88     description
89       "The 'tls-listen' feature indicates that the NETCONF server
90        supports opening a port to accept NETCONF over TLS
91        client connections.";
92     reference
93       "RFC 7589: Using the NETCONF Protocol over Transport
94                  Layer Security (TLS) with Mutual X.509
95                  Authentication";
96   }
97
98   feature call-home {
99     description
100       "The 'call-home' feature indicates that the NETCONF server
101        supports initiating NETCONF call home connections to NETCONF
102        clients using at least one transport (e.g., SSH, TLS, etc.).";
103     reference
104       "RFC YYYY: NETCONF Call Home and RESTCONF Call Home";
105   }
106
107   feature ssh-call-home {
108     description
109       "The 'ssh-call-home' feature indicates that the NETCONF
110        server supports initiating a NETCONF over SSH call
111        home connection to NETCONF clients.";
112     reference
113       "RFC YYYY: NETCONF Call Home and RESTCONF Call Home";
114   }
115
116   feature tls-call-home {
117     description
118       "The 'tls-call-home' feature indicates that the NETCONF
119        server supports initiating a NETCONF over TLS call
120        home connection to NETCONF clients.";
121     reference
122       "RFC YYYY: NETCONF Call Home and RESTCONF Call Home";
123   }
124
125   grouping cert-maps-grouping {
126     description
127       "A grouping that defines a container around the
128        cert-to-name structure defined in RFC 7407.";
129     container cert-maps {
130       description
131         "The cert-maps container is used by a TLS-based NETCONF
132          server to map the NETCONF client's presented X.509
133          certificate to a NETCONF username.  If no matching and
134          valid cert-to-name list entry can be found, then the
135          NETCONF server MUST close the connection, and MUST NOT
136          accept NETCONF messages over it.";
137       reference
138         "RFC WWWW: NETCONF over TLS, Section 7";
139       uses x509c2n:cert-to-name;
140     }
141   }
142
143   grouping endpoints-container {
144     description
145       "This grouping is used by both the ssh and tls containers
146        for call-home configurations.";
147     container endpoints {
148       description
149         "Container for the list of endpoints.";
150       list endpoint {
151         key "name";
152         min-elements 1;
153         ordered-by user;
154         description
155           "User-ordered list of endpoints for this NETCONF client.
156            Defining more than one enables high-availability.";
157         leaf name {
158           type string;
159           description
160             "An arbitrary name for this endpoint.";
161         }
162
163         leaf address {
164           type inet:host;
165           mandatory true;
166           description
167             "The IP address or hostname of the endpoint.  If a
168              hostname is configured and the DNS resolution results
169              in more than one IP address, the NETCONF server
170              will process the IP addresses as if they had been
171              explicitly configured in place of the hostname.";
172         }
173
174         leaf port {
175           type inet:port-number;
176           description
177             "The IP port for this endpoint. The NETCONF server will
178              use the IANA-assigned well-known port if no value is
179              specified.";
180         }
181       }
182     }
183   }
184
185   container netconf-server {
186     description
187       "Top-level container for NETCONF server configuration.";
188     container session-options {
189       description
190         "NETCONF session options, independent of transport
191          or connection strategy.";
192       leaf hello-timeout {
193         type uint16;
194         units "seconds";
195         default "600";
196         description
197           "Specifies the maximum number of seconds that a SSH/TLS
198            connection may wait for a hello message to be received.
199            A connection will be dropped if no hello message is
200            received before this number of seconds elapses.  If set
201            to zero, then the server will wait forever for a hello
202            message.";
203       }
204     }
205
206     container listen {
207       if-feature "listen";
208       description
209         "Configures listen behavior";
210       leaf max-sessions {
211         type uint16;
212         default "0";
213         description
214           "Specifies the maximum number of concurrent sessions
215            that can be active at one time.  The value 0 indicates
216            that no artificial session limit should be used.";
217       }
218
219       leaf idle-timeout {
220         type uint16;
221         units "seconds";
222         default "3600";
223         description
224           "Specifies the maximum number of seconds that a NETCONF
225            session may remain idle. A NETCONF session will be dropped
226            if it is idle for an interval longer than this number of
227            seconds.  If set to zero, then the server will never drop
228            a session because it is idle.  Sessions that have a
229            notification subscription active are never dropped.";
230       }
231
232       list endpoint {
233         key "name";
234         description
235           "List of endpoints to listen for NETCONF connections on.";
236         leaf name {
237           type string;
238           description
239             "An arbitrary name for the NETCONF listen endpoint.";
240         }
241
242         choice transport {
243           mandatory true;
244           description
245             "Selects between available transports.";
246           case ssh {
247             if-feature "ssh-listen";
248             container ssh {
249               description
250                 "SSH-specific listening configuration for inbound
251                  connections.";
252               uses ss:listening-ssh-server-grouping {
253                 refine "port" {
254                   default "830";
255                 }
256               }
257             }
258           }
259
260           case tls {
261             if-feature "tls-listen";
262             container tls {
263               description
264                 "TLS-specific listening configuration for inbound
265                  connections.";
266               uses ts:listening-tls-server-grouping {
267                 refine "port" {
268                   default "6513";
269                 }
270                 augment "client-auth" {
271                   description
272                     "Augments in the cert-to-name structure.";
273                   uses cert-maps-grouping;
274                 }
275               }
276             }
277           }
278         }
279       }
280     }
281
282     container call-home {
283       if-feature "call-home";
284       description
285         "Configures call-home behavior";
286       list netconf-client {
287         key "name";
288         description
289           "List of NETCONF clients the NETCONF server is to initiate
290            call-home connections to.";
291         leaf name {
292           type string;
293           description
294             "An arbitrary name for the remote NETCONF client.";
295         }
296
297         choice transport {
298           mandatory true;
299           description
300             "Selects between available transports.";
301           case ssh {
302             if-feature "ssh-call-home";
303             container ssh {
304               description
305                 "Specifies SSH-specific call-home transport
306                  configuration.";
307               uses endpoints-container {
308                 refine "endpoints/endpoint/port" {
309                   default "4334";
310                 }
311               }
312
313               uses ss:non-listening-ssh-server-grouping;
314             }
315           }
316
317           case tls {
318             if-feature "tls-call-home";
319             container tls {
320               description
321                 "Specifies TLS-specific call-home transport
322                  configuration.";
323               uses endpoints-container {
324                 refine "endpoints/endpoint/port" {
325                   default "4335";
326                 }
327               }
328
329               uses ts:non-listening-tls-server-grouping {
330                 augment "client-auth" {
331                   description
332                     "Augments in the cert-to-name structure.";
333                   uses cert-maps-grouping;
334                 }
335               }
336             }
337           }
338         }
339
340         container connection-type {
341           description
342             "Indicates the kind of connection to use.";
343           choice connection-type {
344             description
345               "Selects between available connection types.";
346             case persistent-connection {
347               container persistent {
348                 presence "true";
349                 description
350                   "Maintain a persistent connection to the NETCONF
351                    client. If the connection goes down, immediately
352                    start trying to reconnect to it, using the
353                    reconnection strategy.
354
355                    This connection type minimizes any NETCONF client
356                    to NETCONF server data-transfer delay, albeit at
357                    the expense of holding resources longer.";
358                 leaf idle-timeout {
359                   type uint32;
360                   units "seconds";
361                   default "86400";
362                   description
363                     "Specifies the maximum number of seconds that a
364                      a NETCONF session may remain idle. A NETCONF
365                      session will be dropped if it is idle for an
366                      interval longer than this number of seconds.
367                      If set to zero, then the server will never drop
368                      a session because it is idle.  Sessions that
369                      have a notification subscription active are
370                      never dropped.";
371                 }
372
373                 container keep-alives {
374                   description
375                     "Configures the keep-alive policy, to proactively
376                      test the aliveness of the SSH/TLS client.  An
377                      unresponsive SSH/TLS client will be dropped after
378                      approximately max-attempts * max-wait seconds.";
379                   reference
380                     "RFC YYYY: NETCONF Call Home and RESTCONF Call
381                      Home, Section 3.1, item S6";
382                   leaf max-wait {
383                     type uint16 {
384                       range "1..max";
385                     }
386                     units "seconds";
387                     default "30";
388                     description
389                       "Sets the amount of time in seconds after which
390                        if no data has been received from the SSH/TLS
391                        client, a SSH/TLS-level message will be sent
392                        to test the aliveness of the SSH/TLS client.";
393                   }
394
395                   leaf max-attempts {
396                     type uint8;
397                     default "3";
398                     description
399                       "Sets the maximum number of sequential keep-alive
400                        messages that can fail to obtain a response from
401                        the SSH/TLS client before assuming the SSH/TLS
402                        client is no longer alive.";
403                   }
404                 }
405               }
406             }
407
408             case periodic-connection {
409               container periodic {
410                 presence "true";
411                 description
412                   "Periodically connect to the NETCONF client, so that
413                    the NETCONF client may deliver messages pending for
414                    the NETCONF server.  The NETCONF client must close
415                    the connection when it is ready to release it. Once
416                    the connection has been closed, the NETCONF server
417                    will restart its timer until the next connection.";
418                 leaf idle-timeout {
419                   type uint16;
420                   units "seconds";
421                   default "300";
422                   description
423                     "Specifies the maximum number of seconds that a
424                      a NETCONF session may remain idle. A NETCONF
425                      session will be dropped if it is idle for an
426                      interval longer than this number of seconds.
427                      If set to zero, then the server will never drop
428                      a session because it is idle.  Sessions that
429                      have a notification subscription active are
430                      never dropped.";
431                 }
432
433                 leaf reconnect_timeout {
434                   type uint16 {
435                     range "1..max";
436                   }
437                   units "minutes";
438                   default "60";
439                   description
440                     "Sets the maximum amount of unconnected time the
441                      NETCONF server will wait before re-establishing
442                      a connection to the NETCONF client.  The NETCONF
443                      server may initiate a connection before this
444                      time if desired (e.g., to deliver an event
445                      notification message).";
446                 }
447               }
448             }
449           }
450         }
451
452         container reconnect-strategy {
453           description
454             "The reconnection strategy directs how a NETCONF server
455              reconnects to a NETCONF client, after discovering its
456              connection to the client has dropped, even if due to a
457              reboot.  The NETCONF server starts with the specified
458              endpoint and tries to connect to it max-attempts times
459              before trying the next endpoint in the list (round
460              robin).";
461           leaf start-with {
462             type enumeration {
463               enum "first-listed" {
464                 description
465                   "Indicates that reconnections should start with
466                    the first endpoint listed.";
467               }
468               enum "last-connected" {
469                 description
470                   "Indicates that reconnections should start with
471                    the endpoint last connected to.  If no previous
472                    connection has ever been established, then the
473                    first endpoint configured is used.   NETCONF
474                    servers SHOULD be able to remember the last
475                    endpoint connected to across reboots.";
476               }
477             }
478             default "first-listed";
479             description
480               "Specifies which of the NETCONF client's endpoints the
481                NETCONF server should start with when trying to connect
482                to the NETCONF client.";
483           }
484
485           leaf max-attempts {
486             type uint8 {
487               range "1..max";
488             }
489             default "3";
490             description
491               "Specifies the number times the NETCONF server tries to
492                connect to a specific endpoint before moving on to the
493                next endpoint in the list (round robin).";
494           }
495         }
496       }
497     }
498   }
499 }
500 </data>
501 </rpc-reply>