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 D4B6994114C for ; Mon, 18 Dec 2023 05:32:18 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=n2alqoYBYxWn7vmrCevnKUD4Sjnpery8KUv2jQH4YRA=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20140610; t=1702877537; v=1; b=mFk2bKKComJGYNkQGu4HsqJYNMJEmuvbR1Mfj105MuVw+v0nG6dp/ACtQg/N1DXL9GMh8290 XFijrd5/NpiSYFA4sdEwvZpFu/ioqKJPYRvPUZNidU0nTQysVTsXQGudT0tF5VnFcmAWZrvWbcg 036ZIWwfOZQL1wgot+u5yHY8= X-Received: by 127.0.0.2 with SMTP id 6gOoYY7687511x8oKGPwQ3zq; Sun, 17 Dec 2023 21:32:17 -0800 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.57]) by mx.groups.io with SMTP id smtpd.web10.36754.1702877536475203687 for ; Sun, 17 Dec 2023 21:32:16 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d25GpSThHNKeUGX7ebIJaXIYaqNVXL247dpqbq/uG4Rj82tQHNMJp+JHVKJZgCj6KcicU2tSkKaNi+Kv5lZCtXYDhASrtQLpjGMjxBcxzH3SbH0MIsarGnxGm538RwfdtZhtydSVeavGiiK+QVkNnRPLT7AIbXn4hXXxhHsW7JRewH2S/FRCA2MzX1YemfEU6c0Rf9r322dQW0TEVmSRke5owjAJPOYJYcg/m5Tr1rhBXRqvn8hImJjXf2o/RXA6qbTS0GvYCZ83IQ0rxS/svNbRWk9pXPDMHW2y+BzDYHaVwq4iJ7a60xoXOw7HYZaiA6719W9q4fJvIfBrDUbl6Q== 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=yfkwUrZm7qLLiPmIvEf2O1CoW+43XnZWc3id+gp4vVU=; b=l6oDrwqCYFM8NSvP3TrLqYO/9cXtLJ/IaEDl4A+ooZkx1GvCyCCtD5JqzpHGLJusvb4DsWaQmuF6L/QZSlQYGimOKwTzdpg/OgvnFzn4ZN6Hl6idTFuuItXdtITWNipgmARcN/yZBnIGw9EcGEvumuV1wGg/SHOHKzbFGsChzekmxcsKa8MkePpkI2fazCjOOGtM7Ji+w7D5Uy3FxacpF5iMepUSPpM43kpVclWYILXRl8NkO/2w9bfyblJhmiYTl6SdpH356w1EA/t1MrjOW06Q4TYuY+kHbUb7c1p+ZmjzgP1zJ0Gl4r12bOzrSlCnUfSi2fIAAPPmp6oInoJ/sA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by PH7PR12MB8040.namprd12.prod.outlook.com (2603:10b6:510:26b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.37; Mon, 18 Dec 2023 05:32:10 +0000 X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::91d9:e679:32a3:dd05]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::91d9:e679:32a3:dd05%5]) with mapi id 15.20.7091.034; Mon, 18 Dec 2023 05:32:09 +0000 From: "Chang, Abner via groups.io" To: M M , "devel@edk2.groups.io" CC: Nickle Wang , "igork@ami.com" Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH 4/4] RedfishClientPkg: use POST method while provisioning new property. Thread-Topic: [edk2-devel] [edk2-redfish-client][PATCH 4/4] RedfishClientPkg: use POST method while provisioning new property. Thread-Index: AQHaLupDeNKhwtznNki0a/Uf6UpZ2bCplR4AgASnokyAAEwD8A== Date: Mon, 18 Dec 2023 05:32:09 +0000 Message-ID: References: <20231215000400.5311-1-mike.maslenkin@gmail.com> <20231215000400.5311-5-mike.maslenkin@gmail.com> <17A1C5C572E0EF8A.24236@groups.io> <034F184D-20DC-4FFC-A40B-2426CF0085CD@gmail.com> In-Reply-To: <034F184D-20DC-4FFC-A40B-2426CF0085CD@gmail.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=de0509dc-2f13-4abc-9021-9adf72488dfe;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-12-18T05:30:22Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|PH7PR12MB8040:EE_ x-ms-office365-filtering-correlation-id: 1d01e10b-2341-4c6f-5afb-08dbff8aae32 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 2JuNmAE9oUknPOXOVg1Ep9aO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-ascii?Q?L3Ggb86PyX21nphUcCKMMVjoDCtktuNMfpvpug1ldgZwx6oxD5BozU4GMcp/?= =?us-ascii?Q?4kQ9stMavFmzo1KLbOlik8ybXbddsiPDJt96tVU1w4FWCBmEcBglxOGDYaG5?= =?us-ascii?Q?B0Wy0cD/R/W7T00Tl2K9BNvXOtiL3FPPqbwjqzLqkAipFq8jtqmC+nOH1/Jb?= =?us-ascii?Q?wdweDgBpp+WVQ/soyUXDXwhLiZkMqQwDcDdby97FktLn3Wq8IlUeDeh3b5Gc?= =?us-ascii?Q?FrAfKQJISMcnoCrkr6jzTnZDfG0rzxWySQ8woqiQ69M3IJrjnBFwGXnCN5lp?= =?us-ascii?Q?srcKeLk5AeKBTGJuGoVA5/LIsyozJdHwbZhuNlTYe8XqjGf4BBBIeAOKJPdW?= =?us-ascii?Q?5JBPC+Jm5wacjOYUF/t+MA1uhKvXu58hYARe2ZwaixQnmexBzFsn8hFResdq?= =?us-ascii?Q?wL1sXoN8IryMKFhZygF5/j1V11lYc1ON8ax2m1tK?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d01e10b-2341-4c6f-5afb-08dbff8aae32 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Dec 2023 05:32:09.5684 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: hp6gvgvZ5FmT2FUymI8wEghTai5jp0PydQqqNHqzBcC6I7oHPMFtgWvNZZ8COYEoCW4GJYT1R8WtB2E9sk4n7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8040 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,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 5o7gVj2AZW2dooX4Yy6xy6J0x7686176AA= Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MN2PR12MB39661B33A0249DAA402E94FBEA90AMN2PR12MB3966namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=mFk2bKKC; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io --_000_MN2PR12MB39661B33A0249DAA402E94FBEA90AMN2PR12MB3966namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Yes, this is something we have to make it clear to support PUT, POST and PA= TCH for different scenarios. Agree we can just drop 4/4 for now, I will add= this to the TODO list. Thanks Abner From: M M Sent: Monday, December 18, 2023 8:58 AM To: devel@edk2.groups.io; mike.maslenkin@gmail.com Cc: Nickle Wang ; Chang, Abner ; i= gork@ami.com Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH 4/4] RedfishClientPkg= : use POST method while provisioning new property. Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding. On 18. 12. 2023., at 03:33, Mike Maslenkin via groups.io = > wrote: Hi Nickle, On 15. 12. 2023., at 04:53, Nickle Wang > wrote: Hi Mike, Per Redfish specification 7.9 POST(create) "The POST request is submitted to the resource collection to which the new = resource will belong." If this is not a collection resource, we cannot use POST method. And /redfi= sh/v1/Systems/SYS_ID/Bios is not a collection resource. The allowed method = returned from BMC for BIOS resource is usually "GET" and "PUT". So, I think that the fourth parameter is still FALSE here. But I admit that= the function header below is confusing and did not express above rule clea= rly. /** Provisioning redfish resource by given URI. @param[in] Schema Redfish schema information. @param[in] Uri Target URI to create resource. @param[in] InformationExchange Pointer to RESOURCE_INFORMATION_EXCHANGE. @param[in] HttpPostMode TRUE if resource does not exist, HTTP POS= T method is used. FALSE if the resource exist but some of p= roperties are missing, HTTP PUT method is used. @retval EFI_SUCCESS Value is returned successfully. @retval Others Some error happened. **/ Below is my suggestion. @param[in] HttpPostMode TRUE if target resource is a member of co= llection resource, HTTP POST method is used. FALSE if target= resource is non-collection resource, HTTP PUT method is used. Do you think this helps to explain the use-case of fourth parameter more cl= early? Thanks, Nickle Seems like more comments need to be changed.... The idea behind this patch is the basis of the current implementation of Re= dfishClientPkg/Features/Bios/v1_0_9. The EdkIIRedfishResourceConfigProvisioning function calls the EDKII_REDFISH= _RESOURCE_CONFIG_PROTOCOL::Provisioning function, this is RedfishResourceProvisioningResource() for this driver[1], then it c= alls RedfishProvisioningResourceCommon() where the logic of this flag is completely changed [2]. So, for the current implementation of this flag, it is not a choice between= POST and PUT, but between POST and PATCH (see [1]). May be flag should not be inverted here [3]? The value of FALSE here (you expect PUT to be used) means the following Pro= visioningBiosExistResource() function calls ProvisioningBiosProperties() with ProvisionMode =3D=3D TRUE. This Provision= Mode =3D=3D TRUE forces PropertyChanged set into TRUE, so finally ProvisioningBiosProperties() returns success even for elements t= hat do not exist. Here I mean elements of /redfish/v1/Systems/{SystemID}/Bios/Attributes. I'm= in situation when Attributes exists, but it is empty. Currently the PUT method is not used anywhere in RedfishClientPkg/Features/= Bios and "PUT back to instance" actually performs the PATCH. I will drop this patch from the current PR until it becomes clear how this = can be improved. Forgot to add the links: [1] https://github.com/tianocore/edk2-redfish-client/blob/main/RedfishClien= tPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c#L50 [2] https://github.com/tianocore/edk2-redfish-client/blob/main/RedfishClien= tPkg/Features/Bios/v1_0_9/Common/BiosCommon.c#L518 [3] https://github.com/tianocore/edk2-redfish-client/blob/main/RedfishClien= tPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c#L68 Regards, Mike. -----Original Message----- From: Mike Maslenkin > Sent: Friday, December 15, 2023 8:04 AM To: devel@edk2.groups.io Cc: abner.chang@amd.com; Nickle Wang >; igork@ami.com; Mike Maslenkin > Subject: [edk2-redfish-client][PATCH 4/4] RedfishClientPkg: use POST method while provisioning new property. External email: Use caution opening links or attachments If EdkIIRedfishResourceConfigCheck fails according to the logic and comment: new resources should be provisioned, so the POST method must be used. Fourth parameter of EdkIIRedfishResourceConfigProvisioning is BOOLEAN HttpPostMode, so we pass TRUE here. Cc: Abner Chang > Cc: Igor Kulchytskyy > Cc: Nickle Wang > Signed-off-by: Mike Maslenkin > --- RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c index a26a1083cd74..4fd4845f3420 100644 --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c @@ -818,9 +818,9 @@ HandleResource ( // The target property does not exist, do the provision to create prope= rty. // DEBUG ((REDFISH_DEBUG_TRACE, "%a provision for %s\n", __func__, Uri)); - Status =3D EdkIIRedfishResourceConfigProvisioning (&SchemaInfo, Uri, P= rivate- InformationExchange, FALSE); + Status =3D EdkIIRedfishResourceConfigProvisioning (&SchemaInfo, Uri, + Private->InformationExchange, TRUE); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a, failed to provision with GET mode: %r\n", __func__, Status)); + DEBUG ((DEBUG_ERROR, "%a, failed to provision with POST mode: + %r\n", __func__, Status)); } return Status; -- 2.32.0 (Apple Git-132) -=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 (#112634): https://edk2.groups.io/g/devel/message/112634 Mute This Topic: https://groups.io/mt/103181641/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- --_000_MN2PR12MB39661B33A0249DAA402E94FBEA90AMN2PR12MB3966namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

