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