Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to get the RedundancySet for a given Redundancy group in the Power resource #356

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

pereztr5
Copy link
Contributor

This change makes it so we can access the RedundancySet param, which contains all actual Power Supplies vs what is listed in .PowerSupplies as that can contain anything in the PSU slots, which sometimes are fans and not actual power supplies.

Copy link
Owner

@stmcginnis stmcginnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please expose this by adding an accessor method so it is consistent with the other object/related-object acccess.

For example:
https://github.com/stmcginnis/gofish/blob/main/redfish/power.go#L425

Thanks for working on this!

Copy link
Owner

@stmcginnis stmcginnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - just a couple minor things.

redfish/power.go Outdated Show resolved Hide resolved
redfish/power.go Outdated Show resolved Hide resolved
@pereztr5
Copy link
Contributor Author

Hey @stmcginnis, I'm unsure if I made this function consistent with your other object/related-object access as I could not use the redfish.Redundancy[].redundancySet links. These links look like:

# /redfish/v1/Chassis/1/Power | jq '.Redundancy[].RedundancySet'
[
  {
    "@odata.id": "/redfish/v1/Chassis/1/Power#/PowerSupplies/0"
  },
  {
    "@odata.id": "/redfish/v1/Chassis/1/Power#/PowerSupplies/1"
  },
  {
    "@odata.id": "/redfish/v1/Chassis/1/Power#/PowerSupplies/2"
  },
  {
    "@odata.id": "/redfish/v1/Chassis/1/Power#/PowerSupplies/3"
  },
  {
    "@odata.id": "/redfish/v1/Chassis/1/Power#/PowerSupplies/4"
  },
  {
    "@odata.id": "/redfish/v1/Chassis/1/Power#/PowerSupplies/7"
  }
]

Hitting those links gives back the same response as /redfish/v1/Chassis/1/Power vs. the individual redfish.PowerSupply, and so in both cases, you need to use the .PowerSupplies[] field from the response to get the actual redfish.PowerSupply.

My goal is to get the []redfish.PowerSupply for the given redundancy group so that it does not include anything that is not part of it. That is why I made the function just filter the []redfish.PowerSupply.

@stmcginnis
Copy link
Owner

My goal is to get the []redfish.PowerSupply for the given redundancy group so that it does not include anything that is not part of it. That is why I made the function just filter the []redfish.PowerSupply.

Yep, that makes sense. Those are jsonpath links, so in this case they are self-referential. I think the approach makes sense.

@pereztr5
Copy link
Contributor Author

Thanks for the quick feedback. I have made the adjustments and added more to the comment.

Copy link
Owner

@stmcginnis stmcginnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates - looks good!

@pereztr5 pereztr5 changed the title Make Redundancy.redundancySet public Add ability to get the RedundancySet for a given Redundancy group in the Power resource Jul 29, 2024
@stmcginnis stmcginnis merged commit c4e27dc into stmcginnis:main Jul 29, 2024
2 checks passed
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.

2 participants