diff options
author | marcinrzepeckiwroc <marcin.rzepecki@nokia.com> | 2020-12-03 15:14:55 +0100 |
---|---|---|
committer | Ikram Ikramullah <ikram@research.att.com> | 2020-12-21 17:32:52 +0000 |
commit | f3821edf3122600c99658c5e6c11234199f04173 (patch) | |
tree | 2192fa2578d12095a58619aab1d51c412d3ecdb9 /vid-app-common/src/main/java/org | |
parent | eb2b6b31d0e90c359a63befe1a23ba066df62d1c (diff) |
Fix for VID-927: Generated service instance name is not visible in Instantiation status table.
If user not provide Instance Name during set a new service instance, vid generate name base on service model name
(if the name is not unique, it will append the suffix)
Issue-ID: VID-927
Signed-off-by: marcinrzepeckiwroc <marcin.rzepecki@nokia.com>
Change-Id: I7d51c0d4b0b2c0765ba9f3a7302c591f19438dc4
Diffstat (limited to 'vid-app-common/src/main/java/org')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt b/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt index 17948d4b6..b69f76dfe 100644 --- a/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt +++ b/vid-app-common/src/main/java/org/onap/vid/job/command/MsoRequestBuilder.kt @@ -189,11 +189,13 @@ class MsoRequestBuilder } private fun generateServiceName(jobId: UUID?, payload: ServiceInstantiation, optimisticUniqueServiceInstanceName: String): String? { - var serviceInstanceName: String? = null - if (StringUtils.isNotEmpty(optimisticUniqueServiceInstanceName)) { - serviceInstanceName = peekServiceName(jobId, payload, optimisticUniqueServiceInstanceName) + var serviceInstanceName: String + if (StringUtils.isEmpty(optimisticUniqueServiceInstanceName)) { + serviceInstanceName = payload.modelInfo.modelName + } else { + serviceInstanceName = optimisticUniqueServiceInstanceName } - return serviceInstanceName + return peekServiceName(jobId, payload, serviceInstanceName) } private fun peekServiceName(jobId: UUID?, payload: ServiceInstantiation, optimisticUniqueServiceInstanceName: String): String { @@ -202,7 +204,7 @@ class MsoRequestBuilder if (isNameFreeInAai(optimisticUniqueServiceInstanceName, ResourceType.SERVICE_INSTANCE)) { serviceInstanceName = optimisticUniqueServiceInstanceName } else { - serviceInstanceName = asyncInstantiationBL.getUniqueName(payload.instanceName, ResourceType.SERVICE_INSTANCE) + serviceInstanceName = asyncInstantiationBL.getUniqueName(optimisticUniqueServiceInstanceName, ResourceType.SERVICE_INSTANCE) }//otherwise we used the original service instance name (from payload) to get a new unique name from DB and AAI //update serviceInfo with new name if needed |