4824e341ec8435d77e5f73c0f1bbab76cb65cc04
[transportpce.git] / tests / honeynode / 2.2.1 / honeynode-plugin-impl / src / main / resources / honeycomb-minimal-resources / config / yang / openconfig / openconfig-alarms@2018-01-16.yang
1 module openconfig-alarms {
2
3   yang-version "1";
4
5   // namespace
6   namespace "http://openconfig.net/yang/alarms";
7
8   prefix "oc-alarms";
9
10   // import some basic types
11   import openconfig-alarm-types { prefix oc-alarm-types; }
12   import openconfig-extensions { prefix oc-ext; }
13   import openconfig-types { prefix oc-types; }
14   import openconfig-platform { prefix oc-platform; }
15
16   // meta
17   organization "OpenConfig working group";
18
19   contact
20     "OpenConfig working group
21     www.openconfig.net";
22
23   description
24     "This module defines operational state data related to alarms
25     that the device is reporting.
26
27     This model reuses some data items defined in the draft IETF
28     YANG Alarm Module:
29     https://tools.ietf.org/html/draft-vallin-netmod-alarm-module-02
30
31     Portions of this code were derived from the draft IETF YANG Alarm
32     Module. Please reproduce this note if possible.
33
34     IETF code is subject to the following copyright and license:
35     Copyright (c) IETF Trust and the persons identified as authors of
36     the code.
37     All rights reserved.
38
39     Redistribution and use in source and binary forms, with or without
40     modification, is permitted pursuant to, and subject to the license
41     terms contained in, the Simplified BSD License set forth in
42     Section 4.c of the IETF Trust's Legal Provisions Relating
43     to IETF Documents (http://trustee.ietf.org/license-info).";
44
45   oc-ext:openconfig-version "0.3.0";
46
47   revision "2018-01-16" {
48       description
49         "Moved alarm identities into separate types module";
50       reference "0.3.0";
51   }
52
53   revision "2018-01-10" {
54     description
55       "Make alarms list read only";
56     reference "0.2.0";
57   }
58
59   revision "2017-08-24" {
60     description
61       "Initial public release";
62     reference "0.1.0";
63   }
64
65
66   // grouping statements
67
68   grouping alarm-state {
69     description
70       "Operational state data for device alarms";
71
72     leaf id {
73       type string;
74       description
75         "Unique ID for the alarm -- this will not be a
76         configurable parameter on many implementations";
77     }
78
79     leaf resource {
80       type string;
81       description
82         "The item that is under alarm within the device. The
83         resource may be a reference to an item which is
84         defined elsewhere in the model. For example, it
85         may be a platform/component, interfaces/interface,
86         terminal-device/logical-channels/channel, etc. In this
87         case the system should match the name of the referenced
88         item exactly. The referenced item could alternatively be
89         the path of the item within the model.";
90       reference
91         "IETF YANG Alarm Module: Draft - typedef resource
92         https://tools.ietf.org/html/draft-vallin-netmod-alarm-module-02";
93     }
94
95     leaf text {
96       type string;
97       description
98         "The string used to inform operators about the alarm. This
99          MUST contain enough information for an operator to be able
100          to understand the problem. If this string contains structure,
101          this format should be clearly documented for programs to be
102          able to parse that information";
103       reference
104         "IETF YANG Alarm Module: Draft - typedef alarm-text
105         https://tools.ietf.org/html/draft-vallin-netmod-alarm-module-02";
106     }
107
108     leaf time-created {
109       type oc-types:timeticks64;
110       description
111         "The time at which the alarm was raised by the system.
112         This value is expressed as nanoseconds since the Unix Epoch";
113     }
114
115     leaf severity {
116       type identityref {
117         base oc-alarm-types:OPENCONFIG_ALARM_SEVERITY;
118       }
119       description
120         "The severity level indicating the criticality and impact
121         of the alarm";
122       reference
123         "IETF YANG Alarm Module: Draft - typedef severity
124         https://tools.ietf.org/html/draft-vallin-netmod-alarm-module-02";
125     }
126
127     leaf type-id {
128       type union {
129         type string;
130         type identityref {
131           base oc-alarm-types:OPENCONFIG_ALARM_TYPE_ID;
132         }
133       }
134       description
135         "The abbreviated name of the alarm, for example LOS,
136         EQPT, or OTS. Also referred to in different systems as
137         condition type, alarm identifier, or alarm mnemonic. It
138         is recommended to use the OPENCONFIG_ALARM_TYPE_ID
139         identities where possible and only use the string type
140         when the desired identityref is not yet defined";
141       reference
142         "IETF YANG Alarm Module: Draft - typedef alarm-type-id
143         https://tools.ietf.org/html/draft-vallin-netmod-alarm-module-02";
144     }
145   }
146
147   grouping alarm-config {
148     description
149       "Configuration data for device alarms";
150   }
151
152   grouping alarms-top {
153     description
154       "Top-level grouping for device alarms";
155
156     container alarms {
157       description
158         "Top-level container for device alarms";
159
160       config false;
161
162       list alarm {
163         key "id";
164         description
165           "List of alarms, keyed by a unique id";
166
167         leaf id {
168           type leafref {
169             path "../state/id";
170           }
171
172           description
173             "References the unique alarm id";
174         }
175
176         container config {
177           description
178             "Configuration data for each alarm";
179
180           uses alarm-config;
181         }
182
183         container state {
184           config false;
185
186           description
187             "Operational state data for a device alarm";
188
189           uses alarm-config;
190           uses alarm-state;
191         }
192       }
193     }
194   }
195
196
197   // augments
198
199   augment "/oc-platform:components/oc-platform:component/oc-platform:state" {
200     description
201       "Adds specific alarms related to a component.";
202
203     leaf equipment-failure {
204       type boolean;
205       default "false";
206       description
207         "If true, the hardware indicates that the component's physical equipment
208         has failed";
209     }
210
211     leaf equipment-mismatch {
212       type boolean;
213       default "false";
214       description
215         "If true, the hardware indicates that the component inserted into the
216         affected component's physical location is of a different type than what
217         is configured";
218     }
219   }
220
221 }