From 696b3aab041353afd74e26c0b9a569d0b1b9e254 Mon Sep 17 00:00:00 2001 From: Geora Barsky Date: Fri, 12 Oct 2018 11:46:52 -0400 Subject: Adding API Mapping infrastructure Issue-ID: LOG-391 Change-Id: I30d954bcdf1cf0748bb5249cbf10defb8dbc8ff6 Signed-off-by: Geora Barsky --- config/application.properties | 20 +++++++++++++++++- config/dynamic/conf/api-handlers.xml | 13 ++++++++++++ config/dynamic/routes/sdnc-api.route | 17 ++++++++++++++++ config/rules/api-mapping-rules.drl | 39 ++++++++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 config/dynamic/conf/api-handlers.xml create mode 100644 config/dynamic/routes/sdnc-api.route create mode 100644 config/rules/api-mapping-rules.drl (limited to 'config') diff --git a/config/application.properties b/config/application.properties index 6ad4731..8fc2503 100644 --- a/config/application.properties +++ b/config/application.properties @@ -18,7 +18,8 @@ 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 spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration @@ -46,3 +47,20 @@ sdnc.genericResourcePath=/restconf/config/GENERIC-RESOURCE-API:services/service/ #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.username=AAI +aai.password=OBF:1gfr1ev31gg7 +aai.httpProtocol=https +aai.connectionTimeout=5000 +aai.readTimeout=1000 + +# HTTP Basic Authorization credentials for AAI Rest Service API +aai.http.userId=admin +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/ + diff --git a/config/dynamic/conf/api-handlers.xml b/config/dynamic/conf/api-handlers.xml new file mode 100644 index 0000000..8ad08c5 --- /dev/null +++ b/config/dynamic/conf/api-handlers.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/config/dynamic/routes/sdnc-api.route b/config/dynamic/routes/sdnc-api.route new file mode 100644 index 0000000..19bc5ec --- /dev/null +++ b/config/dynamic/routes/sdnc-api.route @@ -0,0 +1,17 @@ + + + + + ${in.body.apiName} == 'VNF-API' + + + + + ${in.body.apiName} == 'GENERIC-RESOURCE-API' + + + + + + + diff --git a/config/rules/api-mapping-rules.drl b/config/rules/api-mapping-rules.drl new file mode 100644 index 0000000..6278d48 --- /dev/null +++ b/config/rules/api-mapping-rules.drl @@ -0,0 +1,39 @@ +/* + * ============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===================================================== + */ +package org.onap.pomba.contextbuilder.sdnc.rules; + +import org.onap.pomba.contextbuilder.sdnc.model.ServiceEntity; + +rule "ApiMapping-1" + no-loop true + lock-on-active true + when + $s : ServiceEntity( serviceType not contains "vFW" ) + then + $s.setApiName("GENERIC-RESOURCE-API"); +end + + +rule "ApiMapping-2" + no-loop true + lock-on-active true + when + $s : ServiceEntity( serviceType contains "vFW" ) + then + $s.setApiName("VNF-API"); +end -- cgit 1.2.3-korg