xref: /openbmc/bmcweb/redfish-core/include/registries/composition_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 Composition
23 {
24 static constexpr Header header = {
25     "Copyright 2019-2023 DMTF. All rights reserved.",
26     "#MessageRegistry.v1_6_2.MessageRegistry",
27     1,
28     1,
29     2,
30     "Composition Message Registry",
31     "en",
32     "This registry defines the messages for composition related events.",
33     "Composition",
34     "DMTF",
35 };
36 
37 static constexpr const char* url =
38     "https://redfish.dmtf.org/registries/Composition.1.1.2.json";
39 
40 static constexpr std::array registry =
41 {
42     MessageEntry{
43         "ConstrainedResourceAlreadyReserved",
44         {
45             "Indicates that the requested resources are already reserved in response to a constrained composition request.",
46             "The requested resources are reserved under reservation '%1'.",
47             "Critical",
48             1,
49             {
50                 "string",
51             },
52             "Delete the reservation containing the resources and resubmit the request.",
53         }},
54     MessageEntry{
55         "EmptyManifest",
56         {
57             "Indicates that the manifest contains no stanzas or that a stanza in the manifest contains no request.",
58             "The provided manifest is empty or a stanza in the manifest contains no request.",
59             "Warning",
60             0,
61             {},
62             "Provide a request content for the manifest and resubmit.",
63         }},
64     MessageEntry{
65         "IncompatibleZone",
66         {
67             "Indicates that not all referenced resource blocks are in the same resource zone.",
68             "The requested resource blocks span multiple resource zones.",
69             "Critical",
70             0,
71             {},
72             "Request resource blocks from the same resource zone.",
73         }},
74     MessageEntry{
75         "NoResourceMatch",
76         {
77             "Indicates that the service could not find a matching resource based on the given parameters.",
78             "The requested resources of type '%1' are not available for allocation.",
79             "Critical",
80             1,
81             {
82                 "string",
83             },
84             "Change parameters associated with the resource, such as quantity or performance, and resubmit the request.",
85         }},
86     MessageEntry{
87         "ResourceBlockChanged",
88         {
89             "Indicates that a resource block has changed.  This is not used whenever there is another event message for that specific change, such as when only the state has changed.",
90             "Resource block '%1' has changed on the service.",
91             "OK",
92             1,
93             {
94                 "string",
95             },
96             "None.",
97         }},
98     MessageEntry{
99         "ResourceBlockCompositionStateChanged",
100         {
101             "Indicates that the composition state of a resource block has changed, specifically the value of the `CompositionState` property within `CompositionStatus`.",
102             "The composition status of the resource block '%1' has changed.",
103             "OK",
104             1,
105             {
106                 "string",
107             },
108             "None.",
109         }},
110     MessageEntry{
111         "ResourceBlockInUse",
112         {
113             "Indicates that the composition request contains a resource block that is unable to participate in more compositions.",
114             "Resource block '%1' cannot be part of any new compositions.",
115             "Warning",
116             1,
117             {
118                 "string",
119             },
120             "Remove the resource block from the request and resubmit the request.",
121         }},
122     MessageEntry{
123         "ResourceBlockInvalid",
124         {
125             "Indicates that the `Id` of a referenced resource block is no longer valid.",
126             "Resource block '%1' is not valid.",
127             "Critical",
128             1,
129             {
130                 "string",
131             },
132             "Remove the resource block and resubmit the request.",
133         }},
134     MessageEntry{
135         "ResourceBlockNotFound",
136         {
137             "Indicates that the referenced resource block was not found.",
138             "Resource block '%1' was not found.",
139             "Critical",
140             1,
141             {
142                 "string",
143             },
144             "Remove the resource block and resubmit the request.",
145         }},
146     MessageEntry{
147         "ResourceBlockStateChanged",
148         {
149             "Indicates that the state of a resource block has changed, specifically the value of the `State` property within `Status`.",
150             "The state of resource block '%1' has changed.",
151             "OK",
152             1,
153             {
154                 "string",
155             },
156             "None.",
157         }},
158     MessageEntry{
159         "ResourceZoneMembershipChanged",
160         {
161             "Indicates that the membership of a resource zone has changed due to resource blocks being added or removed from the resource zone.",
162             "The membership of resource zone '%1' has been changed.",
163             "OK",
164             1,
165             {
166                 "string",
167             },
168             "None.",
169         }},
170     MessageEntry{
171         "SpecifiedResourceAlreadyReserved",
172         {
173             "Indicates that a resource block is already reserved in response to a specific composition request.",
174             "Resource block '%1' is already reserved under reservation '%2'.",
175             "Critical",
176             2,
177             {
178                 "string",
179                 "string",
180             },
181             "Delete the reservation containing the resource block or select a different resource block and resubmit the request.",
182         }},
183     MessageEntry{
184         "UnableToProcessStanzaRequest",
185         {
186             "Indicates that the manifest provided for the `Compose` action contains a stanza with `Content` that could not be processed.",
187             "The provided manifest for the Compose action of type %1 contains a stanza with Id of value '%2' with a Content parameter that could not be processed.",
188             "Critical",
189             2,
190             {
191                 "string",
192                 "string",
193             },
194             "Add the Content parameter to the stanza or remove the stanza, and resubmit the request.",
195         }},
196 
197 };
198 
199 enum class Index
200 {
201     constrainedResourceAlreadyReserved = 0,
202     emptyManifest = 1,
203     incompatibleZone = 2,
204     noResourceMatch = 3,
205     resourceBlockChanged = 4,
206     resourceBlockCompositionStateChanged = 5,
207     resourceBlockInUse = 6,
208     resourceBlockInvalid = 7,
209     resourceBlockNotFound = 8,
210     resourceBlockStateChanged = 9,
211     resourceZoneMembershipChanged = 10,
212     specifiedResourceAlreadyReserved = 11,
213     unableToProcessStanzaRequest = 12,
214 };
215 }; // struct composition
216 
registerComposition()217 [[gnu::constructor]] inline void registerComposition()
218 { registerRegistry<Composition>(); }
219 
220 } // namespace redfish::registries
221