Initial version of the Python simulator
[sim/o1-ofhmp-interfaces.git] / ietf-microwave / docker / yang / ietf-alarms-x733.yang
1 module ietf-alarms-x733 {
2   yang-version 1.1;
3   namespace "urn:ietf:params:xml:ns:yang:ietf-alarms-x733";
4   prefix x733;
5
6   import ietf-alarms {
7     prefix al;
8   }
9   import ietf-yang-types {
10     prefix yang;
11     reference
12       "RFC 6991: Common YANG Data Types";
13   }
14
15   organization
16     "IETF CCAMP Working Group";
17   contact
18     "WG Web:   <https://trac.ietf.org/trac/ccamp>
19      WG List:  <mailto:ccamp@ietf.org>
20
21      Editor:   Stefan Vallin
22                <mailto:stefan@wallan.se>
23
24      Editor:   Martin Bjorklund
25                <mailto:mbj@tail-f.com>";
26   description
27     "This module augments the ietf-alarms module with X.733 alarm
28      parameters.
29
30      The following structures are augmented with the X.733 event type
31      and probable cause:
32
33       1) alarms/alarm-inventory: all possible alarm types
34       2) alarms/alarm-list: every alarm in the system
35       3) alarm-notification: notifications indicating alarm-state
36          changes
37       4) alarms/shelved-alarms
38
39      The module also optionally allows the alarm-management system
40      to configure the mapping from the ietf-alarms' alarm keys
41      to the ITU tuple (event-type, probable-cause).
42
43      The mapping does not include a corresponding problem value
44      specific to X.733.  The recommendation is to use the
45      'alarm-type-qualifier' leaf, which serves the same purpose.
46
47      The module uses an integer and a corresponding string for
48      probable cause instead of a globally defined enumeration, in
49      order to be able to manage conflicting enumeration definitions.
50      A single globally defined enumeration is challenging to
51      maintain.
52
53      The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
54      NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED',
55      'MAY', and 'OPTIONAL' in this document are to be interpreted as
56      described in BCP 14 (RFC 2119) (RFC 8174) when, and only when,
57      they appear in all capitals, as shown here.
58
59      Copyright (c) 2019 IETF Trust and the persons identified as
60      authors of the code.  All rights reserved.
61
62      Redistribution and use in source and binary forms, with or
63      without modification, is permitted pursuant to, and subject to
64      the license terms contained in, the Simplified BSD License set
65      forth in Section 4.c of the IETF Trust's Legal Provisions
66      Relating to IETF Documents
67      (https://trustee.ietf.org/license-info).
68
69      This version of this YANG module is part of RFC 8632; see
70      the RFC itself for full legal notices.";
71   reference
72     "ITU-T Recommendation X.733: Information Technology
73        - Open Systems Interconnection
74        - System Management: Alarm Reporting Function";
75
76   revision 2019-09-11 {
77     description
78       "Initial revision.";
79     reference
80       "RFC 8632: A YANG Data Model for Alarm Management";
81   }
82
83   /*
84    * Features
85    */
86
87   feature configure-x733-mapping {
88     description
89       "The system supports configurable X733 mapping from
90        the ietf-alarms' alarm-type to X733 event-type
91        and probable-cause.";
92   }
93
94   /*
95    * Typedefs
96    */
97
98   typedef event-type {
99     type enumeration {
100       enum other {
101         value 1;
102         description
103           "None of the below.";
104       }
105       enum communications-alarm {
106         value 2;
107         description
108           "An alarm of this type is principally associated with the
109            procedures and/or processes required to convey
110            information from one point to another.";
111       }
112       enum quality-of-service-alarm {
113         value 3;
114         description
115           "An alarm of this type is principally associated with a
116            degradation in the quality of a service.";
117       }
118       enum processing-error-alarm {
119         value 4;
120         description
121           "An alarm of this type is principally associated with a
122            software or processing fault.";
123       }
124       enum equipment-alarm {
125         value 5;
126         description
127           "An alarm of this type is principally associated with an
128            equipment fault.";
129       }
130       enum environmental-alarm {
131         value 6;
132         description
133           "An alarm of this type is principally associated with a
134            condition relating to an enclosure in which the equipment
135            resides.";
136       }
137       enum integrity-violation {
138         value 7;
139         description
140           "An indication that information may have been illegally
141            modified, inserted, or deleted.";
142       }
143       enum operational-violation {
144         value 8;
145         description
146           "An indication that the provision of the requested service
147            was not possible due to the unavailability, malfunction,
148            or incorrect invocation of the service.";
149       }
150       enum physical-violation {
151         value 9;
152         description
153           "An indication that a physical resource has been violated
154            in a way that suggests a security attack.";
155       }
156       enum security-service-or-mechanism-violation {
157         value 10;
158         description
159           "An indication that a security attack has been detected by
160            a security service or mechanism.";
161       }
162       enum time-domain-violation {
163         value 11;
164         description
165           "An indication that an event has occurred at an unexpected
166            or prohibited time.";
167       }
168     }
169     description
170       "The event types as defined by X.733 and X.736.";
171     reference
172       "ITU-T Recommendation X.733: Information Technology
173          - Open Systems Interconnection
174          - System Management: Alarm Reporting Function
175        ITU-T Recommendation X.736: Information Technology
176          - Open Systems Interconnection
177          - System Management: Security Alarm Reporting Function";
178   }
179
180   typedef trend {
181     type enumeration {
182       enum less-severe {
183         description
184           "There is at least one outstanding alarm of a
185            severity higher (more severe) than that in the
186            current alarm.";
187       }
188       enum no-change {
189         description
190           "The Perceived severity reported in the current
191            alarm is the same as the highest (most severe)
192            of any of the outstanding alarms";
193       }
194       enum more-severe {
195         description
196           "The Perceived severity in the current alarm is
197            higher (more severe) than that reported in any
198            of the outstanding alarms.";
199       }
200     }
201     description
202       "This type is used to describe the
203        severity trend of the alarming resource.";
204     reference
205       "ITU-T Recommendation X.721: Information Technology
206           - Open Systems Interconnection
207           - Structure of management information:
208             Definition of management information
209             Module Attribute-ASN1Module";
210   }
211
212   typedef value-type {
213     type union {
214       type int64;
215       type uint64;
216       type decimal64 {
217         fraction-digits 2;
218       }
219     }
220     description
221       "A generic union type to match the ITU choice of
222        integer and real.";
223   }
224
225   /*
226    * Groupings
227    */
228
229   grouping x733-alarm-parameters {
230     description
231       "Common X.733 parameters for alarms.";
232     leaf event-type {
233       type event-type;
234       description
235         "The X.733/X.736 event type for this alarm.";
236     }
237     leaf probable-cause {
238       type uint32;
239       description
240         "The X.733 probable cause for this alarm.";
241     }
242     leaf probable-cause-string {
243       type string;
244       description
245         "The user-friendly string matching
246          the probable cause integer value.  The string
247          SHOULD match the X.733 enumeration.  For example,
248          value 27 is 'localNodeTransmissionError'.";
249     }
250     container threshold-information {
251       description
252         "This parameter shall be present when the alarm
253          is a result of crossing a threshold. ";
254       leaf triggered-threshold {
255         type string;
256         description
257           "The identifier of the threshold attribute that
258            caused the notification.";
259       }
260       leaf observed-value {
261         type value-type;
262         description
263           "The value of the gauge or counter that crossed
264            the threshold.  This may be different from the
265            threshold value if, for example, the gauge may
266            only take on discrete values.";
267       }
268       choice threshold-level {
269         description
270           "In the case of a gauge, the threshold level specifies
271            a pair of threshold values: the first is the value
272            of the crossed threshold, and the second is its
273            corresponding hysteresis; in the case of a counter,
274            the threshold level specifies only the threshold
275            value.";
276         case up {
277           leaf up-high {
278             type value-type;
279             description
280               "The going-up threshold for raising the alarm.";
281           }
282           leaf up-low {
283             type value-type;
284             description
285               "The going-down threshold for clearing the alarm.
286                This is used for hysteresis functions for gauges.";
287           }
288         }
289         case down {
290           leaf down-low {
291             type value-type;
292             description
293               "The going-down threshold for raising the alarm.";
294           }
295           leaf down-high {
296             type value-type;
297             description
298               "The going-up threshold for clearing the alarm.
299                This is used for hysteresis functions for gauges.";
300           }
301         }
302       }
303       leaf arm-time {
304         type yang:date-and-time;
305         description
306           "For a gauge threshold, it's the time at which the
307            threshold was last re-armed; namely, it's the time after
308            the previous threshold crossing at which the hysteresis
309            value of the threshold was exceeded, thus again permitting
310            the generation of notifications when the threshold is
311            crossed.  For a counter threshold, it's the later of the
312            time at which the threshold offset was last applied or the
313            counter was last initialized (for resettable counters).";
314       }
315     }
316     list monitored-attributes {
317       uses attribute;
318       key "id";
319       description
320         "The Monitored attributes parameter, when present, defines
321          one or more attributes of the resource and their
322          corresponding values at the time of the alarm.";
323     }
324     leaf-list proposed-repair-actions {
325       type string;
326       description
327         "This parameter, when present, is used if the cause is
328          known and the system being managed can suggest one or
329          more solutions (such as switch in standby equipment,
330          retry, and replace media).";
331     }
332     leaf trend-indication {
333       type trend;
334       description
335         "This parameter specifies the current severity
336          trend of the resource.  If present, it indicates
337          that there are one or more alarms ('outstanding
338          alarms') that have not been cleared and that
339          pertain to the same resource as this alarm
340          ('current alarm') does.  The possible values are:
341
342            more-severe: The Perceived severity in the current
343              alarm is higher (more severe) than that reported in
344              any of the outstanding alarms.
345
346            no-change: The Perceived severity reported in the
347              current alarm is the same as the highest (most severe)
348              of any of the outstanding alarms.
349
350            less-severe: There is at least one outstanding alarm
351              of a severity higher (more severe) than that in the
352              current alarm.";
353     }
354     leaf backedup-status {
355       type boolean;
356       description
357         "This parameter, when present, specifies whether or not the
358          object emitting the alarm has been backed up; therefore, it
359          is possible to know whether or not services provided to the
360          user have been disrupted when this parameter is included.
361          The use of this field in conjunction with the
362          'perceived-severity' field provides information in an
363          independent form to qualify the seriousness of the alarm and
364          the ability of the system as a whole to continue to provide
365          services.  If the value of this parameter is true, it
366          indicates that the object emitting the alarm has been backed
367          up; if false, the object has not been backed up.";
368     }
369     leaf backup-object {
370       type al:resource;
371       description
372         "This parameter SHALL be present when the 'backedup-status'
373          parameter is present and has the value 'true'.  This
374          parameter specifies the managed object instance that is
375          providing back-up services for the managed object to which
376          the notification pertains.  This parameter is useful, for
377          example, when the back-up object is from a pool of objects,
378          any of which may be dynamically allocated to replace a
379          faulty object.";
380     }
381     list additional-information {
382       key "identifier";
383       description
384         "This parameter allows the inclusion of an additional
385          information set in the alarm.  It is a series of data
386          structures, each of which contains three items of
387          information: an identifier, a significance indicator,
388          and the problem information.";
389       leaf identifier {
390         type string;
391         description
392           "Identifies the data type of the information parameter.";
393       }
394       leaf significant {
395         type boolean;
396         description
397           "Set to 'true' if the receiving system must be able to
398            parse the contents of the information subparameter
399            for the event report to be fully understood.";
400       }
401       leaf information {
402         type string;
403         description
404           "Additional information about the alarm.";
405       }
406     }
407     leaf security-alarm-detector {
408       type al:resource;
409       description
410         "This parameter identifies the detector of the security
411          alarm.";
412     }
413     leaf service-user {
414       type al:resource;
415       description
416         "This parameter identifies the service-user whose request
417          for service led to the generation of the security alarm.";
418     }
419     leaf service-provider {
420       type al:resource;
421       description
422         "This parameter identifies the intended service-provider
423          of the service that led to the generation of the security
424          alarm.";
425     }
426     reference
427       "ITU-T Recommendation X.733: Information Technology
428          - Open Systems Interconnection
429          - System Management: Alarm Reporting Function
430        ITU-T Recommendation X.736: Information Technology
431          - Open Systems Interconnection
432          - System Management: Security Alarm Reporting Function";
433   }
434
435   grouping x733-alarm-definition-parameters {
436     description
437       "Common X.733 parameters for alarm definitions.
438        This grouping is used to define those alarm
439        attributes that can be mapped from the alarm-type
440        mechanism in the ietf-alarms module.";
441     leaf event-type {
442       type event-type;
443       description
444         "The alarm type has this X.733/X.736 event type.";
445     }
446     leaf probable-cause {
447       type uint32;
448       description
449         "The alarm type has this X.733 probable cause value.
450          This module defines probable cause as an integer
451          and not as an enumeration.  The reason being that the
452          primary use of probable cause is in the management
453          application if it is based on the X.733 standard.
454          However, most management applications have their own
455          defined enum definitions and merging enums from
456          different systems might create conflicts.  By using
457          a configurable uint32, the system can be configured
458          to match the enum values in the management application.";
459     }
460     leaf probable-cause-string {
461       type string;
462       description
463         "This string can be used to give a user-friendly string
464          to the probable cause value.";
465     }
466   }
467
468   grouping attribute {
469     description
470       "A grouping to match the ITU generic reference to
471        an attribute.";
472     leaf id {
473       type al:resource;
474       description
475         "The resource representing the attribute.";
476     }
477     leaf value {
478       type string;
479       description
480         "The value represented as a string since it could
481          be of any type.";
482     }
483     reference
484       "ITU-T Recommendation X.721: Information Technology
485           - Open Systems Interconnection
486           - Structure of management information:
487             Definition of management information
488        Module Attribute-ASN1Module";
489   }
490
491   /*
492    * Add X.733 parameters to the alarm definitions, alarms,
493    * and notification.
494    */
495
496   augment "/al:alarms/al:alarm-inventory/al:alarm-type" {
497     description
498       "Augment X.733 mapping information to the alarm inventory.";
499     uses x733-alarm-definition-parameters;
500   }
501
502   /*
503    * Add X.733 configurable mapping.
504    */
505
506   augment "/al:alarms/al:control" {
507     description
508       "Add X.733 mapping capabilities. ";
509     list x733-mapping {
510       if-feature "configure-x733-mapping";
511       key "alarm-type-id alarm-type-qualifier-match";
512       description
513         "This list allows a management application to control the
514          X.733 mapping for all alarm types in the system.  Any entry
515          in this list will allow the alarm manager to override the
516          default X.733 mapping in the system, and the final mapping
517          will be shown in the alarm inventory.";
518       leaf alarm-type-id {
519         type al:alarm-type-id;
520         description
521           "Map the alarm type with this alarm type identifier.";
522       }
523       leaf alarm-type-qualifier-match {
524         type string;
525         description
526           "A W3C regular expression that is used when mapping an
527            alarm type and alarm-type-qualifier to X.733 parameters.";
528       }
529       uses x733-alarm-definition-parameters;
530     }
531   }
532
533   augment "/al:alarms/al:alarm-list/al:alarm" {
534     description
535       "Augment X.733 information to the alarm.";
536     uses x733-alarm-parameters;
537   }
538
539   augment "/al:alarms/al:shelved-alarms/al:shelved-alarm" {
540     description
541       "Augment X.733 information to the alarm.";
542     uses x733-alarm-parameters;
543   }
544
545   augment "/al:alarm-notification" {
546     description
547       "Augment X.733 information to the alarm notification.";
548     uses x733-alarm-parameters;
549   }
550 }