From ed5c51313c1bd3745a554888c969e840341599b0 Mon Sep 17 00:00:00 2001 From: Michael Pruss Date: Mon, 31 May 2021 18:28:08 -0400 Subject: Support instantiation of same model vnfs/vf-modules When instantiating a service with multiple vnfs and/or vfmodules SO would differentiate using ModelCustomizationId. This would cause issues when creating multiple instances of same model resource, and each lookup would return the same object. Instead of using ModelCustomizationId, this patch enables SO to use instanceName parameter to differentiate the resources. Validation was added to ensure that instanceNames are provided if there are multiple resources of the same model. If there are no duplicate resources and instanceName is not set, SO will default to previous logic using ModelCustomizationId. In order to properly associate vfmodules with their parent vnfs, the Resource class was augmented with a parent reference which maintains the relationship in further processing. Id generation logic was corrected to ensure that multiple resources of the same model are assigned unique instance ids and references to parent instanceId. Issue-ID: SO-3677 Change-Id: If39a0138f501177e12262f8e911137012e287fca Signed-off-by: Michael Pruss --- .../MsoRequestTest/SuccessfulValidation/ServiceAssign.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/SuccessfulValidation/ServiceAssign.json') diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/SuccessfulValidation/ServiceAssign.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/SuccessfulValidation/ServiceAssign.json index bc6f8fc610..d8bfcc2d5b 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/SuccessfulValidation/ServiceAssign.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/SuccessfulValidation/ServiceAssign.json @@ -72,7 +72,8 @@ "modelName": "201673MowBvL._base__BV..module-0", "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", "modelCustomizationId": "a25e8e8c-58b8-4eec-810c-97dcc1f5cb7f" - }, + }, + "instanceName": "vfModule1", "instanceParams": [ { "vmx_int_net_len": "24", @@ -86,7 +87,8 @@ "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", "modelCustomizationId": "72d9d1cd-f46d-447a-abdb-451d6fb05fa8", "modelType": "vfModule" - }, + }, + "instanceName": "vfModule2", "instanceParams": [ { "availability_zone_0": "mtpocdv-kvm-az01", @@ -99,7 +101,8 @@ "modelName": "201673MowBvL._vRE_BV..module-1", "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", "modelCustomizationId": "72d9d1cd-f46d-447a-abdb-451d6fb05fa8" - }, + }, + "instanceName": "vfModule3", "instanceParams": [ { "availability_zone_0": "mtpocdv-kvm-az01", @@ -112,7 +115,8 @@ "modelName": "201673MowBvL._vPFE_BV..module-2", "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", "modelCustomizationId": "da4d4327-fb7d-4311-ac7a-be7ba60cf969" - }, + }, + "instanceName": "vfModule4", "instanceParams": [ { "availability_zone_0": "mtpocdv-kvm-az01", -- cgit 1.2.3-korg