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 License
23 {
24 static constexpr Header header = {
25 "Copyright 2014-2023 DMTF. All rights reserved.",
26 "#MessageRegistry.v1_6_2.MessageRegistry",
27 1,
28 0,
29 3,
30 "License Message Registry",
31 "en",
32 "This registry defines the license status and error messages.",
33 "License",
34 "DMTF",
35 };
36
37 static constexpr const char* url =
38 "https://redfish.dmtf.org/registries/License.1.0.3.json";
39
40 static constexpr std::array registry =
41 {
42 MessageEntry{
43 "DaysBeforeExpiration",
44 {
45 "Indicates the number of days remaining on a license before expiration.",
46 "The license '%1' will expire in %2 days.",
47 "OK",
48 2,
49 {
50 "string",
51 "number",
52 },
53 "None.",
54 }},
55 MessageEntry{
56 "Expired",
57 {
58 "Indicates that a license has expired and its functionality was disabled.",
59 "The license '%1' has expired.",
60 "Warning",
61 1,
62 {
63 "string",
64 },
65 "None.",
66 }},
67 MessageEntry{
68 "GracePeriod",
69 {
70 "Indicates that a license has expired and entered its grace period.",
71 "The license '%1' has expired, %2 day grace period before licensed functionality is disabled.",
72 "Warning",
73 2,
74 {
75 "string",
76 "number",
77 },
78 "None.",
79 }},
80 MessageEntry{
81 "InstallFailed",
82 {
83 "Indicates that the service failed to install the license.",
84 "Failed to install the license. Reason: %1.",
85 "Critical",
86 1,
87 {
88 "string",
89 },
90 "None.",
91 }},
92 MessageEntry{
93 "InvalidLicense",
94 {
95 "Indicates that the license was not recognized, is corrupted, or is invalid.",
96 "The content of the license was not recognized, is corrupted, or is invalid.",
97 "Critical",
98 0,
99 {},
100 "Verify the license content is correct and resubmit the request.",
101 }},
102 MessageEntry{
103 "LicenseInstalled",
104 {
105 "Indicates that a license was installed.",
106 "The license '%1' was installed.",
107 "OK",
108 1,
109 {
110 "string",
111 },
112 "None.",
113 }},
114 MessageEntry{
115 "NotApplicableToTarget",
116 {
117 "Indicates that the license is not applicable to the target.",
118 "The license is not applicable to the target.",
119 "Critical",
120 0,
121 {},
122 "Check the license compatibility or applicability to the specified target.",
123 }},
124 MessageEntry{
125 "TargetsRequired",
126 {
127 "Indicates that one or more targets need to be specified with the license.",
128 "The license requires targets to be specified.",
129 "Critical",
130 0,
131 {},
132 "Add AuthorizedDevices to Links and resubmit the request.",
133 }},
134
135 };
136
137 enum class Index
138 {
139 daysBeforeExpiration = 0,
140 expired = 1,
141 gracePeriod = 2,
142 installFailed = 3,
143 invalidLicense = 4,
144 licenseInstalled = 5,
145 notApplicableToTarget = 6,
146 targetsRequired = 7,
147 };
148 }; // struct license
149
registerLicense()150 [[gnu::constructor]] inline void registerLicense()
151 { registerRegistry<License>(); }
152
153 } // namespace redfish::registries
154