public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [edk2-redfish-client][PATCH v2 03/10] RedfishClientPkg/ComputerSystemCollectionDxe: use HTTP cache lib
@ 2024-01-04  2:31 Nickle Wang via groups.io
  0 siblings, 0 replies; only message in thread
From: Nickle Wang via groups.io @ 2024-01-04  2:31 UTC (permalink / raw)
  To: devel; +Cc: Abner Chang, Igor Kulchytskyy, Nick Ramirez

Use Redfish Http cache library to query Redfish service.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
---
 .../ComputerSystemCollectionDxe.inf           |  2 ++
 .../ComputerSystemCollectionDxe.c             | 26 +++++++++----------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.inf b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.inf
index 107d6c07..b848f69f 100644
--- a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.inf
+++ b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.inf
@@ -3,6 +3,7 @@
 #  Redfish ComputerSystemCollection collection driver.
 #
 #  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP<BR>
+#  Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -40,6 +41,7 @@
   UefiBootServicesTableLib
   EdkIIRedfishResourceConfigLib
   RedfishVersionLib
+  RedfishHttpCacheLib
 
 [Protocols]
   gEdkIIRedfishConfigHandlerProtocolGuid    ## CONSUMED
diff --git a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
index 74003406..05d74625 100644
--- a/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
+++ b/RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystemCollectionDxe.c
@@ -3,7 +3,7 @@
   Redfish feature driver implementation - ComputerSystemCollection
 
   (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP<BR>
-  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
 
@@ -256,17 +256,17 @@ ReleaseCollectionResource (
   //
   // Release resource
   //
-  if (Private->RedResponse.Payload != NULL) {
+  if (Private->Response.Payload != NULL) {
     RedfishFreeResponse (
-      Private->RedResponse.StatusCode,
-      Private->RedResponse.HeaderCount,
-      Private->RedResponse.Headers,
-      Private->RedResponse.Payload
+      Private->Response.StatusCode,
+      Private->Response.HeaderCount,
+      Private->Response.Headers,
+      Private->Response.Payload
       );
-    Private->RedResponse.StatusCode  = NULL;
-    Private->RedResponse.HeaderCount = 0;
-    Private->RedResponse.Headers     = NULL;
-    Private->RedResponse.Payload     = NULL;
+    Private->Response.StatusCode  = NULL;
+    Private->Response.HeaderCount = 0;
+    Private->Response.Headers     = NULL;
+    Private->Response.Payload     = NULL;
   }
 
   if (Private->CollectionJson != NULL) {
@@ -298,13 +298,13 @@ CollectionHandler (
   //
   // Query collection from Redfish service.
   //
-  Status = GetResourceByUri (Private->RedfishService, Private->CollectionUri, &Private->RedResponse);
+  Status = RedfishHttpGetResource (Private->RedfishService, Private->CollectionUri, &Private->Response, TRUE);
   if (EFI_ERROR (Status)) {
     DEBUG ((DEBUG_ERROR, "%a: unable to get resource from: %s :%r\n", __func__, Private->CollectionUri, Status));
     goto ON_RELEASE;
   }
 
-  Private->CollectionPayload = Private->RedResponse.Payload;
+  Private->CollectionPayload = Private->Response.Payload;
   ASSERT (Private->CollectionPayload != NULL);
 
   Private->CollectionJson = JsonDumpString (RedfishJsonInPayload (Private->CollectionPayload), EDKII_JSON_COMPACT);
@@ -370,7 +370,7 @@ RedfishCollectionFeatureCallback (
   Private->InformationExchange = InformationExchange;
 
   //
-  // Find Redfish version on BMC
+  // Find Redfish version on Redfish service.
   //
   Private->RedfishVersion = RedfishGetVersion (RedfishService);
 
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113117): https://edk2.groups.io/g/devel/message/113117
Mute This Topic: https://groups.io/mt/103515961/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-04  2:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-04  2:31 [edk2-devel] [edk2-redfish-client][PATCH v2 03/10] RedfishClientPkg/ComputerSystemCollectionDxe: use HTTP cache lib Nickle Wang via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox