xref: /openbmc/bmcweb/redfish-core/include/registries/telemetry_message_registry.hpp (revision 4a102cd48c588d32c0a4d6610b4a9ed616f255f3)
1 // SPDX-License-Identifier: Apache-2.0
2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors
3 #pragma once
4 /****************************************************************
5  *                 READ THIS WARNING FIRST
6  * This is an auto-generated header which contains definitions
7  * for Redfish DMTF defined messages.
8  * DO NOT modify this registry outside of running the
9  * parse_registries.py script.  The definitions contained within
10  * this file are owned by DMTF.  Any modifications to these files
11  * should be first pushed to the relevant registry in the DMTF
12  * github organization.
13  ***************************************************************/
14 #include "registries.hpp"
15 
16 #include <array>
17 
18 // clang-format off
19 
20 namespace redfish::registries
21 {
22 struct Telemetry
23 {
24 static constexpr Header header = {
25     "Copyright 2023 DMTF. All rights reserved.",
26     "#MessageRegistry.v1_6_2.MessageRegistry",
27     1,
28     0,
29     0,
30     "Telemetry Message Registry",
31     "en",
32     "This registry defines the messages for telemetry related events.",
33     "Telemetry",
34     "DMTF",
35 };
36 
37 static constexpr const char* url =
38     "https://redfish.dmtf.org/registries/Telemetry.1.0.0.json";
39 
40 static constexpr std::array registry =
41 {
42     MessageEntry{
43         "TriggerDiscreteConditionMet",
44         {
45             "Indicates that a discrete trigger condition is met.",
46             "Metric '%1' has the value '%2', which meets the discrete condition of trigger '%3'",
47             "OK",
48             3,
49             {
50                 "string",
51                 "string",
52                 "string",
53             },
54             "Check the condition of the metric that reported the trigger.",
55         }},
56     MessageEntry{
57         "TriggerNumericAboveLowerCritical",
58         {
59             "Indicates that a numeric metric reading is no longer below the lower critical trigger threshold, but is still outside of normal operating range.",
60             "Metric '%1' value of %2 is now above the %3 lower critical threshold of trigger '%4' but remains outside of normal range",
61             "Warning",
62             4,
63             {
64                 "string",
65                 "number",
66                 "number",
67                 "string",
68             },
69             "Check the condition of the metric that reported the trigger.",
70         }},
71     MessageEntry{
72         "TriggerNumericAboveUpperCritical",
73         {
74             "Indicates that a numeric metric reading is above the upper critical trigger threshold.",
75             "Metric '%1' value of %2 is above the %3 upper critical threshold of trigger '%4'",
76             "Critical",
77             4,
78             {
79                 "string",
80                 "number",
81                 "number",
82                 "string",
83             },
84             "Check the condition of the metric that reported the trigger.",
85         }},
86     MessageEntry{
87         "TriggerNumericAboveUpperWarning",
88         {
89             "Indicates that a numeric metric reading is above the upper warning trigger threshold.",
90             "Metric '%1' value of %2 is above the %3 upper warning threshold of trigger '%4'",
91             "Warning",
92             4,
93             {
94                 "string",
95                 "number",
96                 "number",
97                 "string",
98             },
99             "Check the condition of the metric that reported the trigger.",
100         }},
101     MessageEntry{
102         "TriggerNumericBelowLowerCritical",
103         {
104             "Indicates that a numeric metric reading is below the lower critical trigger threshold.",
105             "Metric '%1' value of %2 is below the %3 lower critical threshold of trigger '%4'",
106             "Critical",
107             4,
108             {
109                 "string",
110                 "number",
111                 "number",
112                 "string",
113             },
114             "Check the condition of the metric that reported the trigger.",
115         }},
116     MessageEntry{
117         "TriggerNumericBelowLowerWarning",
118         {
119             "Indicates that a numeric metric reading is below the lower warning trigger threshold.",
120             "Metric '%1' value of %2 is below the %3 lower warning threshold of trigger '%4'",
121             "Warning",
122             4,
123             {
124                 "string",
125                 "number",
126                 "number",
127                 "string",
128             },
129             "Check the condition of the metric that reported the trigger.",
130         }},
131     MessageEntry{
132         "TriggerNumericBelowUpperCritical",
133         {
134             "Indicates that a numeric metric reading is no longer above the upper critical trigger threshold, but is still outside of normal operating range.",
135             "Metric '%1' value of %2 is now below the %3 upper critical threshold of trigger '%4' but remains outside of normal range",
136             "Warning",
137             4,
138             {
139                 "string",
140                 "number",
141                 "number",
142                 "string",
143             },
144             "Check the condition of the metric that reported the trigger.",
145         }},
146     MessageEntry{
147         "TriggerNumericReadingNormal",
148         {
149             "Indicates that a numeric metric reading is now within normal operating range.",
150             "Metric '%1' value of %2 is within normal operating range of trigger '%3'",
151             "OK",
152             3,
153             {
154                 "string",
155                 "number",
156                 "string",
157             },
158             "None.",
159         }},
160 
161 };
162 
163 enum class Index
164 {
165     triggerDiscreteConditionMet = 0,
166     triggerNumericAboveLowerCritical = 1,
167     triggerNumericAboveUpperCritical = 2,
168     triggerNumericAboveUpperWarning = 3,
169     triggerNumericBelowLowerCritical = 4,
170     triggerNumericBelowLowerWarning = 5,
171     triggerNumericBelowUpperCritical = 6,
172     triggerNumericReadingNormal = 7,
173 };
174 }; // struct telemetry
175 
registerTelemetry()176 [[gnu::constructor]] inline void registerTelemetry()
177 { registerRegistry<Telemetry>(); }
178 
179 } // namespace redfish::registries
180