aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md51
-rw-r--r--UniversalVesAdapter/README.md26
-rw-r--r--UniversalVesAdapter/pom.xml178
-rw-r--r--UniversalVesAdapter/src/main/resources/application.properties6
-rw-r--r--UniversalVesAdapter/src/test/java/org/onap/universalvesadapter/configs/DMaapMrUrlConfigurationTest.java4
-rw-r--r--pom.xml54
-rw-r--r--snmpmapper/README.md28
-rw-r--r--snmpmapper/pom.xml95
8 files changed, 366 insertions, 76 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..a0096a8
--- /dev/null
+++ b/README.md
@@ -0,0 +1,51 @@
+# DCAE VES Adapter (Mapper)
+
+# Summary
+Different VNF vendors generates event and telemetry data in different formats. Out of the box all VNF vendors may not support ONAP VES format. This solution provides generic adapter(mapper) which can convert different formats of event and telemetry data to VES format which is needed by ONAP
+
+This release supports only SNMP format. DCAE existing SNMP traps receiver are pushing SNMP traps (converted to json format) to DMaaP. DCAE Universal VES Adapter (mapper) micro-service consumes snmp trap from dmaap topic and reads uploaded mapper file (for the specific vendor). After reading mapper file, converts snmp trap (JSON format) to VES format and publish on dmaap topic.
+
+ONAP DCAE VES Adapter (Mapper) is delivered with **2 Docker container** having spring boot mocroservices
+
+## Compiling and Building Mapper
+
+mapper (structured as a Maven project) uses the Maven tool to help compile, build, and deploy mapper Artifacts into a Maven Repository. In order to compile and build, a `mvn clean install` is executed, which checks for any errors and Java exceptions during compilation process.
+
+## Getting the containers
+
+ONAP DCAE Mapper containers are stored on [here] for the releases, and [here] for the snapshots
+
+## Docker Containers
+
+ONAP DCAE VES Adapter (Mapper) is delivered with **2 Docker containers**, both are spring boot mocroservices
+
+The following Docker images are the actual deployment images used for running mapper:
+**UniversalVesAdapter** and **snmpmapper**
+
+# Starting mapper
+
+'mapper' solution is based on smokes framework which tranforms object model to another objet model. Here we transformed SNMP trap JSON format to VES JSON format
+
+## snmpmapper
+For this release it accepts the mapper XML file and stores it locally.
+*** Aims to develop the functionality that creates mapping files for SNMP traps in SDC during VNF on-boarding process.
+To be completed on next release ***
+
+## UniversalVesAdapter
+ Based on the sample mapper file <<snmpTrapToVes.xml>>, data tranformation will be done.
+ sample file location: /UniversalVesAdapter/SampleofMappingFile/snmpTrapToVes.xml
+
+Ther following steps are needed to deploy and start ONAP dcae mapper:
+
+## UniversalVesAdapter and snmpmapper containers can run together.
+ - Start snmpmapper
+ - docker run -p 8081:8888 snmpmapper
+ - <host>:<port>
+ - Start UniversalVesAdapter
+ - docker run -p 8082:8080 UniversalVesAdapter
+ - <host>:<port>/start
+ - Running mapper
+ - UniversalVesAdapter service will listen to DMAAP <<topic>> to consume SNMP trap object
+ - UniversalVesAdapter service will publish the tranformed VES object to DMAAP <<topic>> for other ONAP components to consume.
+
+
diff --git a/UniversalVesAdapter/README.md b/UniversalVesAdapter/README.md
new file mode 100644
index 0000000..e3d30fe
--- /dev/null
+++ b/UniversalVesAdapter/README.md
@@ -0,0 +1,26 @@
+# DCAE Universal VES Adapter
+
+DCAE Universal VES Adapter is a micro-service consume snmp trap from dmaap topic and reads uploaded mapper file of the specific vendor, using SNMP mapper. After reading mapper file, converts snmp trap (JSON format) to VES format and publish on dmaap topic.
+
+
+### Build Docker image
+
+The following Maven command will build the mapper JAR, build the Docker image to the local machine registry and then push the same image to the specified remote registry.
+
+```
+mvn clean package docker:build -DpushImageTag
+```
+
+The image will be tagged with the project version found in the `pom.xml`.
+
+### Run via Docker
+
+Execute this to run.
+
+```
+docker run -p 8082:8080 <image_name>
+
+```
+
+ ### Access
+ <host>:<expose port>/start \ No newline at end of file
diff --git a/UniversalVesAdapter/pom.xml b/UniversalVesAdapter/pom.xml
index 0649cd0..6bbe1cf 100644
--- a/UniversalVesAdapter/pom.xml
+++ b/UniversalVesAdapter/pom.xml
@@ -1,4 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- * ============LICENSE_START=======================================================
+ * ONAP : DCAEGEN2/services/mapper * ================================================================================
+ * Copyright 2018 TechMahindra *=================================================================================
+ * 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========================================================= -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -8,9 +19,8 @@
<version>0.0.1</version>
<parent>
- <!-- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-parent</artifactId>
- <version>2.0.0.RELEASE</version> -->
+ <!-- <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId>
+ <version>2.0.0.RELEASE</version> -->
<groupId>org.onap.dcaegen2.services.mapper</groupId>
<artifactId>mapper</artifactId>
<version>0.0.1-SNAPSHOT</version>
@@ -38,12 +48,12 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
- <version>2.0.0.RELEASE</version>
+ <version>2.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
- <version>2.0.0.RELEASE</version>
+ <version>2.0.1.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -55,48 +65,48 @@
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
- <version>2.0.5.RELEASE</version>
+ <version>2.0.6.RELEASE</version>
</dependency>
<dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.9.4</version>
-</dependency>
-
-
-<dependency>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- <version>1.8.0.10</version>
- <scope>test</scope>
-</dependency>
-
-<!-- https://mvnrepository.com/artifact/xalan/xalan -->
-<dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>2.7.2</version>
-</dependency>
-
-<!-- https://mvnrepository.com/artifact/xerces/xercesImpl -->
-<dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.11.0-atlassian-01</version>
-</dependency>
-
-<!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
-<dependency>
- <groupId>com.thoughtworks.xstream</groupId>
- <artifactId>xstream</artifactId>
- <version>1.4.10</version>
-</dependency>
-<!-- https://mvnrepository.com/artifact/xml-apis/xml-apis -->
-<dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- <version>1.4.01</version>
-</dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.9.5</version>
+ </dependency>
+
+
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>1.8.0.10</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- https://mvnrepository.com/artifact/xalan/xalan -->
+ <dependency>
+ <groupId>xalan</groupId>
+ <artifactId>xalan</artifactId>
+ <version>2.7.2</version>
+ </dependency>
+
+ <!-- https://mvnrepository.com/artifact/xerces/xercesImpl -->
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.11.0-atlassian-01</version>
+ </dependency>
+
+ <!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
+ <dependency>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ <version>1.4.10</version>
+ </dependency>
+ <!-- https://mvnrepository.com/artifact/xml-apis/xml-apis -->
+ <dependency>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>1.4.01</version>
+ </dependency>
@@ -110,8 +120,86 @@
<build>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <reuseForks>false</reuseForks>
+ <forkCount>1</forkCount>
+ </configuration>
+ </plugin>
+ <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
+ <version>2.0.0.RELEASE</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ <configuration>
+ <mainClass>org.onap.universalvesadapter.Application</mainClass>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>${docker.maven.version}</version>
+ <configuration>
+ <skipDockerBuild>false</skipDockerBuild>
+ <imageName>${onap.nexus.dockerregistry.daily}/onap/${project.groupId}.universalvesadaptor</imageName>
+ <baseImage>openjdk:8-jre</baseImage>
+ <entryPoint>["java", "-jar", "/opt/${project.build.finalName}.jar", "server"]</entryPoint>
+ <resources>
+ <resource>
+ <targetPath>/opt</targetPath>
+ <directory>${project.build.directory}</directory>
+ <include>${project.build.finalName}.jar</include>
+ </resource>
+ </resources>
+ <exposes>
+ <expose>8080</expose>
+ </exposes>
+ <imageTags>
+ <!--imageTag>${project.version}-SNAPSHOT-${maven.build.timestamp}Z</imageTag-->
+ <imageTag>${project.version}</imageTag>
+ <imageTag>latest</imageTag>
+ </imageTags>
+ <serverId>${onap.nexus.dockerregistry.daily}</serverId>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.9.1</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>src/gen/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>regex-property</id>
+ <goals>
+ <goal>regex-property</goal>
+ </goals>
+ <configuration>
+ <name>docker.version</name>
+ <value>${project.version}</value>
+ <regex>(^[0-9]+.[0-9]+.[0-9]+$)</regex>
+ <replacement>$1-STAGING</replacement>
+ <failIfNoMatch>false</failIfNoMatch>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
diff --git a/UniversalVesAdapter/src/main/resources/application.properties b/UniversalVesAdapter/src/main/resources/application.properties
index 0aefded..4841f4a 100644
--- a/UniversalVesAdapter/src/main/resources/application.properties
+++ b/UniversalVesAdapter/src/main/resources/application.properties
@@ -6,6 +6,6 @@ universal.configFiles=snmp:snmpTrapToVes.xml,default:defaultConfig.xml
fileService.url=http://localhost:8888/fileAsString/
messagesInBatch=1000
messagesInTimeInterval=5000
-mapperConfig.file=MapperConfig.json
-dmaap.consumer_props=/src/main/resources/dme2/consumer.properties
-dmaap.publisher_props=/src/main/resources/dme2/publisher.properties \ No newline at end of file
+mapperConfig.file=../UniversalVesAdapter/src/main/resources/MapperConfig.json
+dmaap.consumer_props=../UniversalVesAdapter/src/main/resources/dme2/consumer.properties
+dmaap.publisher_props=../UniversalVesAdapter/src/main/resources/dme2/publisher.properties \ No newline at end of file
diff --git a/UniversalVesAdapter/src/test/java/org/onap/universalvesadapter/configs/DMaapMrUrlConfigurationTest.java b/UniversalVesAdapter/src/test/java/org/onap/universalvesadapter/configs/DMaapMrUrlConfigurationTest.java
index ac9274d..c7497b4 100644
--- a/UniversalVesAdapter/src/test/java/org/onap/universalvesadapter/configs/DMaapMrUrlConfigurationTest.java
+++ b/UniversalVesAdapter/src/test/java/org/onap/universalvesadapter/configs/DMaapMrUrlConfigurationTest.java
@@ -43,8 +43,8 @@ public class DMaapMrUrlConfigurationTest {
String actualdata2 = dMaapMrUrlConfiguration.getPublisherProperties();
String actualdata3 = dMaapMrUrlConfiguration.getUrl();
- assertEquals("/src/main/resources/dme2/consumer.properties", actualdata1);
- assertEquals("/src/main/resources/dme2/publisher.properties", actualdata2);
+ assertEquals("../UniversalVesAdapter/src/main/resources/dme2/consumer.properties", actualdata1);
+ assertEquals("../UniversalVesAdapter/src/main/resources/dme2/publisher.properties", actualdata2);
assertEquals("http://localhost:8080/greeting12", actualdata3);
diff --git a/pom.xml b/pom.xml
index ccd162b..2519b49 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,23 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ ===============================LICENSE_START======================================
- ~ mapper
- ~ ================================================================================
- ~ Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- ~ ================================================================================
- ~ 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===========================================
- -->
+<!--
+* ============LICENSE_START=======================================================
+* ONAP : DCAEGEN2/services/mapper
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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=========================================================
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -73,6 +73,7 @@
<httpclient.version>4.5.2</httpclient.version>
<commons.lang3.version>3.5</commons.lang3.version>
+ <docker.maven.version>1.0.0</docker.maven.version>
<!--TESTING DEPENDENCIES -->
<junit.version>4.12</junit.version>
@@ -192,6 +193,11 @@
<version>${jayway.jsonpath.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>${docker.maven.version}</version>
+ </dependency>
</dependencies>
@@ -554,6 +560,14 @@
<version>${surefire.report.plugin.version}</version>
</plugin> -->
+ <plugin>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>${docker.maven.version}</version>
+ <configuration>
+ <skipDockerBuild>true</skipDockerBuild>
+ </configuration>
+ </plugin>
</plugins>
</pluginManagement>
@@ -668,8 +682,8 @@
</profiles>
<modules>
- <module>UniversalVesAdapter</module>
<module>snmpmapper</module>
+ <module>UniversalVesAdapter</module>
</modules>
</project>
diff --git a/snmpmapper/README.md b/snmpmapper/README.md
new file mode 100644
index 0000000..7ca23d9
--- /dev/null
+++ b/snmpmapper/README.md
@@ -0,0 +1,28 @@
+# DCAE SNMP Mapper
+
+DCAE SNMP mapper is a micro-service to upload the vendor specific mapper file into the database
+
+
+### Build Docker image
+
+The following Maven command will build the mapper JAR, build the Docker image to the local machine registry and then push the same image to the specified remote registry.
+
+```
+mvn clean package docker:build -DpushImageTag
+```
+
+The image will be tagged with the project version found in the `pom.xml`.
+
+### Run via Docker
+
+Execute this to run.
+
+
+```
+docker run -p 8081:8888 <image_name>
+
+```
+
+ ### Access
+ <host>:<expose port>
+ \ No newline at end of file
diff --git a/snmpmapper/pom.xml b/snmpmapper/pom.xml
index 67875b6..b06853a 100644
--- a/snmpmapper/pom.xml
+++ b/snmpmapper/pom.xml
@@ -1,4 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+* ============LICENSE_START=======================================================
+* ONAP : DCAEGEN2/services/mapper
+* ================================================================================
+* Copyright 2018 TechMahindra
+*=================================================================================
+* 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=========================================================
+ -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -72,13 +91,77 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
+ <version>2.0.0.RELEASE</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ <configuration>
+ <mainClass>org.onap.dcae.mapper.SnmpmapperApplication</mainClass>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
- <!-- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.19.1</version>
- </plugin> -->
-
+ <plugin>
+ <groupId>com.spotify</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>${docker.maven.version}</version>
+ <configuration>
+ <skipDockerBuild>false</skipDockerBuild>
+ <imageName>${onap.nexus.dockerregistry.daily}/onap/${project.groupId}.${project.artifactId}</imageName>
+ <baseImage>openjdk:8-jre</baseImage>
+ <entryPoint>["java", "-jar", "/opt/${project.build.finalName}.jar", "server"]</entryPoint>
+ <resources>
+ <resource>
+ <targetPath>/opt</targetPath>
+ <directory>${project.build.directory}</directory>
+ <include>${project.build.finalName}.jar</include>
+ </resource>
+ </resources>
+ <exposes>
+ <expose>8888</expose>
+ </exposes>
+ <imageTags>
+ <!-- imageTag>${project.version}-SNAPSHOT-${maven.build.timestamp}Z</imageTag -->
+ <imageTag>${project.version}</imageTag>
+ <imageTag>latest</imageTag>
+ </imageTags>
+ <serverId>${onap.nexus.dockerregistry.daily}</serverId>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.9.1</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>src/gen/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>regex-property</id>
+ <goals>
+ <goal>regex-property</goal>
+ </goals>
+ <configuration>
+ <name>docker.version</name>
+ <value>${project.version}</value>
+ <regex>(^[0-9]+.[0-9]+.[0-9]+$)</regex>
+ <replacement>$1-STAGING</replacement>
+ <failIfNoMatch>false</failIfNoMatch>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>