diff options
author | Carol Wang <wangkair@cn.ibm.com> | 2019-11-26 08:27:15 +0300 |
---|---|---|
committer | Carol Wang <wangkair@cn.ibm.com> | 2019-12-12 05:57:07 +0300 |
commit | 97d57aaa0b95a110c71016d190f95f853051126a (patch) | |
tree | 644f9a8f23ba6212f6838cc9920e2291d4a30e24 /redfish-core/lib/update_service.hpp | |
parent | 96b39e02ba160cda74b70b4cd9bac34c760e1701 (diff) | |
download | bmcweb-97d57aaa0b95a110c71016d190f95f853051126a.tar.xz |
Redfish: Support health status of firmware inventory objects
Support health status of firmware inventory objects based on the mapping
relationship:
[dbus status] [redfish state] [redfish health]
Ready Disabled OK
Activating Updating OK
Active Enabled OK
NotReady Disabled Warning
Invalid Disabled Warning
Failed Disabled Warning
Tested:
[dbus status] --> [redfish state] --> [redfish health]
1. Ready --> Disabled --> OK
$ curl -k -H "X-Auth-Token: $token" https://$bmc/xyz/openbmc_project/software/enumerate
{
...
"/xyz/openbmc_project/software/9557fe67": {
"Activation": "xyz.openbmc_project.Software.Activation.Activations.Ready",
...
}
$curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/UpdateService/FirmwareInventory/9557fe67
{
"@odata.context": "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory",
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/9557fe67",
...
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Disabled"
},
...
}
2. Activating --> Updating --> OK
$ curl -k -H "X-Auth-Token: $token" https://$bmc/xyz/openbmc_project/software/enumerate
{
...
"/xyz/openbmc_project/software/9557fe67": {
"Activation": "xyz.openbmc_project.Software.Activation.Activations.Activating",
...
}
$curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/UpdateService/FirmwareInventory/9557fe67
{
"@odata.context": "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory",
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/9557fe67",
...
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Updating"
},
...
}
3. Active --> Enabled --> OK
$ curl -k -H "X-Auth-Token: $token" https://$bmc/xyz/openbmc_project/software/enumerate
{
"data": {
"/xyz/openbmc_project/software/9557fe67": {
"Activation": "xyz.openbmc_project.Software.Activation.Activations.Active",
...
}
$ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/UpdateService/FirmwareInventory/9557fe67
{
"@odata.context": "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory",
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/9557fe67",
...
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
},
...
}
4. Invalid --> Disabled --> Warning
# busctl call xyz.openbmc_project.Software.BMC.Updater /xyz/openbmc_project/software/c0bbba12 \
org.freedesktop.DBus.Properties Set ssv xyz.openbmc_project.Software.Activation Activation s \
xyz.openbmc_project.Software.Activation.Activations.Invalid
$ curl -k -H "X-Auth-Token: $token" https://$bmc/xyz/openbmc_project/software/enumerate
{
...
"/xyz/openbmc_project/software/c0bbba12": {
"Activation": "xyz.openbmc_project.Software.Activation.Activations.Invalid",
...
}
$ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/UpdateService/FirmwareInventory/c0bbba12
{
"@odata.context": "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory",
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/c0bbba12",
...
"Status": {
"Health": "Warning",
"HealthRollup": "OK",
"State": "Disabled"
},
...
}
5. NotReady --> Disabled --> Warning
# busctl call xyz.openbmc_project.Software.BMC.Updater /xyz/openbmc_project/software/c0bbba12 \
org.freedesktop.DBus.Properties Set ssv xyz.openbmc_project.Software.Activation Activation s \
xyz.openbmc_project.Software.Activation.Activations.NotReady
$ curl -k -H "X-Auth-Token: $token" https://$bmc/xyz/openbmc_project/software/enumerate
{
...
"/xyz/openbmc_project/software/c0bbba12": {
"Activation": "xyz.openbmc_project.Software.Activation.Activations.NotReady",
...
}
$ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/UpdateService/FirmwareInventory/c0bbba12
{
"@odata.context": "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory",
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/c0bbba12",
...
"Status": {
"Health": "Warning",
"HealthRollup": "OK",
"State": "Disabled"
},
...
}
6. Failed --> Disabled --> Warning
# busctl call xyz.openbmc_project.Software.BMC.Updater /xyz/openbmc_project/software/c0bbba12 \
org.freedesktop.DBus.Properties Set ssv xyz.openbmc_project.Software.Activation Activation s \
xyz.openbmc_project.Software.Activation.Activations.Failed
$ curl -k -H "X-Auth-Token: $token" https://$bmc/xyz/openbmc_project/software/enumerate
{
...
"/xyz/openbmc_project/software/c0bbba12": {
"Activation": "xyz.openbmc_project.Software.Activation.Activations.Failed",
...
}
$ curl -k -H "X-Auth-Token: $token" https://${bmc}/redfish/v1/UpdateService/FirmwareInventory/c0bbba12
{
"@odata.context": "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory",
"@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/c0bbba12",
...
"Status": {
"Health": "Warning",
"HealthRollup": "OK",
"State": "Disabled"
},
...
}
Validator tool result:
Counter({'pass': 2992, 'skipOptional': 2470, 'metadataNamespaces': 1605,
'passGet': 189, 'serviceNamespaces': 71, 'invalidPropertyValue': 10,
'warningPresent': 6, 'passAction': 6, 'optionalAction': 5, 'warnDeprecated':
2, 'unverifiedComplexAdditional': 1})
Validation has succeeded.
Change-Id: Ic475f56d19c0be01ca7aebf67a3f6814d35bcacd
Signed-off-by: Carol Wang <wangkair@cn.ibm.com>
Diffstat (limited to 'redfish-core/lib/update_service.hpp')
-rw-r--r-- | redfish-core/lib/update_service.hpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp index 57dcc0705d..e3f5df77c0 100644 --- a/redfish-core/lib/update_service.hpp +++ b/redfish-core/lib/update_service.hpp @@ -772,7 +772,6 @@ class SoftwareInventory : public Node "/redfish/v1/$metadata#SoftwareInventory.SoftwareInventory"; asyncResp->res.jsonValue["Name"] = "Software Inventory"; asyncResp->res.jsonValue["Updateable"] = false; - asyncResp->res.jsonValue["Status"]["Health"] = "OK"; asyncResp->res.jsonValue["Status"]["HealthRollup"] = "OK"; }, "xyz.openbmc_project.ObjectMapper", |