From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 914FC940F36 for ; Thu, 7 Mar 2024 03:24:14 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=I975g4VEgs+W9b6L6+JCx/rVOmyq+W4RGqvVc6EOaRw=; c=relaxed/simple; d=groups.io; h=Received-SPF:From:To:CC:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20240206; t=1709781853; v=1; b=WW8GJo+G7UG5ROexE/uZ+JpkSKRnm2BtuspdIiTWPff++QvskHHumjbDO1+TEGxWcBZJCx6b Jc4vPY05tnDU4ttlolGDO5TY15u7LV2iRmqdjn5Gfrxq15PzwpblEu4Sm3/xX6vfq0UVy2WJS6U 33ESsyKoXdKmVeHqIZ3kTlZb4+qm0Gnf7SLv5Z6C6LGYY4YFstJb0nAUt+Nfg3xD6Z801ptV2Ef K4zgkn6d0BRYuHtCRbghwu/dKhn+33JnAGGUfr20uf4f6FeqdIz3DaGXr8XL8f8364GgynjD64S 1RV0oaDt8+6hDridWFS6d8qmgXKBkVfhJdZFv4q/TC1TA== X-Received: by 127.0.0.2 with SMTP id b4hkYY7687511x8HjnFUwWWj; Wed, 06 Mar 2024 19:24:13 -0800 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.67]) by mx.groups.io with SMTP id smtpd.web11.15042.1709781852514811963 for ; Wed, 06 Mar 2024 19:24:12 -0800 X-Received: from BL1PR13CA0325.namprd13.prod.outlook.com (2603:10b6:208:2c1::30) by CY5PR12MB6156.namprd12.prod.outlook.com (2603:10b6:930:24::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.24; Thu, 7 Mar 2024 03:24:08 +0000 X-Received: from BN2PEPF000044AA.namprd04.prod.outlook.com (2603:10b6:208:2c1:cafe::3a) by BL1PR13CA0325.outlook.office365.com (2603:10b6:208:2c1::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.6 via Frontend Transport; Thu, 7 Mar 2024 03:24:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.117.160) by BN2PEPF000044AA.mail.protection.outlook.com (10.167.243.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Thu, 7 Mar 2024 03:24:07 +0000 X-Received: from rnnvmail204.nvidia.com (10.129.68.6) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 6 Mar 2024 19:23:52 -0800 X-Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Wed, 6 Mar 2024 19:23:52 -0800 X-Received: from NV-CL38DL3.nvidia.com (10.127.8.11) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Wed, 6 Mar 2024 19:23:51 -0800 From: "Nickle Wang via groups.io" To: CC: Abner Chang , Igor Kulchytskyy , "Nick Ramirez" Subject: [edk2-devel] [edk2-redfish-client][PATCH v3 1/2] RedfishClientPkg: introduce Redfish resource config2 protocol. Date: Wed, 06 Mar 2024 19:24:12 -0800 Message-ID: <20240307032351.42542-1-nicklew@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000044AA:EE_|CY5PR12MB6156:EE_ X-MS-Office365-Filtering-Correlation-Id: 285f9062-6f16-4bcc-b545-08dc3e560ca7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: p/uGcft37LjIsaZSdrVBbfYZVQb/dpIn9jjVgAVpgCoureonopZw822vqT6XggR054jdcT7Pl5sXltwDhMcr2t+OqRBCeFTKQLtrKaZb4J+lySiPFLum5AUXZxHNzPrrZQ/DFvY71KOeFKU0tX2+OrAZX8j8hBYgpzxrAOtfcOOBlUfIjNtoavK1t8gzT/bClM29vaE4iXphClEc9Saa4MU3Rpcojbln325HzzXWHNKoERpB8r6D26m2uKnKIIat+x9cKPUHSvxNnXmErUeBu8/BbO/E7YCeAIeA8xKCCDnZhFFbkifARG3A60JtYZ85B1mMhQNMrdX7+R/zYoGCkcmexPeV0bqv8yP6CYntC9JPtASSkokUiBx/OWX685dmVxPh8jiJbMTH0Mx/C+Vfhaz5kFDpWEXp7nzUquUk+GXCzSdesZEgmpqVkdXeJMH9XQEgF8FfWr2t66b59sUVURMQ+ty0xK55szWB6wLC6CiIhfjJkth+cqmH/FfmjIN+gkVehAaemtN4ykl37KrlsgYMpe98K3/4Rz+2Eq/08a1ASG5+s734bxjCgvYoDlFyeoKhhjmDmtAubr0hdqPW0EGremmSC0NwwXm+Wy+wdDGDFyLpDp2sF1HBv6nRlXu1IIM2++6rOupH4Fe8Uxb4NQQJiQJSiNd4TLreg+mceg8DyHLZ4waylNw1bqM3W6mBej0NaIB7yEajblfrDhXCzD6iamyuPslUI1WxdmCS4VDs8FBrNZ3KlgPzJIy6j+M+ X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2024 03:24:07.8163 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 285f9062-6f16-4bcc-b545-08dc3e560ca7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000044AA.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6156 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nicklew@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 36slLZWHrzrxVUVz7ZcLYbRlx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-Spam-Flag: yes X-Spam-Level: ************ X-GND-Spam-Score: 190 X-GND-Status: SPAM Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=WW8GJo+G; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io 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 Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez --- RedfishClientPkg/RedfishClientPkg.dec | 2 + .../EdkIIRedfishResourceConfig2Protocol.h | 158 ++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceC= onfig2Protocol.h diff --git a/RedfishClientPkg/RedfishClientPkg.dec b/RedfishClientPkg/Redfi= shClientPkg.dec index aa018d714..f894f30ab 100644 --- a/RedfishClientPkg/RedfishClientPkg.dec +++ b/RedfishClientPkg/RedfishClientPkg.dec @@ -48,6 +48,8 @@ gEdkIIRedfishResourceAddendumProtocolGuid =3D { 0xda36b12b, 0xaad4, 0x4e= 90, { 0xba, 0xcb, 0xe3, 0xb5, 0x3b, 0x08, 0xbc, 0x54 } } ## Include/Protocol/EdkIIRedfishOverrideProtocol.h gEdkiiRedfishOverrideProtocolGuid =3D { 0xb55bef20, 0xf7c8, 0x4a= e9, { 0xa7, 0xca, 0x8b, 0xba, 0x9f, 0x7b, 0xbf, 0x9c } } + ## Include/Protocol/EdkIIRedfishResourceConfig2Protocol.h + gEdkIIRedfishResourceConfig2ProtocolGuid =3D { 0xe9bef87f, 0xbff4, 0x48= 72, { 0xa9, 0xa4, 0x16, 0x59, 0xbe, 0xd9, 0x1c, 0xf4 } } =20 [Guids] ## Include/Guid/RedfishClientPkgTokenSpace.h diff --git a/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2P= rotocol.h b/RedfishClientPkg/Include/Protocol/EdkIIRedfishResourceConfig2Pr= otocol.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 res= erved. + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef EDKII_REDFISH_RESOURCE_CONFIG2_H_ +#define EDKII_REDFISH_RESOURCE_CONFIG2_H_ + +#include + +typedef struct _EDKII_REDFISH_RESOURCE_CONFIG2_PROTOCOL EDKII_REDFISH_RESO= URCE_CONFIG2_PROTOCOL; + +/** + Provision redfish resource by given URI. + + @param[in] This Pointer to EDKII_REDFISH_RESOURCE_CONFI= G2_PROTOCOL instance. + @param[in] Uri Target URI to create resource. + @param[in] JsonText The additional JSON data in ASCII strin= g format passed to callee. + The usage is defined between the Redfis= h feature driver and subordinate + Redfish resource feature driver. + @param[in] HttpPostMode TRUE if resource does not exist, HTTP P= OST 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_CONFI= G2_PROTOCOL instance. + @param[in] Uri The target URI to consume. + @param[in] JsonText The additional JSON data in ASCII strin= g format passed to callee. + The usage is defined between the Redfis= h 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_CONFI= G2_PROTOCOL instance. + @param[in] Uri The target URI to consume. + @param[in] JsonText The additional JSON data in ASCII strin= g format passed to callee. + The usage is defined between the Redfis= h 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_CONFI= G2_PROTOCOL instance. + @param[in] Uri The target URI to consume. + @param[in] JsonText The additional JSON data in ASCII strin= g format passed to callee. + The usage is defined between the Redfis= h 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_CONFI= G2_PROTOCOL instance. + @param[in] Uri The target URI to consume. + @param[in] JsonText The additional JSON data in ASCII strin= g format passed to callee. + The usage is defined between the Redfis= h feature driver and subordinate + Redfish resource feature driver. + + @retval EFI_SUCCESS This is target resource which we want t= o 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_CONFI= G2_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 --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116467): https://edk2.groups.io/g/devel/message/116467 Mute This Topic: https://groups.io/mt/104781207/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-