[AMD Official Use Only - General]


Yes, this is something we have to make it clear to s= upport PUT, POST and PATCH for different scenarios. Agree we can just drop = 4/4 for now, I will add this to the TODO list.

 

Thanks

Abner

 

From: M M <mike.maslenkin@gmail.com> Sent: Monday, December 18, 2023 8:58 AM
To: devel@edk2.groups.io; mike.maslenkin@gmail.com
Cc: Nickle Wang <nicklew@nvidia.com>; Chang, Abner <Abner.C= hang@amd.com>; igork@ami.com
Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH 4/4] RedfishCl= ientPkg: use POST method while provisioning new property.

 

Caution: This message originated from an External Source. Use proper caution= when opening attachments, clicking links, or responding.

 

 



On 18. 12. 2023., at 03:33, Mike Maslenkin via groups.io <m= ike.maslenkin=3Dgmail.com@groups.io> wrote:

 

 

Hi Nickle,



On 15. 12. 2023., at 04:53, Nickle Wang <nicklew@nvidia.com> wrote:=

 

Hi Mike,

Per Redfish specification 7.9 POST(create)

"The POST request is submitted to the resource collection to which the= new resource will belong."

If this is not a collection resource, we cannot use POST method. And /redfi= sh/v1/Systems/SYS_ID/Bios is not a collection resource. The allowed method = returned from BMC for BIOS resource is usually "GET" and "PU= T".

So, I think that the fourth parameter is still FALSE here. But I admit that= the function header below is confusing and did not express above rule clea= rly.

/**
 Provisioning redfish resource by given URI.

 @param[in]   Schema       &nb= sp;      Redfish schema information.
 @param[in]   Uri        =          Target URI to create = resource.
 @param[in]   InformationExchange Pointer to RESOURCE_INFORM= ATION_EXCHANGE.
 @param[in]   HttpPostMode      &nb= sp; TRUE if resource does not exist, HTTP POST method is used.
            &nb= sp;            =          FALSE if the resource= exist but some of properties are missing,
            &nb= sp;            =          HTTP PUT method is us= ed.

 @retval EFI_SUCCESS         &= nbsp;    Value is returned successfully.
 @retval Others          =          Some error happened.<= br>
**/

Below is my suggestion.

 @param[in]   HttpPostMode      &nb= sp; TRUE if target resource is a member of collection resource, HTTP P= OST method is used.
            &nb= sp;            =             &nb= sp;            =           FALSE if target= resource is non-collection resource, HTTP PUT method is used.

Do you think this helps to explain the use-case of fourth parameter more cl= early?

Thanks,
Nickle

 


Seems like more comments need to be changed....

The idea behind this patch is the basis of the cu= rrent implementation of RedfishClientPkg/Features/Bios/v1_0_9.

