xref: /openbmc/bmcweb/features/redfish/include/registries/network_device_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 NetworkDevice
23 {
24 static constexpr Header header = {
25     "Copyright 2019-2023 DMTF. All rights reserved.",
26     "#MessageRegistry.v1_6_2.MessageRegistry",
27     1,
28     0,
29     3,
30     "Network Device Message Registry",
31     "en",
32     "This registry defines the messages for networking devices.",
33     "NetworkDevice",
34     "DMTF",
35 };
36 
37 static constexpr const char* url =
38     "https://redfish.dmtf.org/registries/NetworkDevice.1.0.3.json";
39 
40 static constexpr std::array registry =
41 {
42     MessageEntry{
43         "CableInserted",
44         {
45             "Indicates that a network cable was inserted.",
46             "A network cable was inserted into network adapter '%1' port '%2'.",
47             "OK",
48             2,
49             {
50                 "string",
51                 "string",
52             },
53             "None.",
54         }},
55     MessageEntry{
56         "CableRemoved",
57         {
58             "Indicates that a network cable was removed.",
59             "A cable was removed from network adapter '%1' port '%2'.",
60             "OK",
61             2,
62             {
63                 "string",
64                 "string",
65             },
66             "None.",
67         }},
68     MessageEntry{
69         "ConnectionDropped",
70         {
71             "Indicates that a network connection was dropped.",
72             "The connection is no longer active for network adapter '%1' port '%2' function '%3'.",
73             "OK",
74             3,
75             {
76                 "string",
77                 "string",
78                 "string",
79             },
80             "None.",
81         }},
82     MessageEntry{
83         "ConnectionEstablished",
84         {
85             "Indicates that a network connection was established.",
86             "A network connection was established for network adapter '%1' port '%2' function '%3'.",
87             "OK",
88             3,
89             {
90                 "string",
91                 "string",
92                 "string",
93             },
94             "None.",
95         }},
96     MessageEntry{
97         "DegradedConnectionEstablished",
98         {
99             "Indicates that a network connection was established, but at an unexpectedly low link speed.",
100             "A degraded network connection was established for network adapter '%1' port '%2' function '%3'.",
101             "Warning",
102             3,
103             {
104                 "string",
105                 "string",
106                 "string",
107             },
108             "None.",
109         }},
110     MessageEntry{
111         "LinkFlapDetected",
112         {
113             "Indicates that a network connection is highly unstable.",
114             "The network connection for network adapter '%1' port '%2' function '%3' was established and dropped '%4' times in the last '%5' minutes.",
115             "Warning",
116             5,
117             {
118                 "string",
119                 "string",
120                 "string",
121                 "number",
122                 "number",
123             },
124             "Contact the network administrator for problem resolution.",
125         }},
126 
127 };
128 
129 enum class Index
130 {
131     cableInserted = 0,
132     cableRemoved = 1,
133     connectionDropped = 2,
134     connectionEstablished = 3,
135     degradedConnectionEstablished = 4,
136     linkFlapDetected = 5,
137 };
138 }; // struct network_device
139 
140 [[gnu::constructor]] inline void registerNetworkDevice()
141 { registerRegistry<NetworkDevice>(); }
142 
143 } // namespace redfish::registries
144