public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Nickle Wang via groups.io" <nicklew=nvidia.com@groups.io>
To: <devel@edk2.groups.io>
Cc: Abner Chang <abner.chang@amd.com>,
	Igor Kulchytskyy <igork@ami.com>,
	"Nick Ramirez" <nramirez@nvidia.com>
Subject: [edk2-devel] [edk2-redfish-client][PATCH 1/3] RedfishClientPkg: introduce Redfish resource config2 protocol.
Date: Mon, 4 Mar 2024 21:26:42 +0800	[thread overview]
Message-ID: <20240304132642.41098-1-nicklew@nvidia.com> (raw)

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     | 148 ++++++++++++++++++
 2 files changed, 150 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..96384e265
--- /dev/null
+++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h
@@ -0,0 +1,148 @@
+/** @file
+  This file defines the EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL interface.
+
+  Copyright (c) 2023, 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 JSON data in ASCII string format. This is optional.
+  @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 JSON data in ASCII string format. This is optional.
+
+  @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 JSON data in ASCII string format. This is optional.
+
+  @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 JSON data in ASCII string format. This is optional.
+
+  @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 JSON data in ASCII string format. This is optional.
+
+  @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 (#116315): https://edk2.groups.io/g/devel/message/116315
Mute This Topic: https://groups.io/mt/104721509/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



             reply	other threads:[~2024-03-04 13:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04 13:26 Nickle Wang via groups.io [this message]
2024-03-06  5:16 ` [edk2-devel] [edk2-redfish-client][PATCH 1/3] RedfishClientPkg: introduce Redfish resource config2 protocol Chang, Abner via groups.io
2024-03-06 14:17   ` Nickle Wang via groups.io

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240304132642.41098-1-nicklew@nvidia.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox