* [edk2-devel] [edk2-redfish-client][PATCH v2 1/3] RedfishClientPkg: introduce Redfish resource config2 protocol.
@ 2024-03-06 14:15 Nickle Wang via groups.io
0 siblings, 0 replies; only message in thread
From: Nickle Wang via groups.io @ 2024-03-06 14:15 UTC (permalink / raw)
To: devel; +Cc: Abner Chang, Igor Kulchytskyy, Nick Ramirez
Introduce EDKII Redfish Resource Config2 Protocol. Comparing to
Redfish Resource Config Protocol, this protocol adds new parameter
called "JsonText". This allows Redfish caller driver to pass JSON
context to callee. Callee save the effort of getting same data from
Redfish service again. This is useful when Redfish service supports
"expand" query parameter. "Version" is added to this protocol too so
we don't create new protocol to add new parameter in the future.
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>
---
RedfishClientPkg/RedfishClientPkg.dec | 2 +
.../EdkIIRedfishResourceConfig2Protocol.h | 158 ++++++++++++++++++
2 files changed, 160 insertions(+)
create mode 100644 RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
diff --git a/RedfishClientPkg/RedfishClientPkg.dec b/RedfishClientPkg/RedfishClientPkg.dec
index aa018d714..f894f30ab 100644
--- a/RedfishClientPkg/RedfishClientPkg.dec
+++ b/RedfishClientPkg/RedfishClientPkg.dec
@@ -48,6 +48,8 @@
gEdkIIRedfishResourceAddendumProtocolGuid = { 0xda36b12b, 0xaad4, 0x4e90, { 0xba, 0xcb, 0xe3, 0xb5, 0x3b, 0x08, 0xbc, 0x54 } }
## Include/Protocol/EdkIIRedfishOverrideProtocol.h
gEdkiiRedfishOverrideProtocolGuid = { 0xb55bef20, 0xf7c8, 0x4ae9, { 0xa7, 0xca, 0x8b, 0xba, 0x9f, 0x7b, 0xbf, 0x9c } }
+ ## Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
+ gEdkIIRedfishResourceConfig2ProtocolGuid = { 0xe9bef87f, 0xbff4, 0x4872, { 0xa9, 0xa4, 0x16, 0x59, 0xbe, 0xd9, 0x1c, 0xf4 } }
[Guids]
## Include/Guid/RedfishClientPkgTokenSpace.h
diff --git a/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
new file mode 100644
index 000000000..a0613048b
--- /dev/null
+++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
@@ -0,0 +1,158 @@
+/** @file
+ This file defines the EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL interface.
+
+ Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EDKII_REDFISH_RESOURCE_CONFIG2_H_
+#define EDKII_REDFISH_RESOURCE_CONFIG2_H_
+
+#include <Protocol/EdkIIRedfishResourceConfigProtocol.h>
+
+typedef struct _EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL;
+
+/**
+ Provision redfish resource by given URI.
+
+ @param[in] This Pointer to EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+ @param[in] Uri Target URI to create resource.
+ @param[in] JsonText The additional JSON data in ASCII string format passed to callee.
+ The usage is defined between the Redfish feature driver and subordinate
+ Redfish resource feature driver.
+ @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.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_PROVISIONING)(
+ IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL *This,
+ IN EFI_STRING Uri,
+ IN CHAR8 *JsonText OPTIONAL,
+ IN BOOLEAN HttpPostMode
+ );
+
+/**
+ Consume resource from given URI.
+
+ @param[in] This Pointer to EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+ @param[in] Uri The target URI to consume.
+ @param[in] JsonText The additional JSON data in ASCII string format passed to callee.
+ The usage is defined between the Redfish feature driver and subordinate
+ Redfish resource feature driver.
+
+ @retval EFI_SUCCESS Value is returned successfully.
+ @retval Others Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_CONSUME)(
+ IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL *This,
+ IN EFI_STRING Uri,
+ IN CHAR8 *JsonText OPTIONAL
+ );
+
+/**
+ Update resource to given URI.
+
+ @param[in] This Pointer to EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+ @param[in] Uri The target URI to consume.
+ @param[in] JsonText The additional JSON data in ASCII string format passed to callee.
+ The usage is defined between the Redfish feature driver and subordinate
+ Redfish resource feature driver.
+
+ @retval EFI_SUCCESS Value is returned successfully.
+ @retval Others Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_UPDATE)(
+ IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL *This,
+ IN EFI_STRING Uri,
+ IN CHAR8 *JsonText OPTIONAL
+ );
+
+/**
+ Check resource on given URI.
+
+ @param[in] This Pointer to EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+ @param[in] Uri The target URI to consume.
+ @param[in] JsonText The additional JSON data in ASCII string format passed to callee.
+ The usage is defined between the Redfish feature driver and subordinate
+ Redfish resource feature driver.
+
+ @retval EFI_SUCCESS Value is returned successfully.
+ @retval Others Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_CHECK)(
+ IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL *This,
+ IN EFI_STRING Uri,
+ IN CHAR8 *JsonText OPTIONAL
+ );
+
+/**
+ Identify resource on given URI.
+
+ @param[in] This Pointer to EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+ @param[in] Uri The target URI to consume.
+ @param[in] JsonText The additional JSON data in ASCII string format passed to callee.
+ The usage is defined between the Redfish feature driver and subordinate
+ Redfish resource feature driver.
+
+ @retval EFI_SUCCESS This is target resource which we want to handle.
+ @retval EFI_UNSUPPORTED This is not the target resource.
+ @retval Others Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_IDENTIFY)(
+ IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL *This,
+ IN EFI_STRING Uri,
+ IN CHAR8 *JsonText OPTIONAL
+ );
+
+/**
+ Get information about this protocol.
+
+ @param[in] This Pointer to EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL instance.
+ @param[out] Info The schema information.
+
+ @retval EFI_SUCCESS Value is returned successfully.
+ @retval Others Some error happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_GET_INFO)(
+ IN EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL *This,
+ OUT REDFISH_SCHEMA_INFO *Info
+ );
+
+struct _EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL {
+ UINT32 Version;
+ EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_PROVISIONING Provisioning;
+ EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_CONSUME Consume;
+ EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_UPDATE Update;
+ EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_CHECK Check;
+ EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_IDENTIFY Identify;
+ EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_GET_INFO GetInfo;
+};
+
+#define EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL_REVISION 0x00001000
+
+extern EFI_GUID gEdkIIRedfishResourceConfig2ProtocolGuid;
+
+#endif
--
2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116445): https://edk2.groups.io/g/devel/message/116445
Mute This Topic: https://groups.io/mt/104766136/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-03-06 14:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-06 14:15 [edk2-devel] [edk2-redfish-client][PATCH v2 1/3] RedfishClientPkg: introduce Redfish resource config2 protocol 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