diff options
author | Prudence Au <prudence.au@amdocs.com> | 2018-10-26 15:34:22 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-10-26 15:34:22 +0000 |
commit | 28b5ce6794f46f196ea7c005b61d25f8b57d69f7 (patch) | |
tree | 2d49d87a8e7a71836e62d426a5ad208a289aca6e /config | |
parent | a33f302265772b2720245118c864813b596a0ef8 (diff) | |
parent | 696b3aab041353afd74e26c0b9a569d0b1b9e254 (diff) |
Merge "Adding API Mapping infrastructure"
Diffstat (limited to 'config')
-rw-r--r-- | config/application.properties | 20 | ||||
-rw-r--r-- | config/dynamic/conf/api-handlers.xml | 13 | ||||
-rw-r--r-- | config/dynamic/routes/sdnc-api.route | 17 | ||||
-rw-r--r-- | config/rules/api-mapping-rules.drl | 39 |
4 files changed, 88 insertions, 1 deletions
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 @@ +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=" + http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans.xsd"> + + <bean id="vnfApiHandler" class="org.onap.pomba.contextbuilder.sdnc.handlers.VnfApiHandler" > + </bean> + + <bean id="genericResourceApiHandler" class="org.onap.pomba.contextbuilder.sdnc.handlers.GenericResourceApiHandler" > + </bean> + +</beans>
\ 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 @@ +<route xmlns="http://camel.apache.org/schema/spring" trace="true" id="apiMapperRoute"> + <from uri="direct:startRoutingProcess" /> + <choice> + <when> + <simple>${in.body.apiName} == 'VNF-API'</simple> + <log message="Processing ${in.body.apiName} by Camel Routing Context"/> + <to uri="bean:vnfApiHandler?method=process"/> + </when> + <when> + <simple>${in.body.apiName} == 'GENERIC-RESOURCE-API'</simple> + <log message="Processing ${in.body.apiName} by Camel Routing Context"/> + <to uri="bean:genericResourceApiHandler?method=process"/> + </when> + </choice> +</route> + + 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 |