Create cps-tdmt module 98/118098/6
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Fri, 19 Feb 2021 11:19:58 +0000 (12:19 +0100)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Fri, 19 Feb 2021 11:19:58 +0000 (12:19 +0100)
Issue-ID: CPS-243
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
Change-Id: I102e1f6b4e2f9eaa88d856a94a869c0e005b700e

.gitignore [new file with mode: 0644]
cps-tbdmt-application/pom.xml [new file with mode: 0644]
cps-tbdmt-bom/pom.xml [new file with mode: 0644]
cps-tbdmt-dependencies/pom.xml [new file with mode: 0644]
cps-tbdmt-parent/pom.xml [new file with mode: 0644]
cps-tbdmt-rest/docs/api/swagger/swagger.yaml [new file with mode: 0644]
cps-tbdmt-rest/pom.xml [new file with mode: 0644]
cps-tbdmt-service/lombok.config [new file with mode: 0644]
cps-tbdmt-service/pom.xml [new file with mode: 0644]
pom.xml [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..624c9b6
--- /dev/null
@@ -0,0 +1,23 @@
+*.class
+*.jar
+*.war
+*.zip
+*.log
+
+target/
+log/
+
+.idea/
+.idea_modules/
+*.iml
+*.ipr
+*.iws
+
+.settings/
+bin/
+tmp/
+.metadata
+.classpath
+.project
+*.tmp
+.checkstyle
\ No newline at end of file
diff --git a/cps-tbdmt-application/pom.xml b/cps-tbdmt-application/pom.xml
new file mode 100644 (file)
index 0000000..ac57848
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  Copyright (c) 2021 Pantheon.tech.
+  ================================================================================
+  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">
+    <parent>
+        <groupId>org.onap.cps</groupId>
+        <artifactId>cps-tbdmt-parent</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+        <relativePath>../cps-tbdmt-parent/pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>cps-tbdmt-application</artifactId>
+</project>
\ No newline at end of file
diff --git a/cps-tbdmt-bom/pom.xml b/cps-tbdmt-bom/pom.xml
new file mode 100644 (file)
index 0000000..746b5da
--- /dev/null
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  Copyright (c) 2021 Pantheon.tech.
+  ================================================================================
+  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>
+    <groupId>org.onap.cps</groupId>
+    <artifactId>cps-tbdmt-bom</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+    <description>This artifact contains dependencyManagement declarations of all published CPS components.</description>
+
+    <properties>
+        <nexusproxy>https://nexus.onap.org</nexusproxy>
+        <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
+        <sonar.skip>true</sonar.skip>
+        <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
+    </properties>
+
+    <distributionManagement>
+        <repository>
+            <id>ecomp-releases</id>
+            <name>ECOMP Release Repository</name>
+            <url>${nexusproxy}${releaseNexusPath}</url>
+        </repository>
+        <snapshotRepository>
+            <id>ecomp-snapshots</id>
+            <name>ECOMP Snapshot Repository</name>
+            <url>${nexusproxy}${snapshotNexusPath}</url>
+        </snapshotRepository>
+    </distributionManagement>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
+                <artifactId>cps-tbdmt-service</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
+                <artifactId>cps-tbdmt-rest</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+</project>
\ No newline at end of file
diff --git a/cps-tbdmt-dependencies/pom.xml b/cps-tbdmt-dependencies/pom.xml
new file mode 100644 (file)
index 0000000..589f9f0
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  Copyright (c) 2021 Pantheon.tech.
+  ================================================================================
+  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>
+    <groupId>org.onap.cps</groupId>
+    <artifactId>cps-tbdmt-dependencies</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+    <name>${project.groupId}:${project.artifactId}</name>
+    <description>This artifact contains dependencyManagement declarations of upstream versions.</description>
+
+    <properties>
+        <nexusproxy>https://nexus.onap.org</nexusproxy>
+        <releaseNexusPath>/content/repositories/releases/</releaseNexusPath>
+        <snapshotNexusPath>/content/repositories/snapshots/</snapshotNexusPath>
+        <sonar.skip>true</sonar.skip>
+    </properties>
+
+    <distributionManagement>
+        <repository>
+            <id>ecomp-releases</id>
+            <name>ECOMP Release Repository</name>
+            <url>${nexusproxy}${releaseNexusPath}</url>
+        </repository>
+        <snapshotRepository>
+            <id>ecomp-snapshots</id>
+            <name>ECOMP Snapshot Repository</name>
+            <url>${nexusproxy}${snapshotNexusPath}</url>
+        </snapshotRepository>
+    </distributionManagement>
+
+    <dependencyManagement>
+        <dependencies>
+
+        </dependencies>
+    </dependencyManagement>
+</project>
\ No newline at end of file
diff --git a/cps-tbdmt-parent/pom.xml b/cps-tbdmt-parent/pom.xml
new file mode 100644 (file)
index 0000000..1322a47
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+    <parent>
+        <groupId>org.onap.cps</groupId>
+        <artifactId>cps-parent</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+        <relativePath/>
+    </parent>
+
+    <groupId>org.onap.cps</groupId>
+    <artifactId>cps-tbdmt-parent</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+    <properties>
+        <sonar.coverage.jacoco.xmlReportPaths>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.onap.cps</groupId>
+                <artifactId>cps-tbdmt-dependencies</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.onap.cps</groupId>
+                <artifactId>cps-tbdmt-bom</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+</project>
\ No newline at end of file
diff --git a/cps-tbdmt-rest/docs/api/swagger/swagger.yaml b/cps-tbdmt-rest/docs/api/swagger/swagger.yaml
new file mode 100644 (file)
index 0000000..b6fe6fb
--- /dev/null
@@ -0,0 +1,178 @@
+swagger: "2.0"
+info:
+  description: ""
+  version: "1.0.0"
+  title: "Template based Data Model Transformer APIs"
+  license:
+    name: "Apache 2.0"
+    url: "http://www.apache.org/licenses/LICENSE-2.0.html"
+host: "localhost"
+basePath: "/v1"
+tags:
+- name: "templates"
+  description: "CRUD APIs for xpath templates"
+schemes:
+- "https"
+- "http"
+paths:
+  /templates:
+    post:
+      tags:
+      - "templates"
+      summary: "Add a new template"
+      description: ""
+      operationId: "addTemplate"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters:
+      - in: "body"
+        name: "body"
+        description: "Template object that needs to be added"
+        required: true
+        schema:
+          $ref: "#/definitions/Template"
+      responses:
+        "201":
+          description: "Created successfully"
+        "400":
+          description: "Invalid input"
+        "500":
+          description: "Internal server error"
+    get:
+      tags:
+      - "templates"
+      summary: "Get all templates"
+      description: ""
+      operationId: "getAllTemplates"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      responses:
+        "200":
+          description: "Templates returned successfully"
+          schema:
+            type: "array"
+            items:
+              $ref: "#/definitions/Template"
+        "404":
+          description: "No templates found"
+        "500":
+          description: "Internal server error"
+  /templates/{schemaSet}/{id}:
+    get:
+      tags:
+      - "templates"
+      summary: "Find template by ID"
+      description: "Returns a single template"
+      operationId: "getTemplateById"
+      produces:
+      - "application/json"
+      parameters:
+      - name: "id"
+        in: "path"
+        description: "ID of template to return"
+        required: true
+        type: "string"
+      - name: "schemaSet"
+        in: "path"
+        description: "schema set"
+        required: true
+        type: "string"
+      responses:
+        "200":
+          description: "Template returned successfully"
+          schema:
+            $ref: "#/definitions/Template"
+        "400":
+          description: "Invalid ID supplied"
+        "404":
+          description: "Not found"
+    delete:
+      tags:
+      - "templates"
+      summary: "Deletes a template"
+      description: ""
+      operationId: "deleteTemplate"
+      produces:
+      - "application/json"
+      parameters:
+      - name: "id"
+        in: "path"
+        required: true
+        type: "string"
+      - name: "schemaSet"
+        in: "path"
+        description: "schema set"
+        required: true
+        type: "string"
+      responses:
+        "200":
+          description: "Deleted successfully"
+        "400":
+          description: "Invalid ID supplied"
+        "404":
+          description: "Template not found"
+  /execute/{schemaSet}/{id}:
+    post:
+      tags:
+      - "template executions"
+      summary: "Execute a template"
+      description: "Returns the result of execution"
+      operationId: "executeTemplateById"
+      produces:
+      - "application/json"
+      parameters:
+      - name: "id"
+        in: "path"
+        description: "ID of template to execute"
+        required: true
+        type: "string"
+      - name: "schemaSet"
+        in: "path"
+        description: "schema set"
+        required: true
+        type: "string"
+      - in: "body"
+        name: "body"
+        description: "Template object that needs to be added"
+        required: true
+        schema:
+          $ref: "#/definitions/ApiRequest"
+      responses:
+        "200":
+          description: "Result returned successfully"
+          schema:
+            $ref: "#/definitions/ApiResponse"
+        "400":
+          description: "Invalid ID supplied"
+        "404":
+          description: "Not found"
+        "500":
+          description: "Internal server error"
+definitions:
+  Template:
+    type: "object"
+    required:
+    - "id"
+    - "schemaSet"
+    - "xpathTemplate"
+    properties:
+      id:
+        type: "string"
+      schemaSet:
+        type: "string"
+      xpathTemplate:
+        type: "string"
+  ApiRequest:
+    type: "object"
+    properties:
+      input:
+        type: "object"
+  ApiResponse:
+    type: "object"
+externalDocs:
+  description: "Find out more about APIs"
+  url: "https://wiki.onap.org/display/DW/API+Mapper+Service"
diff --git a/cps-tbdmt-rest/pom.xml b/cps-tbdmt-rest/pom.xml
new file mode 100644 (file)
index 0000000..048f243
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  Copyright (c) 2021 Pantheon.tech.
+  ================================================================================
+  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">
+    <parent>
+        <groupId>org.onap.cps</groupId>
+        <artifactId>cps-tbdmt-parent</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+        <relativePath>../cps-tbdmt-parent/pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>cps-tbdmt-rest</artifactId>
+</project>
\ No newline at end of file
diff --git a/cps-tbdmt-service/lombok.config b/cps-tbdmt-service/lombok.config
new file mode 100644 (file)
index 0000000..a23edb4
--- /dev/null
@@ -0,0 +1,2 @@
+config.stopBubbling = true
+lombok.addLombokGeneratedAnnotation = true
\ No newline at end of file
diff --git a/cps-tbdmt-service/pom.xml b/cps-tbdmt-service/pom.xml
new file mode 100644 (file)
index 0000000..4e21048
--- /dev/null
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*******************************************************************************
+ *  ============LICENSE_START=======================================================
+ *  ONAP
+ *  ================================================================================
+ *   Copyright (C) 2021 Wipro Limited.
+ *   Modifications Copyright (C) 2021 Pantheon.tech.
+ *   ==============================================================================
+ *     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">
+    <parent>
+        <groupId>org.onap.cps</groupId>
+        <artifactId>cps-tbdmt-parent</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+        <relativePath>../cps-tbdmt-parent/pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>cps-tbdmt-service</artifactId>
+    <packaging>jar</packaging>
+
+</project>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644 (file)
index 0000000..c284a98
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  Copyright (c) 2021 Pantheon.tech.
+  ================================================================================
+  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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.onap.oparent</groupId>
+        <artifactId>oparent</artifactId>
+        <version>3.2.0</version>
+    </parent>
+
+    <groupId>org.onap.cps</groupId>
+    <artifactId>cps-tbdmt-aggregator</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+    <name>cps-tbdmt</name>
+    <description>Template Based DataModel Transformer</description>
+
+    <organization>
+        <name>ONAP - CPS</name>
+        <url>http://www.onap.org/</url>
+    </organization>
+
+    <properties>
+        <maven.deploy.skip>true</maven.deploy.skip>
+        <maven.install.skip>true</maven.install.skip>
+    </properties>
+
+    <modules>
+        <module>cps-tbdmt-service</module>
+        <module>cps-tbdmt-rest</module>
+        <module>cps-tbdmt-dependencies</module>
+        <module>cps-tbdmt-bom</module>
+        <module>cps-tbdmt-parent</module>
+        <module>cps-tbdmt-application</module>
+    </modules>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>versions-maven-plugin</artifactId>
+                <configuration>
+                    <processAllModules>true</processAllModules>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file