stmcginnis/gofish

How to refresh a System object state?

rgl opened this issue · 3 comments

rgl commented

I want to trigger a system.Reset(redfish.ForceOffResetType) and then wait for the system to actually be off.

How can I do that?

It seems there is no way to "Refresh" the cached data, nor to have the system url/link so I can call GetComputerSystem(c common.Client, link string).

Hey @rgl - you are correct, there is not a Refresh() call that can be made to do this. You would need to get it again through something like chassis.ComputerSystems().

Assuming you have the client, you should be able to do system = GetComputerSystem(c, system.ODataID).

rgl commented

Thank you! I've completely missed system.ODataID. Its now working nicely :-)