From ab2eb2d5ecd084cc0531c147fe3952abde5c8a31 Mon Sep 17 00:00:00 2001 From: Nickle Wang Date: Wed, 3 Jan 2024 18:55:41 +0800 Subject: [PATCH] RedfishClientPkg/EdkIIRedfishResourceConfigLib: use HTTP cache lib Use Redfish Http cache library to query Redfish service. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez --- .../EdkIIRedfishResourceConfigLib.c | 6 ++++-- .../EdkIIRedfishResourceConfigLib.inf | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.c b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.c index 09ae3921e..ed225a23b 100644 --- a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.c +++ b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.c @@ -2,7 +2,7 @@ Redfish resource config library implementation (C) Copyright 2022 Hewlett Packard Enterprise Development LP
- Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -16,6 +16,7 @@ #include #include #include +#include EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL *mRedfishResourceConfigProtocol = NULL; EFI_HANDLE mCachedHandle; @@ -56,7 +57,8 @@ GetRedfishSchemaInfo ( return EFI_INVALID_PARAMETER; } - Status = GetResourceByUri (RedfishService, Uri, &Response); + ZeroMem (&Response, sizeof (Response)); + Status = RedfishHttpGetResource (RedfishService, Uri, &Response, TRUE); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, failed to get resource from %s: %r", __func__, Uri, Status)); return Status; diff --git a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf index 0da3423d2..a5a81e9a2 100644 --- a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf +++ b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf @@ -1,6 +1,7 @@ ## @file # # (C) Copyright 2022 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -38,6 +39,7 @@ MemoryAllocationLib RedfishFeatureUtilityLib RedfishPlatformConfigLib + RedfishHttpCacheLib [Protocols] gEdkIIRedfishResourceConfigProtocolGuid ## CONSUMES ##