Adding TestVNF netconf server
[demo.git] / vnfs / TestVNF / netconftemplates / netconftemplates / ietf-system@2014-08-06.yang
1 <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="<MID>">
2   <data xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring">module ietf-system {
3   namespace "urn:ietf:params:xml:ns:yang:ietf-system";
4   prefix sys;
5
6   import ietf-yang-types {
7     prefix yang;
8   }
9
10   import ietf-inet-types {
11     prefix inet;
12   }
13
14   import ietf-netconf-acm {
15     prefix nacm;
16   }
17
18   import iana-crypt-hash {
19     prefix ianach;
20   }
21
22   organization
23     "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
24   contact
25     "WG Web:   &lt;http://tools.ietf.org/wg/netmod/&gt;
26      WG List:  &lt;mailto:netmod@ietf.org&gt;
27
28      WG Chair: Thomas Nadeau
29                &lt;mailto:tnadeau@lucidvision.com&gt;
30
31      WG Chair: Juergen Schoenwaelder
32                &lt;mailto:j.schoenwaelder@jacobs-university.de&gt;
33
34      Editor:   Andy Bierman
35                &lt;mailto:andy@yumaworks.com&gt;
36
37      Editor:   Martin Bjorklund
38                &lt;mailto:mbj@tail-f.com&gt;";
39   description
40     "This module contains a collection of YANG definitions for the
41      configuration and identification of some common system
42      properties within a device containing a NETCONF server.  This
43      includes data node definitions for system identification,
44      time-of-day management, user management, DNS resolver
45      configuration, and some protocol operations for system
46      management.
47
48      Copyright (c) 2014 IETF Trust and the persons identified as
49      authors of the code.  All rights reserved.
50
51      Redistribution and use in source and binary forms, with or
52      without modification, is permitted pursuant to, and subject
53      to the license terms contained in, the Simplified BSD License
54      set forth in Section 4.c of the IETF Trust's Legal Provisions
55      Relating to IETF Documents
56      (http://trustee.ietf.org/license-info).
57
58      This version of this YANG module is part of RFC 7317; see
59      the RFC itself for full legal notices.";
60
61   revision 2014-08-06 {
62     description
63       "Initial revision.";
64     reference
65       "RFC 7317: A YANG Data Model for System Management";
66   }
67
68   feature radius {
69     description
70       "Indicates that the device can be configured as a RADIUS
71        client.";
72     reference
73       "RFC 2865: Remote Authentication Dial In User Service (RADIUS)";
74   }
75
76   feature authentication {
77     description
78       "Indicates that the device supports configuration of
79        user authentication.";
80   }
81
82   feature local-users {
83     if-feature "authentication";
84     description
85       "Indicates that the device supports configuration of
86        local user authentication.";
87   }
88
89   feature radius-authentication {
90     if-feature "radius";
91     if-feature "authentication";
92     description
93       "Indicates that the device supports configuration of user
94        authentication over RADIUS.";
95     reference
96       "RFC 2865: Remote Authentication Dial In User Service (RADIUS)
97        RFC 5607: Remote Authentication Dial-In User Service (RADIUS)
98                  Authorization for Network Access Server (NAS)
99                  Management";
100   }
101
102   feature ntp {
103     description
104       "Indicates that the device can be configured to use one or
105        more NTP servers to set the system date and time.";
106   }
107
108   feature ntp-udp-port {
109     if-feature "ntp";
110     description
111       "Indicates that the device supports the configuration of
112        the UDP port for NTP servers.
113
114        This is a 'feature', since many implementations do not support
115        any port other than the default port.";
116   }
117
118   feature timezone-name {
119     description
120       "Indicates that the local time zone on the device
121        can be configured to use the TZ database
122        to set the time zone and manage daylight saving time.";
123     reference
124       "RFC 6557: Procedures for Maintaining the Time Zone Database";
125   }
126
127   feature dns-udp-tcp-port {
128     description
129       "Indicates that the device supports the configuration of
130        the UDP and TCP port for DNS servers.
131
132        This is a 'feature', since many implementations do not support
133        any port other than the default port.";
134   }
135
136   identity authentication-method {
137     description
138       "Base identity for user authentication methods.";
139   }
140
141   identity radius {
142     base authentication-method;
143     description
144       "Indicates user authentication using RADIUS.";
145     reference
146       "RFC 2865: Remote Authentication Dial In User Service (RADIUS)
147        RFC 5607: Remote Authentication Dial-In User Service (RADIUS)
148                  Authorization for Network Access Server (NAS)
149                  Management";
150   }
151
152   identity local-users {
153     base authentication-method;
154     description
155       "Indicates password-based authentication of locally
156        configured users.";
157   }
158
159   identity radius-authentication-type {
160     description
161       "Base identity for RADIUS authentication types.";
162   }
163
164   identity radius-pap {
165     base radius-authentication-type;
166     description
167       "The device requests Password Authentication Protocol (PAP)
168        authentication from the RADIUS server.";
169     reference
170       "RFC 2865: Remote Authentication Dial In User Service (RADIUS)";
171   }
172
173   identity radius-chap {
174     base radius-authentication-type;
175     description
176       "The device requests Challenge Handshake Authentication
177        Protocol (CHAP) authentication from the RADIUS server.";
178     reference
179       "RFC 2865: Remote Authentication Dial In User Service (RADIUS)";
180   }
181
182   typedef timezone-name {
183     type string;
184     description
185       "A time zone name as used by the Time Zone Database,
186        sometimes referred to as the 'Olson Database'.
187
188        The exact set of valid values is an implementation-specific
189        matter.  Client discovery of the exact set of time zone names
190        for a particular server is out of scope.";
191     reference
192       "RFC 6557: Procedures for Maintaining the Time Zone Database";
193   }
194
195   container system {
196     description
197       "System group configuration.";
198     leaf contact {
199       type string;
200       description
201         "The administrator contact information for the system.
202
203          A server implementation MAY map this leaf to the sysContact
204          MIB object.  Such an implementation needs to use some
205          mechanism to handle the differences in size and characters
206          allowed between this leaf and sysContact.  The definition of
207          such a mechanism is outside the scope of this document.";
208       reference
209         "RFC 3418: Management Information Base (MIB) for the
210                    Simple Network Management Protocol (SNMP)
211                    SNMPv2-MIB.sysContact";
212     }
213
214     leaf hostname {
215       type inet:domain-name;
216       description
217         "The name of the host.  This name can be a single domain
218          label or the fully qualified domain name of the host.";
219     }
220
221     leaf location {
222       type string;
223       description
224         "The system location.
225
226          A server implementation MAY map this leaf to the sysLocation
227          MIB object.  Such an implementation needs to use some
228          mechanism to handle the differences in size and characters
229          allowed between this leaf and sysLocation.  The definition
230          of such a mechanism is outside the scope of this document.";
231       reference
232         "RFC 3418: Management Information Base (MIB) for the
233                    Simple Network Management Protocol (SNMP)
234                    SNMPv2-MIB.sysLocation";
235     }
236
237     container clock {
238       description
239         "Configuration of the system date and time properties.";
240       choice timezone {
241         description
242           "The system time zone information.";
243         case timezone-name {
244           if-feature "timezone-name";
245           leaf timezone-name {
246             type timezone-name;
247             description
248               "The TZ database name to use for the system, such
249                as 'Europe/Stockholm'.";
250           }
251         }
252
253         case timezone-utc-offset {
254           leaf timezone-utc-offset {
255             type int16 {
256               range "-1500 .. 1500";
257             }
258             units "minutes";
259             description
260               "The number of minutes to add to UTC time to
261                identify the time zone for this system.  For example,
262                'UTC - 8:00 hours' would be represented as '-480'.
263                Note that automatic daylight saving time adjustment
264                is not provided if this object is used.";
265           }
266         }
267       }
268     }
269
270     container ntp {
271       if-feature "ntp";
272       presence "Enables the NTP client unless the 'enabled' leaf
273        (which defaults to 'true') is set to 'false'";
274       description
275         "Configuration of the NTP client.";
276       leaf enabled {
277         type boolean;
278         default "true";
279         description
280           "Indicates that the system should attempt to
281            synchronize the system clock with an NTP server
282            from the 'ntp/server' list.";
283       }
284
285       list server {
286         key "name";
287         description
288           "List of NTP servers to use for system clock
289            synchronization.  If '/system/ntp/enabled'
290            is 'true', then the system will attempt to
291            contact and utilize the specified NTP servers.";
292         leaf name {
293           type string;
294           description
295             "An arbitrary name for the NTP server.";
296         }
297
298         choice transport {
299           mandatory true;
300           description
301             "The transport-protocol-specific parameters for this
302              server.";
303           case udp {
304             container udp {
305               description
306                 "Contains UDP-specific configuration parameters
307                  for NTP.";
308               leaf address {
309                 type inet:host;
310                 mandatory true;
311                 description
312                   "The address of the NTP server.";
313               }
314
315               leaf port {
316                 if-feature "ntp-udp-port";
317                 type inet:port-number;
318                 default "123";
319                 description
320                   "The port number of the NTP server.";
321               }
322             }
323           }
324         }
325
326         leaf association-type {
327           type enumeration {
328             enum "server" {
329               description
330                 "Use client association mode.  This device
331                  will not provide synchronization to the
332                  configured NTP server.";
333             }
334             enum "peer" {
335               description
336                 "Use symmetric active association mode.
337                  This device may provide synchronization
338                  to the configured NTP server.";
339             }
340             enum "pool" {
341               description
342                 "Use client association mode with one or
343                  more of the NTP servers found by DNS
344                  resolution of the domain name given by
345                  the 'address' leaf.  This device will not
346                  provide synchronization to the servers.";
347             }
348           }
349           default "server";
350           description
351             "The desired association type for this NTP server.";
352         }
353
354         leaf iburst {
355           type boolean;
356           default "false";
357           description
358             "Indicates whether this server should enable burst
359              synchronization or not.";
360         }
361
362         leaf prefer {
363           type boolean;
364           default "false";
365           description
366             "Indicates whether this server should be preferred
367              or not.";
368         }
369       }
370     }
371
372     container dns-resolver {
373       description
374         "Configuration of the DNS resolver.";
375       leaf-list search {
376         type inet:domain-name;
377         ordered-by user;
378         description
379           "An ordered list of domains to search when resolving
380            a host name.";
381       }
382
383       list server {
384         key "name";
385         ordered-by user;
386         description
387           "List of the DNS servers that the resolver should query.
388
389            When the resolver is invoked by a calling application, it
390            sends the query to the first name server in this list.  If
391            no response has been received within 'timeout' seconds,
392            the resolver continues with the next server in the list.
393            If no response is received from any server, the resolver
394            continues with the first server again.  When the resolver
395            has traversed the list 'attempts' times without receiving
396            any response, it gives up and returns an error to the
397            calling application.
398
399            Implementations MAY limit the number of entries in this
400            list.";
401         leaf name {
402           type string;
403           description
404             "An arbitrary name for the DNS server.";
405         }
406
407         choice transport {
408           mandatory true;
409           description
410             "The transport-protocol-specific parameters for this
411              server.";
412           case udp-and-tcp {
413             container udp-and-tcp {
414               description
415                 "Contains UDP- and TCP-specific configuration
416                  parameters for DNS.";
417               reference
418                 "RFC 1035: Domain Names - Implementation and
419                            Specification
420                  RFC 5966: DNS Transport over TCP - Implementation
421                            Requirements";
422               leaf address {
423                 type inet:ip-address;
424                 mandatory true;
425                 description
426                   "The address of the DNS server.";
427               }
428
429               leaf port {
430                 if-feature "dns-udp-tcp-port";
431                 type inet:port-number;
432                 default "53";
433                 description
434                   "The UDP and TCP port number of the DNS server.";
435               }
436             }
437           }
438         }
439       }
440
441       container options {
442         description
443           "Resolver options.  The set of available options has been
444            limited to those that are generally available across
445            different resolver implementations and generally useful.";
446         leaf timeout {
447           type uint8 {
448             range "1..max";
449           }
450           units "seconds";
451           default "5";
452           description
453             "The amount of time the resolver will wait for a
454              response from each remote name server before
455              retrying the query via a different name server.";
456         }
457
458         leaf attempts {
459           type uint8 {
460             range "1..max";
461           }
462           default "2";
463           description
464             "The number of times the resolver will send a query to
465              all of its name servers before giving up and returning
466              an error to the calling application.";
467         }
468       }
469     }
470
471     container radius {
472       if-feature "radius";
473       description
474         "Configuration of the RADIUS client.";
475       list server {
476         key "name";
477         ordered-by user;
478         description
479           "List of RADIUS servers used by the device.
480
481            When the RADIUS client is invoked by a calling
482            application, it sends the query to the first server in
483            this list.  If no response has been received within
484            'timeout' seconds, the client continues with the next
485            server in the list.  If no response is received from any
486            server, the client continues with the first server again.
487            When the client has traversed the list 'attempts' times
488            without receiving any response, it gives up and returns an
489            error to the calling application.";
490         leaf name {
491           type string;
492           description
493             "An arbitrary name for the RADIUS server.";
494         }
495
496         choice transport {
497           mandatory true;
498           description
499             "The transport-protocol-specific parameters for this
500              server.";
501           case udp {
502             container udp {
503               description
504                 "Contains UDP-specific configuration parameters
505                  for RADIUS.";
506               leaf address {
507                 type inet:host;
508                 mandatory true;
509                 description
510                   "The address of the RADIUS server.";
511               }
512
513               leaf authentication-port {
514                 type inet:port-number;
515                 default "1812";
516                 description
517                   "The port number of the RADIUS server.";
518               }
519
520               leaf shared-secret {
521                 nacm:default-deny-all;
522                 type string;
523                 mandatory true;
524                 description
525                   "The shared secret, which is known to both the
526                    RADIUS client and server.";
527                 reference
528                   "RFC 2865: Remote Authentication Dial In User
529                              Service (RADIUS)";
530               }
531             }
532           }
533         }
534
535         leaf authentication-type {
536           type identityref {
537             base radius-authentication-type;
538           }
539           default "radius-pap";
540           description
541             "The authentication type requested from the RADIUS
542              server.";
543         }
544       }
545
546       container options {
547         description
548           "RADIUS client options.";
549         leaf timeout {
550           type uint8 {
551             range "1..max";
552           }
553           units "seconds";
554           default "5";
555           description
556             "The number of seconds the device will wait for a
557              response from each RADIUS server before trying with a
558              different server.";
559         }
560
561         leaf attempts {
562           type uint8 {
563             range "1..max";
564           }
565           default "2";
566           description
567             "The number of times the device will send a query to
568              all of its RADIUS servers before giving up.";
569         }
570       }
571     }
572
573     container authentication {
574       nacm:default-deny-write;
575       if-feature "authentication";
576       description
577         "The authentication configuration subtree.";
578       leaf-list user-authentication-order {
579         type identityref {
580           base authentication-method;
581         }
582         must "(. != \"sys:radius\" or ../../radius/server)" {
583           error-message
584             "When 'radius' is used, a RADIUS server must be configured.";
585           description
586             "When 'radius' is used as an authentication method,
587              a RADIUS server must be configured.";
588         }
589         ordered-by user;
590         description
591           "When the device authenticates a user with a password,
592            it tries the authentication methods in this leaf-list in
593            order.  If authentication with one method fails, the next
594            method is used.  If no method succeeds, the user is
595            denied access.
596
597            An empty user-authentication-order leaf-list still allows
598            authentication of users using mechanisms that do not
599            involve a password.
600
601            If the 'radius-authentication' feature is advertised by
602            the NETCONF server, the 'radius' identity can be added to
603            this list.
604
605            If the 'local-users' feature is advertised by the
606            NETCONF server, the 'local-users' identity can be
607            added to this list.";
608       }
609
610       list user {
611         if-feature "local-users";
612         key "name";
613         description
614           "The list of local users configured on this device.";
615         leaf name {
616           type string;
617           description
618             "The user name string identifying this entry.";
619         }
620
621         leaf password {
622           type ianach:crypt-hash;
623           description
624             "The password for this entry.";
625         }
626
627         list authorized-key {
628           key "name";
629           description
630             "A list of public SSH keys for this user.  These keys
631              are allowed for SSH authentication, as described in
632              RFC 4253.";
633           reference
634             "RFC 4253: The Secure Shell (SSH) Transport Layer
635                        Protocol";
636           leaf name {
637             type string;
638             description
639               "An arbitrary name for the SSH key.";
640           }
641
642           leaf algorithm {
643             type string;
644             mandatory true;
645             description
646               "The public key algorithm name for this SSH key.
647
648                Valid values are the values in the IANA 'Secure Shell
649                (SSH) Protocol Parameters' registry, Public Key
650                Algorithm Names.";
651             reference
652               "IANA 'Secure Shell (SSH) Protocol Parameters'
653                registry, Public Key Algorithm Names";
654           }
655
656           leaf key-data {
657             type binary;
658             mandatory true;
659             description
660               "The binary public key data for this SSH key, as
661                specified by RFC 4253, Section 6.6, i.e.:
662
663                  string    certificate or public key format
664                            identifier
665                  byte[n]   key/certificate data.";
666             reference
667               "RFC 4253: The Secure Shell (SSH) Transport Layer
668                          Protocol";
669           }
670         }
671       }
672     }
673   }
674
675   container system-state {
676     config false;
677     description
678       "System group operational state.";
679     container platform {
680       description
681         "Contains vendor-specific information for
682          identifying the system platform and operating system.";
683       reference
684         "IEEE Std 1003.1-2008 - sys/utsname.h";
685       leaf os-name {
686         type string;
687         description
688           "The name of the operating system in use -
689            for example, 'Linux'.";
690         reference
691           "IEEE Std 1003.1-2008 - utsname.sysname";
692       }
693
694       leaf os-release {
695         type string;
696         description
697           "The current release level of the operating
698            system in use.  This string MAY indicate
699            the OS source code revision.";
700         reference
701           "IEEE Std 1003.1-2008 - utsname.release";
702       }
703
704       leaf os-version {
705         type string;
706         description
707           "The current version level of the operating
708            system in use.  This string MAY indicate
709            the specific OS build date and target variant
710            information.";
711         reference
712           "IEEE Std 1003.1-2008 - utsname.version";
713       }
714
715       leaf machine {
716         type string;
717         description
718           "A vendor-specific identifier string representing
719            the hardware in use.";
720         reference
721           "IEEE Std 1003.1-2008 - utsname.machine";
722       }
723     }
724
725     container clock {
726       description
727         "Monitoring of the system date and time properties.";
728       leaf current-datetime {
729         type yang:date-and-time;
730         description
731           "The current system date and time.";
732       }
733
734       leaf boot-datetime {
735         type yang:date-and-time;
736         description
737           "The system date and time when the system last restarted.";
738       }
739     }
740   }
741
742   rpc set-current-datetime {
743     nacm:default-deny-all;
744     description
745       "Set the /system-state/clock/current-datetime leaf
746        to the specified value.
747
748        If the system is using NTP (i.e., /system/ntp/enabled
749        is set to 'true'), then this operation will fail with
750        error-tag 'operation-failed' and error-app-tag value of
751        'ntp-active'.";
752     input { 
753       leaf current-datetime {
754         type yang:date-and-time;
755         mandatory true;
756         description
757           "The current system date and time.";
758       }
759     }
760   }
761
762   rpc system-restart {
763     nacm:default-deny-all;
764     description
765       "Request that the entire system be restarted immediately.
766        A server SHOULD send an rpc reply to the client before
767        restarting the system.";
768   }
769
770   rpc system-shutdown {
771     nacm:default-deny-all;
772     description
773       "Request that the entire system be shut down immediately.
774        A server SHOULD send an rpc reply to the client before
775        shutting down the system.";
776   }
777 }
778 </data>
779 </rpc-reply>