@@ -96,15 +96,15 @@ inline bool getHostLoggerEntries(
96
96
return true ;
97
97
}
98
98
99
- inline void fillHostLoggerEntryJson (std::string_view logEntryID,
100
- std::string_view msg ,
101
- nlohmann::json::object_t & logEntryJson)
99
+ inline void fillHostLoggerEntryJson (
100
+ const std::string& systemName, std::string_view logEntryID ,
101
+ std::string_view msg, nlohmann::json::object_t & logEntryJson)
102
102
{
103
103
// Fill in the log entry with the gathered data.
104
104
logEntryJson[" @odata.type" ] = " #LogEntry.v1_9_0.LogEntry" ;
105
105
logEntryJson[" @odata.id" ] = boost::urls::format (
106
- " /redfish/v1/Systems/{}/LogServices/HostLogger/Entries/{}" ,
107
- BMCWEB_REDFISH_SYSTEM_URI_NAME, logEntryID);
106
+ " /redfish/v1/Systems/{}/LogServices/HostLogger/Entries/{}" , systemName,
107
+ logEntryID);
108
108
logEntryJson[" Name" ] = " Host Logger Entry" ;
109
109
logEntryJson[" Id" ] = logEntryID;
110
110
logEntryJson[" Message" ] = msg;
@@ -122,29 +122,24 @@ inline void handleSystemsLogServicesHostloggerGet(
122
122
{
123
123
return ;
124
124
}
125
- if constexpr (BMCWEB_EXPERIMENTAL_REDFISH_MULTI_COMPUTER_SYSTEM)
126
- {
127
- // Option currently returns no systems. TBD
128
- messages::resourceNotFound (asyncResp->res , " ComputerSystem" ,
129
- systemName);
130
- return ;
131
- }
132
- if (systemName != BMCWEB_REDFISH_SYSTEM_URI_NAME)
125
+
126
+ if (!BMCWEB_REDFISH_SYSTEM_URI_NAME.empty ())
133
127
{
134
- messages::resourceNotFound (asyncResp->res , " ComputerSystem" ,
135
- systemName);
136
- return ;
128
+ if (systemName != BMCWEB_REDFISH_SYSTEM_URI_NAME)
129
+ {
130
+ messages::resourceNotFound (asyncResp->res , " ComputerSystem" ,
131
+ systemName);
132
+ return ;
133
+ }
137
134
}
138
- asyncResp->res .jsonValue [" @odata.id" ] =
139
- std::format (" /redfish/v1/Systems/{}/LogServices/HostLogger" ,
140
- BMCWEB_REDFISH_SYSTEM_URI_NAME);
135
+ asyncResp->res .jsonValue [" @odata.id" ] = std::format (
136
+ " /redfish/v1/Systems/{}/LogServices/HostLogger" , systemName);
141
137
asyncResp->res .jsonValue [" @odata.type" ] = " #LogService.v1_2_0.LogService" ;
142
138
asyncResp->res .jsonValue [" Name" ] = " Host Logger Service" ;
143
139
asyncResp->res .jsonValue [" Description" ] = " Host Logger Service" ;
144
140
asyncResp->res .jsonValue [" Id" ] = " HostLogger" ;
145
- asyncResp->res .jsonValue [" Entries" ][" @odata.id" ] =
146
- std::format (" /redfish/v1/Systems/{}/LogServices/HostLogger/Entries" ,
147
- BMCWEB_REDFISH_SYSTEM_URI_NAME);
141
+ asyncResp->res .jsonValue [" Entries" ][" @odata.id" ] = std::format (
142
+ " /redfish/v1/Systems/{}/LogServices/HostLogger/Entries" , systemName);
148
143
}
149
144
150
145
inline void handleSystemsLogServicesHostloggerEntriesGet (
@@ -162,22 +157,17 @@ inline void handleSystemsLogServicesHostloggerEntriesGet(
162
157
{
163
158
return ;
164
159
}
165
- if constexpr (BMCWEB_EXPERIMENTAL_REDFISH_MULTI_COMPUTER_SYSTEM)
166
- {
167
- // Option currently returns no systems. TBD
168
- messages::resourceNotFound (asyncResp->res , " ComputerSystem" ,
169
- systemName);
170
- return ;
171
- }
172
- if (systemName != BMCWEB_REDFISH_SYSTEM_URI_NAME)
160
+ if (!BMCWEB_REDFISH_SYSTEM_URI_NAME.empty ())
173
161
{
174
- messages::resourceNotFound (asyncResp->res , " ComputerSystem" ,
175
- systemName);
176
- return ;
162
+ if (systemName != BMCWEB_REDFISH_SYSTEM_URI_NAME)
163
+ {
164
+ messages::resourceNotFound (asyncResp->res , " ComputerSystem" ,
165
+ systemName);
166
+ return ;
167
+ }
177
168
}
178
- asyncResp->res .jsonValue [" @odata.id" ] =
179
- std::format (" /redfish/v1/Systems/{}/LogServices/HostLogger/Entries" ,
180
- BMCWEB_REDFISH_SYSTEM_URI_NAME);
169
+ asyncResp->res .jsonValue [" @odata.id" ] = std::format (
170
+ " /redfish/v1/Systems/{}/LogServices/HostLogger/Entries" , systemName);
181
171
asyncResp->res .jsonValue [" @odata.type" ] =
182
172
" #LogEntryCollection.LogEntryCollection" ;
183
173
asyncResp->res .jsonValue [" Name" ] = " HostLogger Entries" ;
@@ -217,8 +207,8 @@ inline void handleSystemsLogServicesHostloggerEntriesGet(
217
207
for (size_t i = 0 ; i < logEntries.size (); i++)
218
208
{
219
209
nlohmann::json::object_t hostLogEntry;
220
- fillHostLoggerEntryJson (std::to_string (skip + i), logEntries[i] ,
221
- hostLogEntry);
210
+ fillHostLoggerEntryJson (systemName, std::to_string (skip + i),
211
+ logEntries[i], hostLogEntry);
222
212
logEntryArray.emplace_back (std::move (hostLogEntry));
223
213
}
224
214
@@ -228,7 +218,7 @@ inline void handleSystemsLogServicesHostloggerEntriesGet(
228
218
asyncResp->res .jsonValue [" Members@odata.nextLink" ] =
229
219
std::format (
230
220
" /redfish/v1/Systems/{}/LogServices/HostLogger/Entries?$skip=" ,
231
- BMCWEB_REDFISH_SYSTEM_URI_NAME ) +
221
+ systemName ) +
232
222
std::to_string (skip + top);
233
223
}
234
224
}
@@ -243,18 +233,14 @@ inline void handleSystemsLogServicesHostloggerEntriesEntryGet(
243
233
{
244
234
return ;
245
235
}
246
- if constexpr (BMCWEB_EXPERIMENTAL_REDFISH_MULTI_COMPUTER_SYSTEM )
236
+ if (!BMCWEB_REDFISH_SYSTEM_URI_NAME. empty () )
247
237
{
248
- // Option currently returns no systems. TBD
249
- messages::resourceNotFound (asyncResp->res , " ComputerSystem" ,
250
- systemName);
251
- return ;
252
- }
253
- if (systemName != BMCWEB_REDFISH_SYSTEM_URI_NAME)
254
- {
255
- messages::resourceNotFound (asyncResp->res , " ComputerSystem" ,
256
- systemName);
257
- return ;
238
+ if (systemName != BMCWEB_REDFISH_SYSTEM_URI_NAME)
239
+ {
240
+ messages::resourceNotFound (asyncResp->res , " ComputerSystem" ,
241
+ systemName);
242
+ return ;
243
+ }
258
244
}
259
245
std::string_view targetID = param;
260
246
@@ -290,7 +276,8 @@ inline void handleSystemsLogServicesHostloggerEntriesEntryGet(
290
276
if (!logEntries.empty ())
291
277
{
292
278
nlohmann::json::object_t hostLogEntry;
293
- fillHostLoggerEntryJson (targetID, logEntries[0 ], hostLogEntry);
279
+ fillHostLoggerEntryJson (systemName, targetID, logEntries[0 ],
280
+ hostLogEntry);
294
281
asyncResp->res .jsonValue .update (hostLogEntry);
295
282
return ;
296
283
}
0 commit comments