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 7F65BAC12CE for ; Wed, 6 Mar 2024 14:15:44 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=VU25fWl43KWh6rGt/XvoGwL2UDS09v5t96rXedicZ1c=; 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=1709734543; v=1; b=f472VeWPAUsavl83mTSYOIT+oKojpl1dlCGbWJSfpaw/ARZLGvzB/MlItYNUq3eBSAcykZPH /GlFLC3g7tZt8roQeZor8F0n9a6H79BDVykmCRm16u0MHCvWragcsd/rwenAT/g3xAQv2up5hDA bBCzBI+HroUWBRpEFhaZCDc6n95miN1DLlOZvhNKZ0wHCA05lMp7M8dGhr6j99FTu+0vEBrZXB7 JW5jDE7tQstjCFOoR20ktcOfEhAtUy1vbD0d3y5ji6Fvhy6QZ2YGJskiLQKfYG0GuvfIS7KL5X/ WLZM5B+lDQxZoBPDYt/ni7Ak09+MKkkdnSpNvjpB1d1BQ== X-Received: by 127.0.0.2 with SMTP id KR1tYY7687511xavJvRzKv1y; Wed, 06 Mar 2024 06:15:43 -0800 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.57]) by mx.groups.io with SMTP id smtpd.web10.12768.1709734542692124558 for ; Wed, 06 Mar 2024 06:15:42 -0800 X-Received: from CH2PR08CA0016.namprd08.prod.outlook.com (2603:10b6:610:5a::26) by SJ0PR12MB7083.namprd12.prod.outlook.com (2603:10b6:a03:4ae::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39; Wed, 6 Mar 2024 14:15:36 +0000 X-Received: from CH2PEPF00000099.namprd02.prod.outlook.com (2603:10b6:610:5a:cafe::db) by CH2PR08CA0016.outlook.office365.com (2603:10b6:610:5a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.49 via Frontend Transport; Wed, 6 Mar 2024 14:15:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.118.233) by CH2PEPF00000099.mail.protection.outlook.com (10.167.244.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Wed, 6 Mar 2024 14:15:35 +0000 X-Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) 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 06:15:22 -0800 X-Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail203.nvidia.com (10.126.190.182) 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 06:15:22 -0800 X-Received: from NV-CL38DL3.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Wed, 6 Mar 2024 06:15:21 -0800 From: "Nickle Wang via groups.io" To: CC: Abner Chang , Igor Kulchytskyy , "Nick Ramirez" Subject: [edk2-devel] [edk2-redfish-client][PATCH v2 1/3] RedfishClientPkg: introduce Redfish resource config2 protocol. Date: Wed, 06 Mar 2024 06:15:42 -0800 Message-ID: <20240306141521.24311-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: CH2PEPF00000099:EE_|SJ0PR12MB7083:EE_ X-MS-Office365-Filtering-Correlation-Id: 7b2e6884-c9ef-4cd9-03fd-08dc3de7e45a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: GEVOdF/3hPk2mMeZEgndRDD/R3/eJk2im8QS4TXzbkhRFpNU3aOEKvM3AZuo9xvuw/e0uY5Vt/s8J4o296xNl+ljMkXhja91AC5PZus8xVN1qFsGcPUW2bd1Z+8+nUdECN2waqAllxePUNdLFU+xAqL9zPK4623KZH181GCaNFyFtwzwxT5GO8tEkroIi7yDfxS+2wjhA6hqcGzy54OQU3VrvayuKj0u48a5lkPdT+v3DwNkVNKXFJL4q6gO+ak8rnRYPFvEwjEnhiihHOUE2IhxPpDloXbPu+cqFAvJrczwIzNQweP2g5n08H+en5SSdUKx9Op+kd7E+0dUgJUteokJ1qcQD72B7fi/boUK1sirFt17qQCILONf5vaqI+L3ZqISXXSLBibJ1UTYcgNEPnvG/V5AlvcUQc8XtxfUNRq77AKUeVzqQzgnbEL0NAUnLxkQFM1vffyPmSe+vnWBuHHWusp+ts798VR/biz00Ru+jQC6LXE7cLY63Myxv/8a4KMWtkvLj+5TWQP/1DdVBY5857s3OlHrKH+A0FG2kunEDDKga0qOFUHPfpeMGPPU1WZB112jbLe+2Vu47zipI9otDvBohsu/hDeCBiKKhQRb3pkUxceGRFNsFujak89kiAG7JaO6mt2Zj4ca9GZmAyVCg+fQvAxo0iKvjt4ASB0YcMdbBZMR0LOlkj5n1TGvQcgbyBtu6tRGndWMclhtGweB192Q3OGFdSLnh5jqZHENzw+A5RvLanGh3TB8Jp0L X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2024 14:15:35.5893 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b2e6884-c9ef-4cd9-03fd-08dc3de7e45a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF00000099.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7083 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: 9LwhNoPz1ujAt3xqf9mv8CODx7686176AA= 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=f472VeWP; 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 (#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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-