|
Post by vanou on Jul 13, 2023 10:59:44 GMT
I'm working at company which manufactures series of rack mount servers. And these server provide Redfish API to configure and manipulate state of server. In this Redfish implementation, content of @redfish.AllowableValues of ComputerSystem.Reset changes according to Power state of server (i.e when power is off, only "On" is listed in ResetType@Redfish.AllowableValues. When power is on, "Nmi", "ForceOff", "ForceRestart" and "PushPowerButton" are listed).
Is such behavior of @redfish.AllowableValues acceptable? Can implementation of Redfish service change content of @redfish.AllowableValues based on state of Redfish managed system? (not only ComputerSystem.Reset but also at other Redfish resources)
|
|
|
Post by mraineri on Jul 13, 2023 12:21:31 GMT
No, we've typically not seen that sort of behavior, and that could be seen as confusing for some users in my mind.
One of the other issues with this potentially is it can cause issues with simple maintenance scripts. For example, a script might blindly walk all systems in a rack and perform a ComputerSystem.Reset with the ResetType "ForceOff". If a system is already powered off, the user doesn't want an error message because the system is off; from a REST perspective, the system is already in the desired state, so nothing needs to be done. We've added this text in the spec a few releases ago to help highlight this:
> If an action requested by the client has no effect, such as a reset of a ComputerSystem where the ResetType parameter is set to On and the ComputerSystem is already On , the service should respond with the HTTP 200 OK status code and return the NoOperation message from the Base Message Registry.
|
|
|
Post by jautor on Jul 13, 2023 21:19:06 GMT
While an implementation may change an AllowableValues list based on configuration (some values may be supported by the service firmware, but not a particular instance of hardware, for example), it should not alter the list based on state. As Mike points out, removing the current state can cause confusion, and quite frankly, is more software work... The AllowableValues annotations should generally be static values.
Jeff
|
|
|
Post by vanou on Jul 14, 2023 0:28:03 GMT
Thanks for reply.
I'll tell internal Redfish implementation team our product behavior around AllowableValues is wrong.
Thanks again.
|
|