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

Fetch a single firmware inventory entry #359

Open
riethm opened this issue Aug 30, 2024 · 3 comments
Open

Fetch a single firmware inventory entry #359

riethm opened this issue Aug 30, 2024 · 3 comments

Comments

@riethm
Copy link
Contributor

riethm commented Aug 30, 2024

UpdateService.firmwareInventory stores the endpoint of the firmware inventory. In 6933b3e, the property was changed from exported to unexported, such that now the only way to access the data in the firmware inventory appears to be through this list method:

// FirmwareInventories gets the collection of firmware inventories of this update service
func (updateService *UpdateService) FirmwareInventories() ([]*SoftwareInventory, error) {

This is useful for discovery, but is expensive when you just want to fetch the inventory data for a specific component (e.g., "BMC-Primary").

Is there a way I'm missing to fetch data for a single firmware inventory entry?

@stmcginnis
Copy link
Owner

Could you explain how you were accessing the firmware inventory before without doing something like being done in the FirmwareInventories() call?

@riethm
Copy link
Contributor Author

riethm commented Aug 30, 2024

I called GetSoftwareInventory(), passing the client, and a concatenation of the UpdateService.FirmwareInventory endpoint plus the specific entry ID we are interested in, e.g.: /redfish/v1/UpdateService/FirmwareInventory/BMC-Primary

// GetSoftwareInventory will get a SoftwareInventory instance from the service.
func GetSoftwareInventory(c common.Client, uri string) (*SoftwareInventory, error) {
return common.GetObject[SoftwareInventory](c, uri)
}

@stmcginnis
Copy link
Owner

Where would you get the BMC-Primary name to fetch the specific ID? If it's something already known, we could add a GetSoftwareInventoryByName(c common.Client, item string) call. I suppose we could also do a GetSoftwareInventoryOwnerList() or something like that to get the list of names if needed.

I'm really trying to avoid anywhere that we just give the client a raw Redfish URL to have to fetch on their own. But I suppose if that's the cleanest way to do this, I'm not entirely opposed to the idea.

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

No branches or pull requests

2 participants