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

> -----Original Message-----
> From: Mike Maslenkin <mike.maslen...@gmail.com>
> Sent: Friday, December 15, 2023 8:04 AM
> To: devel@edk2.groups.io
> Cc: abner.ch...@amd.com; Nickle Wang <nick...@nvidia.com>;
> ig...@ami.com; Mike Maslenkin <mike.maslen...@gmail.com>
> Subject: [edk2-redfish-client][PATCH 4/4] RedfishClientPkg: use POST method
> while provisioning new property.
> 
> External email: Use caution opening links or attachments
> 
> 
> If EdkIIRedfishResourceConfigCheck fails according to the logic and
> comment: new resources should be provisioned, so the POST method must be
> used. Fourth parameter of EdkIIRedfishResourceConfigProvisioning is BOOLEAN
> HttpPostMode, so we pass TRUE here.
> 
> Cc: Abner Chang <abner.ch...@amd.com>
> Cc: Igor Kulchytskyy <ig...@ami.com>
> Cc: Nickle Wang <nick...@nvidia.com>
> Signed-off-by: Mike Maslenkin <mike.maslen...@gmail.com>
> ---
>  RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> index a26a1083cd74..4fd4845f3420 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> @@ -818,9 +818,9 @@ HandleResource (
>      // The target property does not exist, do the provision to create 
> property.
> 
>      //
> 
>      DEBUG ((REDFISH_DEBUG_TRACE, "%a provision for %s\n", __func__, Uri));
> 
> -    Status = EdkIIRedfishResourceConfigProvisioning (&SchemaInfo, Uri, 
> Private-
> >InformationExchange, FALSE);
> 
> +    Status = EdkIIRedfishResourceConfigProvisioning (&SchemaInfo, Uri,
> + Private->InformationExchange, TRUE);
> 
>      if (EFI_ERROR (Status)) {
> 
> -      DEBUG ((DEBUG_ERROR, "%a, failed to provision with GET mode: %r\n",
> __func__, Status));
> 
> +      DEBUG ((DEBUG_ERROR, "%a, failed to provision with POST mode:
> + %r\n", __func__, Status));
> 
>      }
> 
> 
> 
>      return Status;
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112583): https://edk2.groups.io/g/devel/message/112583
Mute This Topic: https://groups.io/mt/103181641/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to