diff options
author | liboz <libo.zheng@arris.com> | 2019-07-30 13:49:44 -0400 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2019-07-31 18:54:34 +0000 |
commit | dbc8f5ec2d52866acdefb6d6a9801f9c1d771bb6 (patch) | |
tree | a59e6af8e814fe4de0b6a8e75445f290e0e4d629 /platform-logic/generic-resource-api/src/main/xml | |
parent | 18dcbec3a5a99a57d0ef43a06a99c2ab17c2eed6 (diff) |
Fix reuse InstanceName when re-creating a service
Add instance id instead of NULL to context_id when creating entry in
GENERIC_RESOURCE_NAME table, Delete entry directly if no prefix and
name_index involved when rolling back instance name
Issue-ID: SDNC-798
Change-Id: I4c6391bf85e289894fd3019eafe76357b9b1c86c
Signed-off-by: liboz <libo.zheng@arris.com>
Former-commit-id: ae2694d30df3a7f62324ec7e617d23f187debcbb
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml')
3 files changed, 11 insertions, 5 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-unique-name.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-unique-name.xml index 267a2cc0..73938422 100755 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-unique-name.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_generate-unique-name.xml @@ -32,7 +32,7 @@ <block atomic="true">
<set>
<parameter name='tmp.gun.sql' value="`'insert into GENERIC_RESOURCE_NAME values ( '
-+ ' $generate-unique-name-input.name-table-type , $generate-unique-name-input.supplied-name , null , null, null )'`" />
++ ' $generate-unique-name-input.name-table-type , $generate-unique-name-input.supplied-name , null , null, $generate-unique-name-input.service-instance-id )'`" />
</set>
<save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key="`$tmp.gun.sql`" pfx='pfx'>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_rollback-generated-names.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_rollback-generated-names.xml index d36c4066..41a64686 100644 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_rollback-generated-names.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_rollback-generated-names.xml @@ -47,12 +47,17 @@ </set>
</outcome>
<outcome value='SERVICE_INSTANCE'>
- <set>
- <parameter name='rollback-generated-names.index-table-name'
+ <block>
+ <set>
+ <parameter name='rollback-generated-names.index-table-name'
value='SERVICE_INSTANCE_NAME_INDEX' />
- <parameter name='rollback-generated-names.index-table.name-prefix-column'
+ <parameter name='rollback-generated-names.index-table.name-prefix-column'
value='service_instance_name_prefix' />
- </set>
+ </set>
+ <delete plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
+ key='DELETE from GENERIC_RESOURCE_NAME WHERE type = $rollback-generated-names-input.naming-type
+ AND context_id = $rollback-generated-names-input.context-id AND prefix IS NULL AND name_index IS NULL'></delete>
+ </block>
</outcome>
<outcome value='VNF_INSTANCE'>
<set>
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-assign.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-assign.xml index dda220aa..c9300bd1 100755 --- a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-assign.xml +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_service-topology-operation-assign.xml @@ -121,6 +121,7 @@ <set>
<parameter name='generate-unique-name-input.name-table-type' value='SERVICE_INSTANCE' />
<parameter name='generate-unique-name-input.supplied-name' value='`$service-topology-operation-input.service-request-input.service-instance-name`' />
+ <parameter name='generate-unique-name-input.service-instance-id' value='`$service-topology-operation-input.service-information.service-instance-id`' />
</set>
<call module='GENERIC-RESOURCE-API' rpc='generate-unique-name' mode='sync' >
<outcome value='failure'>
|