The EdkIIRedfishResourceConfigProvisioning functi= on calls the EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL::Provisioning function,=

this is RedfishResourceProvisioningResource() for= this driver[1], then it calls RedfishProvisioningResourceCommon() where th= e logic

of this flag is completely changed [2].

So, for the current implementation of this flag, = it is not a choice between POST and PUT, but between POST and PATCH (see [1= ]).
May be flag should not be inverted here [3]? 

The value of FALSE here (you expect PUT to be use= d) means the following ProvisioningBiosExistResource() function calls<= o:p>

ProvisioningBiosProperties() with ProvisionMode = =3D=3D TRUE. This ProvisionMode =3D=3D TRUE forces PropertyChanged set into= TRUE,

so finally ProvisioningBiosProperties() returns s= uccess even for elements that do not exist.

 

Here I mean elements of /redfish/v1/Systems/{Syst= emID}/Bios/Attributes. I'm in situation when Attributes exists,<= /span>

but it is empty.

 

Currently the PUT method is not used anywhere in = RedfishClientPkg/Features/Bios and "PUT back to instance" actuall= y performs the PATCH.

 

I will drop this patch from the current PR until&nbs= p;it becomes clear how this can be improved.

 

Forgot to add the links:

 



 

Regards,

Mike.



-----Original Message-----
From: Mike Maslenkin <mike.m= aslenkin@gmail.com>
Sent: Friday, December 15, 2023 8:04 AM
To: devel@edk2.groups.io
Cc: abner.chang@amd.com; Nickle = Wang <nicklew@nvidia.com>;<= br> igork@ami.com; Mike Maslenkin <mike.maslenkin@gmail.com> Subject: [edk2-redfish-client][PATCH 4/4] RedfishClientPkg: use POST method=
while provisioning new property.

External email: Use caution opening links or attachments


If EdkIIRedfishResourceConfigCheck fails according to the logic and
comment: new resources should be provisioned, so the POST method must be used. Fourth parameter of EdkIIRedfishResourceConfigProvisioning is BOOLEAN=
HttpPostMode, so we pass TRUE here.

Cc: Abner Chang <abner.chang@amd.= com>
Cc: Igor Kulchytskyy <igork@ami.com= >
Cc: Nickle Wang <nicklew@nvidia.co= m>
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
---
RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
index a26a1083cd74..4fd4845f3420 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
@@ -818,9 +818,9 @@ HandleResource (
    // The target property does not exist, do the provi= sion to create property.

    //

    DEBUG ((REDFISH_DEBUG_TRACE, "%a provision for= %s\n", __func__, Uri));

-    Status =3D EdkIIRedfishResourceConfigProvisioning (&= ;SchemaInfo, Uri, Private-

InformationExchange, FALSE);


+    Status =3D EdkIIRedfishResourceConfigProvisioning (&= ;SchemaInfo, Uri,
+ Private->InformationExchange, TRUE);

    if (EFI_ERROR (Status)) {

-      DEBUG ((DEBUG_ERROR, "%a, failed to pr= ovision with GET mode: %r\n",
__func__, Status));

+      DEBUG ((DEBUG_ERROR, "%a, failed to pr= ovision with POST mode:
+ %r\n", __func__, Status));

    }



    return Status;

--
2.32.0 (Apple Git-132)

 

 

 

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#112634) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_MN2PR12MB39661B33A0249DAA402E94FBEA90AMN2PR12MB3966namp_--