Skip to content

Add UnavailableOffline state mapping and add getResourceStatus helper#1501

Draft
jnin-dev wants to merge 2 commits into
ibm-openbmc:1210from
jnin-dev:dev/1210/available_state
Draft

Add UnavailableOffline state mapping and add getResourceStatus helper#1501
jnin-dev wants to merge 2 commits into
ibm-openbmc:1210from
jnin-dev:dev/1210/available_state

Conversation

@jnin-dev

Copy link
Copy Markdown
Contributor
  1. Added a utility function to reduce code duplication for retrieving
    resource's Status.State and Status.Health
  2. Mapped D-Bus Available to Redfish UnavailableOffline

Tested:

  • Build successfully
  • Unit tests passed
  • Sent requests and received Status.State and Status.Health as expected
    with the new mapping
curl -k -v https://${bmc}/redfish/v1/Systems/system/Processors/mcm/SubProcessors/core0

Results with

{
  "@odata.id": "/redfish/v1/Systems/system/Processors/mcm/SubProcessors/core0",
  "@odata.type": "#Processor.v1_18_0.Processor",
  "Enabled": true,
  "Id": "core0",
  "Name": "Node 0 processor module Core 0",
  "Status": {
    "Health": "OK",
    "State": "UnavailableOffline"
 }

@jnin-dev jnin-dev changed the title Add UnavailableOffline state mapping and add getResourceStatus helper WIP: Add UnavailableOffline state mapping and add getResourceStatus helper Jul 10, 2026
@jnin-dev jnin-dev force-pushed the dev/1210/available_state branch from ac44a87 to fd33698 Compare July 10, 2026 22:02
@jnin-dev jnin-dev changed the title WIP: Add UnavailableOffline state mapping and add getResourceStatus helper Add UnavailableOffline state mapping and add getResourceStatus helper Jul 13, 2026
@jnin-dev jnin-dev force-pushed the dev/1210/available_state branch from fd33698 to aee002e Compare July 13, 2026 23:32
jnin-dev added 2 commits July 14, 2026 00:23
- State `Available` will be mapped to `UnavailableOffline` for
  Status.State
- Added a utility function to reduce code duplication for retrieving
  resource's Status.State and Status.Health.

Currently we are assuming that Status.State has no impact on the
Status.Health so the behavior of power supply will be different.

Tested:
- Compiles and builds
- Redfish service validator passes
- Verified that resources have the Status.State and Status.Health with
  the new state `UnavailableOffline`
```
curl -k -v https://${bmc}/redfish/v1/Chassis/chassis0/PowerSubsystem/PowerSupplies/powersupply0 -u service:0penBmc
```
Results with
```
{
  "@odata.id": "/redfish/v1/Chassis/chassis0/PowerSubsystem/PowerSupplies/powersupply0",
  "@odata.type": "#PowerSupply.v1_5_0.PowerSupply",
  "EfficiencyRatings": [
    {
      "EfficiencyPercent": 90
    }
  ],
  "Id": "powersupply0",
  "Location": {
    "PartLocation": {
      "ServiceLabel": "Ufcs-N01-BD00-PSU0"
    }
  },
  "Name": "Node 1 Power Supply 0",
  "Status": {
    "Health": "OK",
    "State": "Absent"
  }
```
For resources that couldn't cleanly use getResourceStatus(), add the
mapping for the `Available` to Redfish `UnavailableOffline`. This
applies to assembly, memory, and processor

Tested:
- Compiles and builds
- Requests to these resources appears as expected for Status.State and
  Status.Health
@jnin-dev jnin-dev force-pushed the dev/1210/available_state branch from aee002e to 3e4fbe1 Compare July 14, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant