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 2FEA19414B7 for ; Mon, 4 Mar 2024 13:27:06 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=c/cluZYg+pXjwN9oEAshv4/gxbz+wfIWw2KC2Llt3QM=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results: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=20140610; t=1709558824; v=1; b=hZg5UQ7YExeyLGMITxR8WsI1XS8tDMUrfuNBnrfEMblmHFWhqfaQ7GxB7bAUsn+E0vZMBFD9 cfIVYcYeZ0RLHIAXIJw4FxbYTGenj/Q7aTlgib3/OeYyOM02RNOJlGyUN7sUyFkq9sj0GEFBv5E a/+t6iP+ZUJOdQjV8qDQuvuo= X-Received: by 127.0.0.2 with SMTP id V7ohYY7687511xBM2KCldONt; Mon, 04 Mar 2024 05:27:04 -0800 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.62]) by mx.groups.io with SMTP id smtpd.web10.98373.1709558824069493807 for ; Mon, 04 Mar 2024 05:27:04 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JdZQO6/prxmjv809JUhJbh5TfEMZC2x9z0CccHERH5m7al7PWrnx7pUqnE+iBvinSX2EFEfscFaGXvnRWe4SLEN+NIijEuVkpY6kwK3HPWNHBaKl1j5+OPqmZOyNkzGYV2sV7DksaW4AzNJ05leg102+kSWqj80PB+zQK+pqF/CMT1e1OJ7LCvuj6nWHtuoiN7a4KTeG5F9kKw4HAeevKAsSQkgIrPYqRuctbJPGhTEmv/jJquU/Bo8DNwh1oX7Pgw18PROKwjAn6KCdb4tT3xfuccEDoFQjofnHNvWafWpz0iBFpmciO8NOX12hnkFzNCVGLmLSE3wCf1Wb8WjeMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0UizO1WQ9EiBX+W6oT7hWuTXCDukNMFqrgz46MWK+WY=; b=iXRsCVn1bQu65dy6W7PnkOAm/MtHjZD7ibVu7lZHfX5+huqMUGDRDdf+LkjxQZIDkBr3yTHDXRK2ts2uUQt7g+QZ2hI9XCBBHAdMu7+yrMpGMZ+VH75FeJC/chLplmqivPc6XqUsOT13lmWZvhfj/MZHUHnSvzvj7SRXb0OUTOtaCAQAkDwOas3iKlBazxVka8qvpw8y9LNnd8bKDChINVIoUgbJOPQ3ThHOvoTLk1o/xdJRF/aMXWgw9BqLkgp87TtGcrXOYsJ9Lu2KE8RlLvCWaB/IEgyYlIsoX+yWQKvUacgrVDxqXrq5b7yd2Q0BTsgcslkdXDBTm3nT/GEXlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) X-Received: from PH7PR17CA0013.namprd17.prod.outlook.com (2603:10b6:510:324::6) by MN0PR12MB6002.namprd12.prod.outlook.com (2603:10b6:208:37e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.38; Mon, 4 Mar 2024 13:26:59 +0000 X-Received: from SN1PEPF0002BA51.namprd03.prod.outlook.com (2603:10b6:510:324:cafe::45) by PH7PR17CA0013.outlook.office365.com (2603:10b6:510:324::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39 via Frontend Transport; Mon, 4 Mar 2024 13:26:59 +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 SN1PEPF0002BA51.mail.protection.outlook.com (10.167.242.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Mon, 4 Mar 2024 13:26:56 +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; Mon, 4 Mar 2024 05:26:44 -0800 X-Received: from rnnvmail203.nvidia.com (10.129.68.9) 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; Mon, 4 Mar 2024 05:26:43 -0800 X-Received: from NV-CL38DL3.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Mon, 4 Mar 2024 05:26:42 -0800 From: "Nickle Wang via groups.io" To: CC: Abner Chang , Igor Kulchytskyy , "Nick Ramirez" Subject: [edk2-devel] [edk2-redfish-client][PATCH 1/3] RedfishClientPkg: introduce Redfish resource config2 protocol. Date: Mon, 4 Mar 2024 21:26:42 +0800 Message-ID: <20240304132642.41098-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: SN1PEPF0002BA51:EE_|MN0PR12MB6002:EE_ X-MS-Office365-Filtering-Correlation-Id: 8343a37a-b00a-466e-30d9-08dc3c4ec3d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: xjZbSBXEDuR7EhzU6YlR2unhWH5MJhFnrJNjRiVovY3fe6MquSWkjGF3SSGqeO7Hqm4s6AapcQG4mAYs+WOA3iIJLhB7h+Vdn2ioCWlDTzRu3pxONHJggByRlNcVo/Bjd0bRdjg08tccMD3Wv3Dd+Xl4mXHMDF1qZTcitwf1wKDnepoeMl+9EKeXl6ljacqlsj2Idz3bjFIKODlEhp661ZqRThHhE7xIZEUcu32ZpQurRVV3SqE9P7rSPVxo0kTp0jiXj+WvC7CoJ3fM3Ediboem86sa9gUFysMnnY3GuxN4h53r/f/O7NNbU0LTpc/p5eKeNoGt5WmiBpDAQ3V87A0EE6wqMHEgR1QX8j44t+QJ4WmrlGITRRvwVmwsTsAOcsSH26Fpgu+d3YkJ2s9CuI1a8hpxKM7J6pbt8wWSi9z2Ur3GRaTUPrLOiJPyMf0kGPKiT2vt6O0yyzTMHm6N2mW+loW15y4j5Ntg+h4CWY7QsGACnHrH+JI4XtKuCVcfYOTDFrbGCrla0ELisKeExNC3bxbdDsXGgBTSns9x9T3Y86vYxdutH0/newRq9dNAdSHlb1fjOxc6wu5TzP1gCaO7oNLqHkzKLF+Qks5jbhEwPrbf2EWCEitfdbozzpbZifF0FTpXWxKPM0WvUQ70cA176DrMaQiercIJbuPzpZfA8ZtiTXb07GKgluaY9b9NuxrlaunxkrOfjNZUYhmn9RpyHu0swIS/ThdxPfJjsUHwMPvKcYTLy7u7WqKAy+Xj X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2024 13:26:56.9071 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8343a37a-b00a-466e-30d9-08dc3c4ec3d6 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: SN1PEPF0002BA51.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6002 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: tYgSsQsPQF6zruR4MgAGJs14x7686176AA= 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=20140610 header.b=hZg5UQ7Y; 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 | 148 ++++++++++++++++++ 2 files changed, 150 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..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 + +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 JSON data in ASCII string format. T= his is optional. + @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 JSON data in ASCII string format. T= his 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_CONFI= G2_PROTOCOL instance. + @param[in] Uri The target URI to consume. + @param[in] JsonText The JSON data in ASCII string format. T= his 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_CONFI= G2_PROTOCOL instance. + @param[in] Uri The target URI to consume. + @param[in] JsonText The JSON data in ASCII string format. T= his 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_CONFI= G2_PROTOCOL instance. + @param[in] Uri The target URI to consume. + @param[in] JsonText The JSON data in ASCII string format. T= his is optional. + + @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 (#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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-