Add UnavailableOffline state mapping and add getResourceStatus helper#1501
Draft
jnin-dev wants to merge 2 commits into
Draft
Add UnavailableOffline state mapping and add getResourceStatus helper#1501jnin-dev wants to merge 2 commits into
jnin-dev wants to merge 2 commits into
Conversation
ac44a87 to
fd33698
Compare
fd33698 to
aee002e
Compare
- 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
aee002e to
3e4fbe1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resource's Status.State and Status.Health
Availableto RedfishUnavailableOfflineTested:
with the new mapping
Results with