From f6a725a0b5b6864c09443e7f328927772a78ea05 Mon Sep 17 00:00:00 2001 From: "Tait,Trevor(rt0435)" Date: Fri, 26 Oct 2018 13:27:54 -0400 Subject: SDNC context builder API Mapping Configuration Issue-ID: LOG-421 Add code to use the VNF-API on SDNC where required. This involves using the api-mapping logic to select the VNF-API over the GNERIC-RESOURCES-API as well as adding the code to extract the information required by the VNF-API from AAI and adding the code to parse the VNF-API resonse into ModelContext. Change-Id: I4447a14d7fa39b2c5d9b655c2b20e651e56d3d77 Signed-off-by: Tait,Trevor(rt0435) --- config/application.properties | 31 ++++--------- config/logback.xml | 18 -------- config/rules/api-mapping-rules.drl | 4 +- config/sdnccontextbuilder.spec | 76 ------------------------------ config/sdncgenericresource.spec | 94 ++++++++++++++++++++++++++++++++++++++ config/vnflist.spec | 19 ++++++++ 6 files changed, 124 insertions(+), 118 deletions(-) delete mode 100644 config/sdnccontextbuilder.spec create mode 100644 config/sdncgenericresource.spec create mode 100644 config/vnflist.spec (limited to 'config') diff --git a/config/application.properties b/config/application.properties index 8fc2503..6084aa0 100644 --- a/config/application.properties +++ b/config/application.properties @@ -1,27 +1,10 @@ -/* - * ============LICENSE_START=================================================== - * Copyright (c) 2018 Amdocs - * ============================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END===================================================== - */ spring.jersey.type=filter spring.mvc.urls=swagger,docs,prometheus,auditevents,info,heapdump,autoconfig,beans,loggers,dump,env,trace,health,configprops,mappings,metrics,webjars camel.springboot.xmlRoutes = file:config/dynamic/routes/*.route service.xml.beans = config/dynamic/conf/*.xml -server.contextPath=/sdnccontextbuilder/v1 +server.contextPath=/sdnccontextbuilder spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration #This property is used to set the Tomcat connector attributes.developers can define multiple attributes separated by comma @@ -36,21 +19,22 @@ sdncCtxBuilder.userId=admin sdncCtxBuilder.password=OBF:1u2a1toa1w8v1tok1u30 # SDNC REST Client Configuration -sdnc.serviceName=10.69.100.139 -sdnc.servicePort=30202 +sdnc.serviceName=10.147.112.136 +sdnc.servicePort=9506 sdnc.httpProtocol=http sdnc.user=admin sdnc.password=OBF:1ks51l8d1o3i1pcc1r2r1e211r391kls1pyj1z7u1njf1lx51go21hnj1y0k1mli1sop1k8o1j651vu91mxw1vun1mze1vv11j8x1k5i1sp11mjc1y161hlr1gm41m111nkj1z781pw31kku1r4p1e391r571pbm1o741l4x1ksp sdnc.connectionTimeout=5000 sdnc.readTimeout=1000 sdnc.genericResourcePath=/restconf/config/GENERIC-RESOURCE-API:services/service/{0} +sdnc.vnfPath=/restconf/config/VNF-API:vnfs/vnf-list/{0} #Servlet context parameters server.context_parameters.p-name=value #context parameter with p-name as key and value as value. # AAI REST Client Configuration -aai.serviceName=10.12.6.120 -aai.servicePort=30233 +aai.serviceName=10.147.112.136 +aai.servicePort=9507 aai.username=AAI aai.password=OBF:1gfr1ev31gg7 aai.httpProtocol=https @@ -63,4 +47,7 @@ aai.http.password=OBF:1u2a1toa1w8v1tok1u30 aai.searchNodeQuery=/aai/v11/search/nodes-query?search-node-type=service-instance&filter=service-instance-id:EQUALS: aai.customerQuery=/aai/v11/business/customers/customer/ +aai.serviceInstancePath=/aai/v11/business/customers/customer/{0}/service-subscriptions/service-subscription/{1}/service-instances/service-instance/{2} + + diff --git a/config/logback.xml b/config/logback.xml index 2f53172..8074057 100644 --- a/config/logback.xml +++ b/config/logback.xml @@ -1,21 +1,3 @@ -/* - * ============LICENSE_START=================================================== - * Copyright (c) 2018 Amdocs - * ============================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END===================================================== - */ - diff --git a/config/rules/api-mapping-rules.drl b/config/rules/api-mapping-rules.drl index 6278d48..629d683 100644 --- a/config/rules/api-mapping-rules.drl +++ b/config/rules/api-mapping-rules.drl @@ -23,7 +23,7 @@ rule "ApiMapping-1" no-loop true lock-on-active true when - $s : ServiceEntity( serviceType not contains "vFW" ) + $s : ServiceEntity( (serviceType not contains "vFW") && (serviceType not contains "vDNS") ) then $s.setApiName("GENERIC-RESOURCE-API"); end @@ -33,7 +33,7 @@ rule "ApiMapping-2" no-loop true lock-on-active true when - $s : ServiceEntity( serviceType contains "vFW" ) + $s : ServiceEntity( (serviceType contains "vFW") || (serviceType contains "vDNS") ) then $s.setApiName("VNF-API"); end diff --git a/config/sdnccontextbuilder.spec b/config/sdnccontextbuilder.spec deleted file mode 100644 index 1f15b22..0000000 --- a/config/sdnccontextbuilder.spec +++ /dev/null @@ -1,76 +0,0 @@ -[ - // Use https://jolt-demo.appspot.com/#inception to develop/test - // any changes to this file - - { - // This section converts the updated json from service-decompostion - // to org.onap.pomba.common.datatypes.ModelContext - "operation": "shift", - "spec": { - "service": { - "*": { - "service-data": { - "service-topology": { - "service-topology-identifier": { - "service-instance-id": "service.uuid", - "service-instance-name": "service.name" - }, - "onap-model-information": { - "model-invariant-uuid": "service.invariantUUID" - } - }, - "vnfs": { - "vnf": { - "*": { - "vnf-data": { - "vnf-topology": { - "onap-model-information": { - "model-uuid": "vfList[&4].uuid", - "model-invariant-uuid": "vfList[&4].invariantUUID" - }, - "vnf-topology-identifier-structure": { - "vnf-type": "vfList[&4].type", - "vnf-name": "vfList[&4].name" - } - }, - "vf-modules": { - "vf-module": { - "*": { - "vf-module-data": { - "vf-module-topology": { - "vf-module-topology-identifier": { - "vf-module-name": "vfList[&8].vfModuleList[&4].name" - }, - "onap-model-information": { - "model-uuid": "vfList[&8].vfModuleList[&4].uuid", - "model-invariant-uuid": "vfList[&8].vfModuleList[&4].invariantUUID" - }, - "vf-module-assignments": { - "vms": { - "vm": { - "*": { - "vm-names": { - "vm-name": { - "@(2,vm-type)": "vfList[&13].vfModuleList[&9].vmList[&3].nfNamingCode", - "*": "vfList[&13].vfModuleList[&9].vmList[&3].name" - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - ] diff --git a/config/sdncgenericresource.spec b/config/sdncgenericresource.spec new file mode 100644 index 0000000..652afb9 --- /dev/null +++ b/config/sdncgenericresource.spec @@ -0,0 +1,94 @@ +[ + // Use https://jolt-demo.appspot.com/#inception to develop/test + // any changes to this file + + { + // This section converts the GENERIC-RESOURCES-API response from sdnc + // to org.onap.pomba.common.datatypes.ModelContext + "operation": "shift", + "spec": { + "service": { + "*": { + "service-data": { + "service-topology": { + "service-topology-identifier": { + "service-instance-id": "service.uuid", + "service-instance-name": "service.name" + }, + "onap-model-information": { + "model-invariant-uuid": "service.invariantUUID" + } + }, + "vnfs": { + "vnf": { + "*": { + "vnf-data": { + "vnf-topology": { + "onap-model-information": { + "model-uuid": "vfList[&4].uuid", + "model-invariant-uuid": "vfList[&4].invariantUUID" + }, + "vnf-topology-identifier-structure": { + "vnf-type": "vfList[&4].type", + "vnf-name": "vfList[&4].name" + } + }, + "vf-modules": { + "vf-module": { + "*": { + "vf-module-data": { + "vf-module-topology": { + "vf-module-topology-identifier": { + "vf-module-name": "vfList[&8].vfModuleList[&4].name" + }, + "onap-model-information": { + "model-uuid": "vfList[&8].vfModuleList[&4].uuid", + "model-invariant-uuid": "vfList[&8].vfModuleList[&4].invariantUUID" + }, + "vf-module-assignments": { + "vms": { + "vm": { + "*": { + "vm-names": { + "vm-name": { + "@(2,vm-type)": "vfList[&13].vfModuleList[&9].vmList[&3].nfNamingCode", + "*": "vfList[&13].vfModuleList[&9].vmList[&3].name" + } + } + } + } + } + } + } + } + } + } + } + } + } + } + }, + "networks": { + "network": { + "*": { + "network-data": { + "network-topology": { + "onap-model-information": { + "model-uuid": "vfList[0].vfModuleList[0].networkList[&4].uuid", + "model-invariant-uuid": "vfList[0].vfModuleList[0].networkList[&4].invariantUUID" + }, + "network-topology-identifier-structure": { + "network-type": "vfList[0].vfModuleList[0].networkList[&4].type", + "network-name": "vfList[0].vfModuleList[0].networkList[&4].name" + } + } + } + } + } + } + } + } + } + } + } + ] diff --git a/config/vnflist.spec b/config/vnflist.spec new file mode 100644 index 0000000..49c2434 --- /dev/null +++ b/config/vnflist.spec @@ -0,0 +1,19 @@ +[ + // Use https://jolt-demo.appspot.com/#inception to develop/test + // any changes to this file + + { + // This section converts aai response for GET VNF-API from SDNC + // to org.onap.pomba.common.datatypes.VF + "operation": "shift", + "spec": { + "vnfs": { + "vnf-list": { + "*": { + "*": "vnf-list[&1].&" + } + } + } + } + } + ] -- cgit 1.2.3-korg