Hi Mike,
Per Redfish specification 7.9 POST(create)
"The POST request is submitted to the resource collection to which the new resource will belong."
If this is not a collection resource, we cannot use POST method. And /redfish/v1/Systems/SYS_ID/Bios is not a collection resource. The allowed method returned from BMC for BIOS resource is usually "GET" and "PUT".
So, I think that the fourth parameter is still FALSE here. But I admit that the function header below is confusing and did not express above rule clearly.
/**
Provisioning redfish resource by given URI.
@param[in] Schema Redfish schema information.
@param[in] Uri Target URI to create resource.
@param[in] InformationExchange Pointer to RESOURCE_INFORMATION_EXCHANGE.
@param[in] HttpPostMode TRUE if resource does not exist, HTTP POST method is used.
FALSE if the resource exist but some of properties are missing,
HTTP PUT method is used.
@retval EFI_SUCCESS Value is returned successfully.
@retval Others Some error happened.
**/
Below is my suggestion.
@param[in] HttpPostMode TRUE if target resource is a member of collection resource, HTTP POST method is used.
FALSE if target resource is non-collection resource, HTTP PUT method is used.
Do you think this helps to explain the use-case of fourth parameter more clearly?
Thanks,
Nickle
Seems like more comments need to be changed....
The idea behind this patch is the basis of the current implementation of RedfishClientPkg/Features/Bios/v1_0_9.
The EdkIIRedfishResourceConfigProvisioning function calls the EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL::Provisioning function,
this is RedfishResourceProvisioningResource() for this driver[1], then it calls RedfishProvisioningResourceCommon() where the logic
of this flag is completely changed [2].
So, for the current implementation of this flag, it is not a choice between POST and PUT, but between POST and PATCH (see [1]).
May be flag should not be inverted here [3]?
The value of FALSE here (you expect PUT to be used) means the following ProvisioningBiosExistResource() function calls
ProvisioningBiosProperties() with ProvisionMode == TRUE. This ProvisionMode == TRUE forces PropertyChanged set into TRUE,
so finally ProvisioningBiosProperties() returns success even for elements that do not exist.
Here I mean elements of /redfish/v1/Systems/{SystemID}/Bios/Attributes. I'm in situation when Attributes exists,
but it is empty.
Currently the PUT method is not used anywhere in RedfishClientPkg/Features/Bios and "PUT back to instance" actually performs the PATCH.
I will drop this patch from the current PR until it becomes clear how this can be improved.