xref: /openbmc/bmcweb/features/redfish/include/registries/license_message_registry.hpp (revision 4a102cd48c588d32c0a4d6610b4a9ed616f255f3)
140e9b92eSEd Tanous // SPDX-License-Identifier: Apache-2.0
240e9b92eSEd Tanous // SPDX-FileCopyrightText: Copyright OpenBMC Authors
3665e7602SGunnar Mills #pragma once
4665e7602SGunnar Mills /****************************************************************
5665e7602SGunnar Mills  *                 READ THIS WARNING FIRST
6665e7602SGunnar Mills  * This is an auto-generated header which contains definitions
7665e7602SGunnar Mills  * for Redfish DMTF defined messages.
8665e7602SGunnar Mills  * DO NOT modify this registry outside of running the
9665e7602SGunnar Mills  * parse_registries.py script.  The definitions contained within
10665e7602SGunnar Mills  * this file are owned by DMTF.  Any modifications to these files
11665e7602SGunnar Mills  * should be first pushed to the relevant registry in the DMTF
12665e7602SGunnar Mills  * github organization.
13665e7602SGunnar Mills  ***************************************************************/
14665e7602SGunnar Mills #include "registries.hpp"
15665e7602SGunnar Mills 
16665e7602SGunnar Mills #include <array>
17665e7602SGunnar Mills 
18665e7602SGunnar Mills // clang-format off
19665e7602SGunnar Mills 
20*4a102cd4SPatrick Williams namespace redfish::registries
21665e7602SGunnar Mills {
22*4a102cd4SPatrick Williams struct License
23*4a102cd4SPatrick Williams {
24*4a102cd4SPatrick Williams static constexpr Header header = {
25665e7602SGunnar Mills     "Copyright 2014-2023 DMTF. All rights reserved.",
26665e7602SGunnar Mills     "#MessageRegistry.v1_6_2.MessageRegistry",
2756b81992SEd Tanous     1,
2856b81992SEd Tanous     0,
2956b81992SEd Tanous     3,
30665e7602SGunnar Mills     "License Message Registry",
31665e7602SGunnar Mills     "en",
32665e7602SGunnar Mills     "This registry defines the license status and error messages.",
33665e7602SGunnar Mills     "License",
34665e7602SGunnar Mills     "DMTF",
35665e7602SGunnar Mills };
36*4a102cd4SPatrick Williams 
37*4a102cd4SPatrick Williams static constexpr const char* url =
38665e7602SGunnar Mills     "https://redfish.dmtf.org/registries/License.1.0.3.json";
39665e7602SGunnar Mills 
40*4a102cd4SPatrick Williams static constexpr std::array registry =
41665e7602SGunnar Mills {
42665e7602SGunnar Mills     MessageEntry{
43665e7602SGunnar Mills         "DaysBeforeExpiration",
44665e7602SGunnar Mills         {
45665e7602SGunnar Mills             "Indicates the number of days remaining on a license before expiration.",
46665e7602SGunnar Mills             "The license '%1' will expire in %2 days.",
47665e7602SGunnar Mills             "OK",
48665e7602SGunnar Mills             2,
49665e7602SGunnar Mills             {
50665e7602SGunnar Mills                 "string",
51665e7602SGunnar Mills                 "number",
52665e7602SGunnar Mills             },
53665e7602SGunnar Mills             "None.",
54665e7602SGunnar Mills         }},
55665e7602SGunnar Mills     MessageEntry{
56665e7602SGunnar Mills         "Expired",
57665e7602SGunnar Mills         {
58665e7602SGunnar Mills             "Indicates that a license has expired and its functionality was disabled.",
59665e7602SGunnar Mills             "The license '%1' has expired.",
60665e7602SGunnar Mills             "Warning",
61665e7602SGunnar Mills             1,
62665e7602SGunnar Mills             {
63665e7602SGunnar Mills                 "string",
64665e7602SGunnar Mills             },
65665e7602SGunnar Mills             "None.",
66665e7602SGunnar Mills         }},
67665e7602SGunnar Mills     MessageEntry{
68665e7602SGunnar Mills         "GracePeriod",
69665e7602SGunnar Mills         {
70665e7602SGunnar Mills             "Indicates that a license has expired and entered its grace period.",
71665e7602SGunnar Mills             "The license '%1' has expired, %2 day grace period before licensed functionality is disabled.",
72665e7602SGunnar Mills             "Warning",
73665e7602SGunnar Mills             2,
74665e7602SGunnar Mills             {
75665e7602SGunnar Mills                 "string",
76665e7602SGunnar Mills                 "number",
77665e7602SGunnar Mills             },
78665e7602SGunnar Mills             "None.",
79665e7602SGunnar Mills         }},
80665e7602SGunnar Mills     MessageEntry{
81665e7602SGunnar Mills         "InstallFailed",
82665e7602SGunnar Mills         {
83665e7602SGunnar Mills             "Indicates that the service failed to install the license.",
84665e7602SGunnar Mills             "Failed to install the license.  Reason: %1.",
85665e7602SGunnar Mills             "Critical",
86665e7602SGunnar Mills             1,
87665e7602SGunnar Mills             {
88665e7602SGunnar Mills                 "string",
89665e7602SGunnar Mills             },
90665e7602SGunnar Mills             "None.",
91665e7602SGunnar Mills         }},
92665e7602SGunnar Mills     MessageEntry{
93665e7602SGunnar Mills         "InvalidLicense",
94665e7602SGunnar Mills         {
95665e7602SGunnar Mills             "Indicates that the license was not recognized, is corrupted, or is invalid.",
96665e7602SGunnar Mills             "The content of the license was not recognized, is corrupted, or is invalid.",
97665e7602SGunnar Mills             "Critical",
98665e7602SGunnar Mills             0,
99665e7602SGunnar Mills             {},
100665e7602SGunnar Mills             "Verify the license content is correct and resubmit the request.",
101665e7602SGunnar Mills         }},
102665e7602SGunnar Mills     MessageEntry{
103665e7602SGunnar Mills         "LicenseInstalled",
104665e7602SGunnar Mills         {
105665e7602SGunnar Mills             "Indicates that a license was installed.",
106665e7602SGunnar Mills             "The license '%1' was installed.",
107665e7602SGunnar Mills             "OK",
108665e7602SGunnar Mills             1,
109665e7602SGunnar Mills             {
110665e7602SGunnar Mills                 "string",
111665e7602SGunnar Mills             },
112665e7602SGunnar Mills             "None.",
113665e7602SGunnar Mills         }},
114665e7602SGunnar Mills     MessageEntry{
115665e7602SGunnar Mills         "NotApplicableToTarget",
116665e7602SGunnar Mills         {
117665e7602SGunnar Mills             "Indicates that the license is not applicable to the target.",
118665e7602SGunnar Mills             "The license is not applicable to the target.",
119665e7602SGunnar Mills             "Critical",
120665e7602SGunnar Mills             0,
121665e7602SGunnar Mills             {},
122665e7602SGunnar Mills             "Check the license compatibility or applicability to the specified target.",
123665e7602SGunnar Mills         }},
124665e7602SGunnar Mills     MessageEntry{
125665e7602SGunnar Mills         "TargetsRequired",
126665e7602SGunnar Mills         {
127665e7602SGunnar Mills             "Indicates that one or more targets need to be specified with the license.",
128665e7602SGunnar Mills             "The license requires targets to be specified.",
129665e7602SGunnar Mills             "Critical",
130665e7602SGunnar Mills             0,
131665e7602SGunnar Mills             {},
132665e7602SGunnar Mills             "Add AuthorizedDevices to Links and resubmit the request.",
133665e7602SGunnar Mills         }},
134665e7602SGunnar Mills 
135665e7602SGunnar Mills };
136665e7602SGunnar Mills 
137665e7602SGunnar Mills enum class Index
138665e7602SGunnar Mills {
139665e7602SGunnar Mills     daysBeforeExpiration = 0,
140665e7602SGunnar Mills     expired = 1,
141665e7602SGunnar Mills     gracePeriod = 2,
142665e7602SGunnar Mills     installFailed = 3,
143665e7602SGunnar Mills     invalidLicense = 4,
144665e7602SGunnar Mills     licenseInstalled = 5,
145665e7602SGunnar Mills     notApplicableToTarget = 6,
146665e7602SGunnar Mills     targetsRequired = 7,
147665e7602SGunnar Mills };
148*4a102cd4SPatrick Williams }; // struct license
149*4a102cd4SPatrick Williams 
150*4a102cd4SPatrick Williams [[gnu::constructor]] inline void registerLicense()
151*4a102cd4SPatrick Williams { registerRegistry<License>(); }
152*4a102cd4SPatrick Williams 
153*4a102cd4SPatrick Williams } // namespace redfish::registries
154