Fix hypervisor system Get
The reason for this change is that there are two routes defined:
[1] /redfish/v1/Systems/<str> in systems.hpp
[2] /redfish/v1/Systems/hypervisor in hypervisor_system.hpp
Whenever a user does a get on /redfish/v1/Systems/hypervisor, the first
route is hit and that checks if <str> is "system" and if not, bmcweb
returns resource not found error.
```
Error:
ERROR - Members: GET of resource at URI /redfish/v1/Systems/hypervisor returned HTTP error. Check URI.
ERROR - URI did not return resource /redfish/v1/Systems/hypervisor
GET Failure HTTP Code (404)
```
The below upstream commit is causing this issue:
[1] openbmc/bmcweb@22d268c#diff-cddfc26fddb6ba29f3fd81ecf5840fc6d9a8554bbca92f578d81b97db8b14895
To resolve this issue, an if hypervisor is inserted in the
/redfish/v1/Systems/<str> and that calls handleHypervisorSystemGet. The
/redfish/v1/Systems/hypervisor in redfish-core/lib/hypervisor_system.hpp
is removed.
Also fix /redfish/v1/Systems/hypervisor/ResetActionInfo/.
Redfish validator passed.
redfish/v1/Systems/hypervisor looks good.
/redfish/v1/Systems/hypervisor/ResetActionInfo/ looks good.
Change-Id: Ie2d9d19c258236ce86d6552ae4a3bd486e02de01
Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index 6174610..a38cc3a 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -19,6 +19,7 @@
#include "dbus_singleton.hpp"
#include "dbus_utility.hpp"
#include "health.hpp"
+#include "hypervisor_system.hpp"
#include "led.hpp"
#include "pcie.hpp"
#include "query.hpp"
@@ -2942,6 +2943,13 @@
{
return;
}
+
+ if (systemName == "hypervisor")
+ {
+ handleHypervisorSystemGet(asyncResp);
+ return;
+ }
+
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",
@@ -3231,6 +3239,13 @@
{
return;
}
+
+ if (systemName == "hypervisor")
+ {
+ handleHypervisorResetActionGet(asyncResp);
+ return;
+ }
+
if (systemName != "system")
{
messages::resourceNotFound(asyncResp->res, "ComputerSystem",