From 4b3c8a0bb11d71c1be8ac5a966818dafec1124fe Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh(bs2796)" Date: Wed, 15 Aug 2018 21:31:10 +0000 Subject: Blueprints Processor Service Blueprints Processor API definitions Change-Id: Id44c74938f75e847a43b8e6d0733c36d4dc99e97 Issue-ID: CCSDK-411 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) --- .../modules/inbounds/selfservice-api/pom.xml | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml new file mode 100644 index 000000000..a777c08c1 --- /dev/null +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -0,0 +1,31 @@ + + + + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + inbounds + 0.0.3-SNAPSHOT + + + selfservice-api + jar + Blueprints Processor Selfservice API + Blueprints Processor Selfservice API + + -- cgit 1.2.3-korg From ee467d748623a3f8fe01a0fefb1e6f594ca5f083 Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh(bs2796)" Date: Thu, 23 Aug 2018 15:54:30 +0000 Subject: Controller Blueprints Microservice Add Docker Build and Deploy Maven Implementations for Controller Blueprint MS and their dependencies Change-Id: I9eee9fff535bcc9ca0b855150892ce53af126d1c Issue-ID: CCSDK-483 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) --- ms/blueprintsprocessor/application/pom.xml | 2 +- .../modules/commons/adaptors/pom.xml | 2 +- .../modules/commons/core/pom.xml | 6 +- .../modules/commons/db-lib/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/pom.xml | 2 +- .../modules/commons/rest-lib/pom.xml | 2 +- ms/blueprintsprocessor/modules/inbounds/pom.xml | 2 +- .../modules/inbounds/resource-api/pom.xml | 2 +- .../modules/inbounds/selfservice-api/pom.xml | 2 +- ms/blueprintsprocessor/modules/outbounds/pom.xml | 2 +- ms/blueprintsprocessor/modules/pom.xml | 2 +- .../modules/services/db-service/pom.xml | 2 +- .../modules/services/execution-service/pom.xml | 2 +- ms/blueprintsprocessor/modules/services/pom.xml | 2 +- .../modules/services/resolution-service/pom.xml | 2 +- ms/blueprintsprocessor/parent/pom.xml | 90 +++++++++++++++------- ms/blueprintsprocessor/pom.xml | 7 +- 17 files changed, 87 insertions(+), 44 deletions(-) (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/application/pom.xml b/ms/blueprintsprocessor/application/pom.xml index ea422600a..1412ecae6 100644 --- a/ms/blueprintsprocessor/application/pom.xml +++ b/ms/blueprintsprocessor/application/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor parent - 0.0.3-SNAPSHOT + 0.3.0-SNAPSHOT ../parent application diff --git a/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml b/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml index efd7d74b3..a46705174 100644 --- a/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.0.3-SNAPSHOT + 0.3.0-SNAPSHOT adaptors diff --git a/ms/blueprintsprocessor/modules/commons/core/pom.xml b/ms/blueprintsprocessor/modules/commons/core/pom.xml index a601560bb..d0203208c 100644 --- a/ms/blueprintsprocessor/modules/commons/core/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/core/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.0.3-SNAPSHOT + 0.3.0-SNAPSHOT core @@ -38,8 +38,8 @@ rest-lib - org.onap.ccsdk.apps - controllerblueprints-resource-dict + org.onap.ccsdk.apps.controllerblueprints + resource-dict diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml index 31abb40df..a8ece15dd 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.0.3-SNAPSHOT + 0.3.0-SNAPSHOT db-lib diff --git a/ms/blueprintsprocessor/modules/commons/pom.xml b/ms/blueprintsprocessor/modules/commons/pom.xml index 83a3cb8b6..00b7e5f3d 100644 --- a/ms/blueprintsprocessor/modules/commons/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.0.3-SNAPSHOT + 0.3.0-SNAPSHOT commons diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml index d671f120e..27a1a1d79 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.0.3-SNAPSHOT + 0.3.0-SNAPSHOT rest-lib diff --git a/ms/blueprintsprocessor/modules/inbounds/pom.xml b/ms/blueprintsprocessor/modules/inbounds/pom.xml index 1b9d2782c..fd2b9fa2b 100644 --- a/ms/blueprintsprocessor/modules/inbounds/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.0.3-SNAPSHOT + 0.3.0-SNAPSHOT inbounds diff --git a/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml index 6ed7c9da2..32b721781 100644 --- a/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor inbounds - 0.0.3-SNAPSHOT + 0.3.0-SNAPSHOT resource-api diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml index a777c08c1..7791b5d1d 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor inbounds - 0.0.3-SNAPSHOT + 0.3.0-SNAPSHOT selfservice-api diff --git a/ms/blueprintsprocessor/modules/outbounds/pom.xml b/ms/blueprintsprocessor/modules/outbounds/pom.xml index 213e516b1..8a9026224 100644 --- a/ms/blueprintsprocessor/modules/outbounds/pom.xml +++ b/ms/blueprintsprocessor/modules/outbounds/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.0.3-SNAPSHOT + 0.3.0-SNAPSHOT outbounds diff --git a/ms/blueprintsprocessor/modules/pom.xml b/ms/blueprintsprocessor/modules/pom.xml index 68447436e..c0c30e01b 100644 --- a/ms/blueprintsprocessor/modules/pom.xml +++ b/ms/blueprintsprocessor/modules/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor parent - 0.0.3-SNAPSHOT + 0.3.0-SNAPSHOT ../parent diff --git a/ms/blueprintsprocessor/modules/services/db-service/pom.xml b/ms/blueprintsprocessor/modules/services/db-service/pom.xml index b11ba6d0e..3c0d9e7cd 100644 --- a/ms/blueprintsprocessor/modules/services/db-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/db-service/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor services - 0.0.3-SNAPSHOT + 0.3.0-SNAPSHOT db-service diff --git a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml index c49476fd7..b1bf8231f 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor services - 0.0.3-SNAPSHOT + 0.3.0-SNAPSHOT execution-service diff --git a/ms/blueprintsprocessor/modules/services/pom.xml b/ms/blueprintsprocessor/modules/services/pom.xml index 4ab8d00dc..90a4446d1 100644 --- a/ms/blueprintsprocessor/modules/services/pom.xml +++ b/ms/blueprintsprocessor/modules/services/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.0.3-SNAPSHOT + 0.3.0-SNAPSHOT services diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/pom.xml b/ms/blueprintsprocessor/modules/services/resolution-service/pom.xml index 581dd14d1..f25eb713a 100644 --- a/ms/blueprintsprocessor/modules/services/resolution-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/resolution-service/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor services - 0.0.3-SNAPSHOT + 0.3.0-SNAPSHOT resolution-service jar diff --git a/ms/blueprintsprocessor/parent/pom.xml b/ms/blueprintsprocessor/parent/pom.xml index b6c8e0c37..79039aa3b 100644 --- a/ms/blueprintsprocessor/parent/pom.xml +++ b/ms/blueprintsprocessor/parent/pom.xml @@ -16,27 +16,61 @@ --> - org.onap.ccsdk.apps.blueprintsprocessor - 0.0.3-SNAPSHOT 4.0.0 + + org.onap.ccsdk.apps + blueprintsprocessor + 0.3.0-SNAPSHOT + + org.onap.ccsdk.apps.blueprintsprocessor parent pom Blueprints Processor Parent Blueprints Processor Parent - UTF-8 - UTF-8 - 1.8 - 1.8 - 1.8 0.3.0-SNAPSHOT 2.0.4.RELEASE + 5.0.8.RELEASE 1.2.60 + 1.0.0 2.9.2 1.4.197 + + + org.springframework.boot + spring-boot-starter-parent + ${spring.boot.version} + pom + import + + + + + com.att.eelf + eelf-core + ${eelf.version} + + + + + org.jetbrains.kotlin + kotlin-stdlib + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-reflect + ${kotlin.version} + + org.onap.ccsdk.apps.blueprintsprocessor @@ -81,8 +115,8 @@ - org.onap.ccsdk.apps - controllerblueprints-resource-dict + org.onap.ccsdk.apps.controllerblueprints + resource-dict ${controllerblueprints.version} @@ -98,25 +132,33 @@ ${springfox.swagger2.version} - - + - org.springframework.boot - spring-boot-starter-parent - ${spring.boot.version} - pom - import + org.apache.commons + commons-lang3 + 3.2.1 - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - ${kotlin.version} + commons-collections + commons-collections + 3.2.2 - org.jetbrains.kotlin - kotlin-reflect - ${kotlin.version} + commons-io + commons-io + 2.6 + + org.apache.velocity + velocity + 1.7 + + + com.google.guava + guava + 25.1-jre + + com.h2database @@ -136,22 +178,18 @@ org.apache.commons commons-lang3 - 3.2.1 commons-collections commons-collections - 3.2.2 commons-io commons-io - 2.6 org.apache.velocity velocity - 1.7 diff --git a/ms/blueprintsprocessor/pom.xml b/ms/blueprintsprocessor/pom.xml index 6c980be03..f35b105d7 100644 --- a/ms/blueprintsprocessor/pom.xml +++ b/ms/blueprintsprocessor/pom.xml @@ -29,10 +29,15 @@ Blueprints Processor POM + BlueprintsProcessor UTF-8 + UTF-8 + yyyyMMdd'T'HHmmss'Z' + ${maven.build.timestamp} + 1.8 1.8 1.8 - 1.2.60 + ${project.version} -- cgit 1.2.3-korg From 905559f83b9a61cde7101c3d9dbaf424aa51b151 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 27 Sep 2018 16:26:45 -0400 Subject: Roll to next snapshot version Roll to next snapshot version Change-Id: Ifbbe4c890c47001d60117f09a67daa278d57dcd4 Issue-ID: CCSDK-597 Signed-off-by: Timoney, Dan (dt5972) --- ms/blueprintsprocessor/application/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/adaptors/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/core/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/db-lib/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml | 2 +- ms/blueprintsprocessor/modules/inbounds/pom.xml | 2 +- ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml | 2 +- ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml | 2 +- ms/blueprintsprocessor/modules/outbounds/pom.xml | 2 +- ms/blueprintsprocessor/modules/pom.xml | 2 +- ms/blueprintsprocessor/modules/services/db-service/pom.xml | 2 +- ms/blueprintsprocessor/modules/services/execution-service/pom.xml | 2 +- ms/blueprintsprocessor/modules/services/pom.xml | 2 +- ms/blueprintsprocessor/modules/services/resolution-service/pom.xml | 2 +- ms/blueprintsprocessor/parent/pom.xml | 4 ++-- ms/blueprintsprocessor/pom.xml | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/application/pom.xml b/ms/blueprintsprocessor/application/pom.xml index c7f15ea92..ac30a18a5 100644 --- a/ms/blueprintsprocessor/application/pom.xml +++ b/ms/blueprintsprocessor/application/pom.xml @@ -22,7 +22,7 @@ org.onap.ccsdk.apps.blueprintsprocessor parent - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT ../parent application diff --git a/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml b/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml index a46705174..7421e8175 100644 --- a/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT adaptors diff --git a/ms/blueprintsprocessor/modules/commons/core/pom.xml b/ms/blueprintsprocessor/modules/commons/core/pom.xml index ad115805c..f6c353b00 100644 --- a/ms/blueprintsprocessor/modules/commons/core/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/core/pom.xml @@ -22,7 +22,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT core diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml index a8ece15dd..1b4e0c8ba 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT db-lib diff --git a/ms/blueprintsprocessor/modules/commons/pom.xml b/ms/blueprintsprocessor/modules/commons/pom.xml index 00b7e5f3d..1c120334e 100644 --- a/ms/blueprintsprocessor/modules/commons/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT commons diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml index 27a1a1d79..81e590ce9 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT rest-lib diff --git a/ms/blueprintsprocessor/modules/inbounds/pom.xml b/ms/blueprintsprocessor/modules/inbounds/pom.xml index fd2b9fa2b..5360b1e96 100644 --- a/ms/blueprintsprocessor/modules/inbounds/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT inbounds diff --git a/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml index 32b721781..6b18f02c0 100644 --- a/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor inbounds - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT resource-api diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml index 7791b5d1d..74acf8191 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor inbounds - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT selfservice-api diff --git a/ms/blueprintsprocessor/modules/outbounds/pom.xml b/ms/blueprintsprocessor/modules/outbounds/pom.xml index 8a9026224..a9dc15b92 100644 --- a/ms/blueprintsprocessor/modules/outbounds/pom.xml +++ b/ms/blueprintsprocessor/modules/outbounds/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT outbounds diff --git a/ms/blueprintsprocessor/modules/pom.xml b/ms/blueprintsprocessor/modules/pom.xml index 0ae3458ae..173e4c347 100644 --- a/ms/blueprintsprocessor/modules/pom.xml +++ b/ms/blueprintsprocessor/modules/pom.xml @@ -22,7 +22,7 @@ org.onap.ccsdk.apps.blueprintsprocessor parent - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT ../parent diff --git a/ms/blueprintsprocessor/modules/services/db-service/pom.xml b/ms/blueprintsprocessor/modules/services/db-service/pom.xml index 3c0d9e7cd..2991de6b3 100644 --- a/ms/blueprintsprocessor/modules/services/db-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/db-service/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor services - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT db-service diff --git a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml index b1bf8231f..9cf514489 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor services - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT execution-service diff --git a/ms/blueprintsprocessor/modules/services/pom.xml b/ms/blueprintsprocessor/modules/services/pom.xml index 90a4446d1..c698bbc28 100644 --- a/ms/blueprintsprocessor/modules/services/pom.xml +++ b/ms/blueprintsprocessor/modules/services/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT services diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/pom.xml b/ms/blueprintsprocessor/modules/services/resolution-service/pom.xml index f25eb713a..185b612b2 100644 --- a/ms/blueprintsprocessor/modules/services/resolution-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/resolution-service/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor services - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT resolution-service jar diff --git a/ms/blueprintsprocessor/parent/pom.xml b/ms/blueprintsprocessor/parent/pom.xml index 185ed14f8..5b27ae8ba 100644 --- a/ms/blueprintsprocessor/parent/pom.xml +++ b/ms/blueprintsprocessor/parent/pom.xml @@ -21,7 +21,7 @@ org.onap.ccsdk.apps blueprintsprocessor - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT org.onap.ccsdk.apps.blueprintsprocessor parent @@ -29,7 +29,7 @@ Blueprints Processor Parent Blueprints Processor Parent - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT 2.0.4.RELEASE 5.0.8.RELEASE 1.2.60 diff --git a/ms/blueprintsprocessor/pom.xml b/ms/blueprintsprocessor/pom.xml index f35b105d7..5e03e9343 100644 --- a/ms/blueprintsprocessor/pom.xml +++ b/ms/blueprintsprocessor/pom.xml @@ -21,7 +21,7 @@ org.onap.ccsdk.apps ccsdk-apps - 0.3.0-SNAPSHOT + 0.3.1-SNAPSHOT blueprintsprocessor pom -- cgit 1.2.3-korg From 00687833cbe372b09835689b4a5708b03142d29e Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 25 Oct 2018 10:34:51 -0400 Subject: Roll to initial Dublin version Roll to initial Dublin release version Change-Id: I9f56f6643bf5850a9958d46f137fa929b1c05e5d Issue-ID: CCSDK-617 Signed-off-by: Timoney, Dan (dt5972) --- ms/blueprintsprocessor/application/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/adaptors/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/core/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/db-lib/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml | 2 +- ms/blueprintsprocessor/modules/inbounds/pom.xml | 2 +- ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml | 2 +- ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml | 2 +- ms/blueprintsprocessor/modules/outbounds/pom.xml | 2 +- ms/blueprintsprocessor/modules/pom.xml | 2 +- ms/blueprintsprocessor/modules/services/db-service/pom.xml | 2 +- ms/blueprintsprocessor/modules/services/execution-service/pom.xml | 2 +- ms/blueprintsprocessor/modules/services/pom.xml | 2 +- ms/blueprintsprocessor/modules/services/resolution-service/pom.xml | 2 +- ms/blueprintsprocessor/parent/pom.xml | 2 +- ms/blueprintsprocessor/pom.xml | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/application/pom.xml b/ms/blueprintsprocessor/application/pom.xml index ac30a18a5..8a93df356 100644 --- a/ms/blueprintsprocessor/application/pom.xml +++ b/ms/blueprintsprocessor/application/pom.xml @@ -22,7 +22,7 @@ org.onap.ccsdk.apps.blueprintsprocessor parent - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT ../parent application diff --git a/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml b/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml index 7421e8175..410111b45 100644 --- a/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT adaptors diff --git a/ms/blueprintsprocessor/modules/commons/core/pom.xml b/ms/blueprintsprocessor/modules/commons/core/pom.xml index f6c353b00..094f42b7a 100644 --- a/ms/blueprintsprocessor/modules/commons/core/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/core/pom.xml @@ -22,7 +22,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT core diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml index 1b4e0c8ba..0139e74df 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT db-lib diff --git a/ms/blueprintsprocessor/modules/commons/pom.xml b/ms/blueprintsprocessor/modules/commons/pom.xml index 1c120334e..a2e7c78b1 100644 --- a/ms/blueprintsprocessor/modules/commons/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT commons diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml index 81e590ce9..6dfe111c5 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT rest-lib diff --git a/ms/blueprintsprocessor/modules/inbounds/pom.xml b/ms/blueprintsprocessor/modules/inbounds/pom.xml index 5360b1e96..f03e5557b 100644 --- a/ms/blueprintsprocessor/modules/inbounds/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT inbounds diff --git a/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml index 6b18f02c0..4fa56feb7 100644 --- a/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor inbounds - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT resource-api diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml index 74acf8191..a4c7aaf08 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor inbounds - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT selfservice-api diff --git a/ms/blueprintsprocessor/modules/outbounds/pom.xml b/ms/blueprintsprocessor/modules/outbounds/pom.xml index a9dc15b92..07403d960 100644 --- a/ms/blueprintsprocessor/modules/outbounds/pom.xml +++ b/ms/blueprintsprocessor/modules/outbounds/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT outbounds diff --git a/ms/blueprintsprocessor/modules/pom.xml b/ms/blueprintsprocessor/modules/pom.xml index 173e4c347..8a57da2cd 100644 --- a/ms/blueprintsprocessor/modules/pom.xml +++ b/ms/blueprintsprocessor/modules/pom.xml @@ -22,7 +22,7 @@ org.onap.ccsdk.apps.blueprintsprocessor parent - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT ../parent diff --git a/ms/blueprintsprocessor/modules/services/db-service/pom.xml b/ms/blueprintsprocessor/modules/services/db-service/pom.xml index 2991de6b3..4ff4d8c07 100644 --- a/ms/blueprintsprocessor/modules/services/db-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/db-service/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor services - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT db-service diff --git a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml index 9cf514489..158496df1 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor services - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT execution-service diff --git a/ms/blueprintsprocessor/modules/services/pom.xml b/ms/blueprintsprocessor/modules/services/pom.xml index c698bbc28..eb3bda08d 100644 --- a/ms/blueprintsprocessor/modules/services/pom.xml +++ b/ms/blueprintsprocessor/modules/services/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT services diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/pom.xml b/ms/blueprintsprocessor/modules/services/resolution-service/pom.xml index 185b612b2..21464c14e 100644 --- a/ms/blueprintsprocessor/modules/services/resolution-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/resolution-service/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor services - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT resolution-service jar diff --git a/ms/blueprintsprocessor/parent/pom.xml b/ms/blueprintsprocessor/parent/pom.xml index 5b27ae8ba..625216e8b 100644 --- a/ms/blueprintsprocessor/parent/pom.xml +++ b/ms/blueprintsprocessor/parent/pom.xml @@ -21,7 +21,7 @@ org.onap.ccsdk.apps blueprintsprocessor - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT org.onap.ccsdk.apps.blueprintsprocessor parent diff --git a/ms/blueprintsprocessor/pom.xml b/ms/blueprintsprocessor/pom.xml index 5e03e9343..740407dc5 100644 --- a/ms/blueprintsprocessor/pom.xml +++ b/ms/blueprintsprocessor/pom.xml @@ -21,7 +21,7 @@ org.onap.ccsdk.apps ccsdk-apps - 0.3.1-SNAPSHOT + 0.4.0-SNAPSHOT blueprintsprocessor pom -- cgit 1.2.3-korg From 3b4a7eb973d0167c01a882355f24c70adf5d177a Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh(bs2796)" Date: Fri, 7 Dec 2018 16:37:03 -0500 Subject: Add GRPC Blueprint Processing API Change-Id: Id2c31e8db2b5ede6a992d923f695ce1e0e14b450 Issue-ID: CCSDK-799 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) --- .../blueprintsprocessor/BlueprintGRPCServer.java | 64 ++++++++++++++ .../blueprintsprocessor/BlueprintHttpServer.java | 57 +++++++++++++ .../src/main/resources/application.properties | 4 + .../modules/inbounds/selfservice-api/pom.xml | 64 +++++++++++--- .../selfservice/api/BluePrintCatalogServiceImpl.kt | 3 +- .../api/BluePrintManagementGRPCHandler.kt | 63 ++++++++++++++ .../api/BluePrintProcessingGRPCHandler.kt | 44 ++++++++++ .../api/BluePrintManagementGRPCHandlerTest.kt | 92 +++++++++++++++++++++ .../api/BluePrintProcessingGRPCHandlerTest.kt | 81 ++++++++++++++++++ .../src/test/resources/application-test.properties | 17 ++++ .../resources/execution-input/sample-payload.json | 10 +++ .../src/test/resources/test-cba.zip | Bin 0 -> 9189 bytes ms/blueprintsprocessor/parent/pom.xml | 10 +++ 13 files changed, 497 insertions(+), 12 deletions(-) create mode 100644 ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintGRPCServer.java create mode 100644 ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintHttpServer.java create mode 100644 ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt create mode 100644 ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandler.kt create mode 100644 ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandlerTest.kt create mode 100644 ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandlerTest.kt create mode 100644 ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/application-test.properties create mode 100644 ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/execution-input/sample-payload.json create mode 100644 ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/test-cba.zip (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintGRPCServer.java b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintGRPCServer.java new file mode 100644 index 000000000..86fdccd4b --- /dev/null +++ b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintGRPCServer.java @@ -0,0 +1,64 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * + * 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. + */ + +package org.onap.ccsdk.apps.blueprintsprocessor; + +import io.grpc.Server; +import io.grpc.ServerBuilder; +import org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api.BluePrintManagementGRPCHandler; +import org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api.BluePrintProcessingGRPCHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.ApplicationListener; +import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.stereotype.Component; + +@ConditionalOnProperty(name = "blueprintsprocessor.grpcEnable", havingValue = "true") +@Component +public class BlueprintGRPCServer implements ApplicationListener { + + private static Logger log = LoggerFactory.getLogger(BlueprintGRPCServer.class); + + @Autowired + private BluePrintProcessingGRPCHandler bluePrintProcessingGRPCHandler; + + @Autowired + private BluePrintManagementGRPCHandler bluePrintManagementGRPCHandler; + + @Value("${blueprintsprocessor.grpcPort}") + private Integer grpcPort; + + @Override + public void onApplicationEvent(ContextRefreshedEvent event) { + try { + log.info("Starting Blueprint Processor GRPC Starting.."); + Server server = ServerBuilder + .forPort(grpcPort) + .addService(bluePrintProcessingGRPCHandler) + .addService(bluePrintManagementGRPCHandler) + .build(); + + server.start(); + log.info("Blueprint Processor GRPC server started and ready to serve on port({})...", server.getPort()); + server.awaitTermination(); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintHttpServer.java b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintHttpServer.java new file mode 100644 index 000000000..b00c4627c --- /dev/null +++ b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintHttpServer.java @@ -0,0 +1,57 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * + * 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. + */ + +package org.onap.ccsdk.apps.blueprintsprocessor; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.web.embedded.netty.NettyReactiveWebServerFactory; +import org.springframework.boot.web.reactive.server.ReactiveWebServerFactory; +import org.springframework.boot.web.server.WebServer; +import org.springframework.http.server.reactive.HttpHandler; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; + +@ConditionalOnProperty(name = "blueprintsprocessor.grpcEnable", havingValue = "true") +@Component +public class BlueprintHttpServer { + private static Logger log = LoggerFactory.getLogger(BlueprintHttpServer.class); + + @Value("${blueprintsprocessor.httpPort}") + private Integer httpPort; + + @Autowired + HttpHandler httpHandler; + + WebServer http; + + @PostConstruct + public void start() { + ReactiveWebServerFactory factory = new NettyReactiveWebServerFactory(httpPort); + this.http = factory.getWebServer(this.httpHandler); + this.http.start(); + } + + @PreDestroy + public void stop() { + this.http.stop(); + } +} diff --git a/ms/blueprintsprocessor/application/src/main/resources/application.properties b/ms/blueprintsprocessor/application/src/main/resources/application.properties index 81b997685..fa1a1e6e4 100644 --- a/ms/blueprintsprocessor/application/src/main/resources/application.properties +++ b/ms/blueprintsprocessor/application/src/main/resources/application.properties @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +#logging.level.web=DEBUG +blueprintsprocessor.grpcEnable=false +blueprintsprocessor.httpPort=8080 +blueprintsprocessor.grpcPort=9111 # Blueprint Processor File Execution and Handling Properties blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml index a4c7aaf08..f319ca412 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -15,17 +15,59 @@ ~ limitations under the License. --> - 4.0.0 - - org.onap.ccsdk.apps.blueprintsprocessor - inbounds - 0.4.0-SNAPSHOT - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + inbounds + 0.4.0-SNAPSHOT + - selfservice-api - jar - Blueprints Processor Selfservice API - Blueprints Processor Selfservice API + selfservice-api + jar + Blueprints Processor Selfservice API + Blueprints Processor Selfservice API + + + + io.grpc + grpc-testing + + + + + + + kr.motd.maven + os-maven-plugin + 1.6.1 + + + + + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.6.1 + + + com.google.protobuf:protoc:3.5.1-1:exe:${os.detected.classifier} + + grpc-java + + io.grpc:protoc-gen-grpc-java:1.16.1:exe:${os.detected.classifier} + + ./../../../../../components/model-catalog/api-definition + + + + + compile + compile-custom + + + + + + diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintCatalogServiceImpl.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintCatalogServiceImpl.kt index 8e0678735..01c9a39e9 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintCatalogServiceImpl.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintCatalogServiceImpl.kt @@ -26,7 +26,8 @@ class BluePrintCatalogServiceImpl(private val bluePrintCoreConfiguration: BluePr override fun prepareBluePrint(name: String, version: String): String { //TODO("Get the Blueprint from the DB") - return bluePrintCoreConfiguration.deployPath.plus(File.separator).plus(name).plus(File.separator).plus(version) + return bluePrintCoreConfiguration.deployPath.plus(File.separator) + .plus(name).plus(File.separator).plus(version) } } \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt new file mode 100644 index 000000000..17191f31d --- /dev/null +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt @@ -0,0 +1,63 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * + * 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. + */ + +package org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api + +import io.grpc.stub.StreamObserver +import org.apache.commons.io.FileUtils +import org.onap.ccsdk.apps.blueprintsprocessor.core.BluePrintCoreConfiguration +import org.onap.ccsdk.apps.controllerblueprints.management.api.* +import org.slf4j.LoggerFactory +import org.springframework.stereotype.Service +import java.io.File + +@Service +class BluePrintManagementGRPCHandler(private val bluePrintCoreConfiguration: BluePrintCoreConfiguration) + : BluePrintManagementServiceGrpc.BluePrintManagementServiceImplBase() { + + private val log = LoggerFactory.getLogger(BluePrintManagementGRPCHandler::class.java) + + override fun uploadBlueprint(request: BluePrintUploadInput, responseObserver: StreamObserver) { + val response = BluePrintUploadOutput.newBuilder().setCommonHeader(request.commonHeader).build() + try { + val blueprintName = request.blueprintName + val blueprintVersion = request.blueprintVersion + val filePath = "${bluePrintCoreConfiguration.archivePath}/$blueprintName/$blueprintVersion" + val blueprintDir = File(filePath) + + log.info("Re-creating blueprint directory(${blueprintDir.absolutePath})") + FileUtils.deleteDirectory(blueprintDir) + FileUtils.forceMkdir(blueprintDir) + + val file = File("${blueprintDir.absolutePath}/$blueprintName.zip") + log.info("Writing CBA File under :${file.absolutePath}") + + val fileChunk = request.fileChunk + + file.writeBytes(fileChunk.chunk.toByteArray()).apply { + log.info("CBA file(${file.absolutePath} written successfully") + } + } catch (e: Exception) { + log.error("failed to upload file ", e) + } + responseObserver.onNext(response) + responseObserver.onCompleted() + } + + override fun removeBlueprint(request: BluePrintRemoveInput?, responseObserver: StreamObserver?) { + //TODO + } +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandler.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandler.kt new file mode 100644 index 000000000..2a5983d00 --- /dev/null +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandler.kt @@ -0,0 +1,44 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * + * 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. + */ + +package org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api + +import com.google.protobuf.util.JsonFormat +import io.grpc.stub.StreamObserver +import org.onap.ccsdk.apps.blueprintsprocessor.core.BluePrintCoreConfiguration +import org.onap.ccsdk.apps.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc +import org.onap.ccsdk.apps.controllerblueprints.processing.api.ExecutionServiceInput +import org.onap.ccsdk.apps.controllerblueprints.processing.api.ExecutionServiceOutput +import org.slf4j.LoggerFactory +import org.springframework.stereotype.Service + +@Service +class BluePrintProcessingGRPCHandler(private val bluePrintCoreConfiguration: BluePrintCoreConfiguration) + : BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase() { + private val log = LoggerFactory.getLogger(BluePrintProcessingGRPCHandler::class.java) + + override fun process(request: ExecutionServiceInput, + responseObserver: StreamObserver) { + + val json = JsonFormat.printer().print(request) + + //log.info("Received GRPC request ${json}") + //TODO( Handle Processing Response") + val response = ExecutionServiceOutput.newBuilder().setCommonHeader(request.commonHeader).build() + responseObserver.onNext(response) + responseObserver.onCompleted() + } +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandlerTest.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandlerTest.kt new file mode 100644 index 000000000..c870bf7f8 --- /dev/null +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandlerTest.kt @@ -0,0 +1,92 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * + * 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. + */ + +package org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api + +import com.google.protobuf.ByteString +import io.grpc.testing.GrpcServerRule +import org.apache.commons.io.FileUtils +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.onap.ccsdk.apps.blueprintsprocessor.core.BluePrintCoreConfiguration +import org.onap.ccsdk.apps.controllerblueprints.management.api.BluePrintManagementServiceGrpc +import org.onap.ccsdk.apps.controllerblueprints.management.api.BluePrintUploadInput +import org.onap.ccsdk.apps.controllerblueprints.management.api.CommonHeader +import org.onap.ccsdk.apps.controllerblueprints.management.api.FileChunk +import org.slf4j.LoggerFactory +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.test.context.ContextConfiguration +import org.springframework.test.context.TestPropertySource +import org.springframework.test.context.junit4.SpringRunner +import java.io.File +import java.nio.file.Paths +import kotlin.test.AfterTest +import kotlin.test.BeforeTest +import kotlin.test.assertNotNull +import kotlin.test.assertTrue + +@RunWith(SpringRunner::class) +@ContextConfiguration(classes = [BluePrintManagementGRPCHandler::class, BluePrintCoreConfiguration::class]) +@TestPropertySource(locations = ["classpath:application-test.properties"]) +class BluePrintManagementGRPCHandlerTest { + + private val log = LoggerFactory.getLogger(BluePrintProcessingGRPCHandlerTest::class.java)!! + + @get:Rule + val grpcServerRule = GrpcServerRule().directExecutor() + + @Autowired + lateinit var bluePrintManagementGRPCHandler: BluePrintManagementGRPCHandler + + @BeforeTest + fun init() { + // Create a server, add service, start, and register for automatic graceful shutdown. + grpcServerRule.serviceRegistry.addService(bluePrintManagementGRPCHandler) + } + + @AfterTest + fun cleanDir() { + FileUtils.deleteDirectory(File("./target/blueprints")) + } + + @Test + fun testFileUpload() { + val blockingStub = BluePrintManagementServiceGrpc.newBlockingStub(grpcServerRule.channel) + + val file = Paths.get("./src/test/resources/test-cba.zip").toFile() + assertTrue(file.exists(), "couldnt get file ${file.absolutePath}") + + val commonHeader = CommonHeader.newBuilder() + .setTimestamp("2012-04-23T18:25:43.511Z") + .setOriginatorId("System") + .setRequestId("1234") + .setSubRequestId("1234-56").build() + + val fileChunk = FileChunk.newBuilder().setChunk(ByteString.copyFrom(file.inputStream().readBytes())) + .build() + + val input = BluePrintUploadInput.newBuilder() + .setCommonHeader(commonHeader) + .setBlueprintName("sample") + .setBlueprintVersion("1.0.0") + .setFileChunk(fileChunk) + .build() + + val output = blockingStub.uploadBlueprint(input) + assertNotNull(output, "failed to get upload response") + } +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandlerTest.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandlerTest.kt new file mode 100644 index 000000000..6d5d633c9 --- /dev/null +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandlerTest.kt @@ -0,0 +1,81 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * + * 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. + */ + +package org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api + + +import com.google.protobuf.util.JsonFormat +import io.grpc.testing.GrpcServerRule +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.onap.ccsdk.apps.blueprintsprocessor.core.BluePrintCoreConfiguration +import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils +import org.onap.ccsdk.apps.controllerblueprints.processing.api.CommonHeader +import org.onap.ccsdk.apps.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc +import org.onap.ccsdk.apps.controllerblueprints.processing.api.ExecutionServiceInput +import org.slf4j.LoggerFactory +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.test.context.ContextConfiguration +import org.springframework.test.context.TestPropertySource +import org.springframework.test.context.junit4.SpringRunner +import kotlin.test.BeforeTest +import kotlin.test.assertNotNull + +@RunWith(SpringRunner::class) +@ContextConfiguration(classes = [BluePrintProcessingGRPCHandler::class, BluePrintCoreConfiguration::class]) +@TestPropertySource(locations = ["classpath:application-test.properties"]) +class BluePrintProcessingGRPCHandlerTest { + + private val log = LoggerFactory.getLogger(BluePrintProcessingGRPCHandlerTest::class.java)!! + + @get:Rule + val grpcServerRule = GrpcServerRule().directExecutor() + + @Autowired + lateinit var bluePrintProcessingGRPCHandler: BluePrintProcessingGRPCHandler + + @BeforeTest + fun init() { + // Create a server, add service, start, and register for automatic graceful shutdown. + grpcServerRule.serviceRegistry.addService(bluePrintProcessingGRPCHandler) + } + + @Test + fun testSelfServiceGRPCHandler() { + + val blockingStub = BluePrintProcessingServiceGrpc.newBlockingStub(grpcServerRule.channel) + + val commonHeader = CommonHeader.newBuilder() + .setTimestamp("2012-04-23T18:25:43.511Z") + .setOriginatorId("System") + .setRequestId("1234") + .setSubRequestId("1234-56").build() + + val jsonContent = JacksonUtils.getClassPathFileContent("execution-input/sample-payload.json") + val payloadBuilder = ExecutionServiceInput.newBuilder().payloadBuilder + JsonFormat.parser().merge(jsonContent, payloadBuilder) + + val input = ExecutionServiceInput.newBuilder() + .setCommonHeader(commonHeader) + .setPayload(payloadBuilder.build()) + .build() + + val response = blockingStub.process(input) + assertNotNull(response, "Response is null") + } + +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/application-test.properties b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/application-test.properties new file mode 100644 index 000000000..edb51022f --- /dev/null +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/application-test.properties @@ -0,0 +1,17 @@ +# +# Copyright © 2017-2018 AT&T Intellectual Property. +# +# 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. +# +blueprintsprocessor.blueprintDeployPath=./target/blueprints/deploy +blueprintsprocessor.blueprintArchivePath=./target/blueprints/archive diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/execution-input/sample-payload.json b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/execution-input/sample-payload.json new file mode 100644 index 000000000..07046aa37 --- /dev/null +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/execution-input/sample-payload.json @@ -0,0 +1,10 @@ +{ + "activate-request": { + "activate-properties": { + "request-id": "1234", + "action-name": "activate", + "scope-type": "vnf-type", + "hostname": "localhost" + } + } +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/test-cba.zip b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/test-cba.zip new file mode 100644 index 000000000..a62d4bfbb Binary files /dev/null and b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/test-cba.zip differ diff --git a/ms/blueprintsprocessor/parent/pom.xml b/ms/blueprintsprocessor/parent/pom.xml index 796aef160..d8a47eff9 100644 --- a/ms/blueprintsprocessor/parent/pom.xml +++ b/ms/blueprintsprocessor/parent/pom.xml @@ -36,6 +36,7 @@ 1.3.10 1.0.1 1.16.1 + 3.6.1 1.0.0 0.3.1 26.0-jre @@ -116,6 +117,11 @@ grpc-stub ${grpc.version} + + com.google.protobuf + protobuf-java-util + ${protobuff.java.utils.version} + @@ -355,6 +361,10 @@ io.grpc grpc-stub + + com.google.protobuf + protobuf-java-util + -- cgit 1.2.3-korg From 9bb2c665dc8f603ab787c8d4470eb483b1fe0623 Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Mon, 7 Jan 2019 16:33:02 -0500 Subject: Add support for blueprintprocessor runtime DB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - created db-resources module to store controller blueprint related controller blueprint repository and entities. Also create an abstract BlueprintCatalogServiceImpl so it can be used both by controllerblueprint and blueprintprocessor - created blueprint-validation to store the implementation of the validation interface. - change controllerblueprint service to levrage db-resources - implement CatalogService for blueprintprocessor db-lib by using db-resources. Change-Id: I0539e414e4ff3b7a6edf0f6304d6cbc5e6eac404 Issue-ID: CCSDK-664 Signed-off-by: Alexis de Talhouët --- .../BlueprintProcessorApplicationTest.java | 3 +- .../modules/commons/db-lib/pom.xml | 12 ++- .../db/BlueprintProcessorCatalogServiceImpl.kt | 86 ++++++++++++++++++ .../db/primary/PrimaryDatabaseConfiguration.kt | 3 +- .../db/primary/domain/BlueprintProcessorModel.kt | 93 +++++++++++++++++++ .../domain/BlueprintProcessorModelContent.kt | 101 +++++++++++++++++++++ .../BlueprintProcessorModelContentRepository.kt | 22 +++++ .../BlueprintProcessorModelRepository.kt | 21 +++++ .../db/primary/PrimaryDatabaseConfigurationTest.kt | 7 +- .../src/test/resources/application-test.properties | 6 +- .../rest/service/RestClientServiceTest.kt | 3 +- .../modules/inbounds/selfservice-api/pom.xml | 2 +- .../selfservice/api/BluePrintCatalogServiceImpl.kt | 45 --------- 13 files changed, 351 insertions(+), 53 deletions(-) create mode 100755 ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BlueprintProcessorCatalogServiceImpl.kt create mode 100755 ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/domain/BlueprintProcessorModel.kt create mode 100644 ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/domain/BlueprintProcessorModelContent.kt create mode 100644 ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/repository/BlueprintProcessorModelContentRepository.kt create mode 100644 ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/repository/BlueprintProcessorModelRepository.kt delete mode 100755 ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintCatalogServiceImpl.kt (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/application/src/test/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintProcessorApplicationTest.java b/ms/blueprintsprocessor/application/src/test/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintProcessorApplicationTest.java index 8a4ebd0a0..5777a28fc 100644 --- a/ms/blueprintsprocessor/application/src/test/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintProcessorApplicationTest.java +++ b/ms/blueprintsprocessor/application/src/test/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintProcessorApplicationTest.java @@ -21,6 +21,7 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.onap.ccsdk.apps.controllerblueprints.core.config.BluePrintLoadConfiguration; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.ApplicationContext; @@ -35,7 +36,7 @@ import org.springframework.test.context.junit4.SpringRunner; */ @RunWith(SpringRunner.class) -@ContextConfiguration(classes = BlueprintProcessorApplication.class) +@ContextConfiguration(classes = {BlueprintProcessorApplication.class, BluePrintLoadConfiguration.class}) @SpringBootTest(classes = BlueprintProcessorApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class BlueprintProcessorApplicationTest { diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml index 4b11f83f2..cf265fc37 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml @@ -15,7 +15,7 @@ ~ limitations under the License. --> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor @@ -29,6 +29,16 @@ Blueprints Processor DB Lib + + org.onap.ccsdk.apps.controllerblueprints + db-resources + ${project.version} + + + org.onap.ccsdk.apps.controllerblueprints + blueprint-validation + ${project.version} + org.onap.ccsdk.apps.blueprintsprocessor core diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BlueprintProcessorCatalogServiceImpl.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BlueprintProcessorCatalogServiceImpl.kt new file mode 100755 index 000000000..7c0eb6b63 --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BlueprintProcessorCatalogServiceImpl.kt @@ -0,0 +1,86 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * Modifications Copyright © 2019 Bell Canada. + * + * 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. + */ + +package org.onap.ccsdk.apps.blueprintsprocessor.db + +import org.onap.ccsdk.apps.blueprintsprocessor.db.primary.domain.BlueprintProcessorModel +import org.onap.ccsdk.apps.blueprintsprocessor.db.primary.domain.BlueprintProcessorModelContent +import org.onap.ccsdk.apps.blueprintsprocessor.db.primary.repository.BlueprintProcessorModelContentRepository +import org.onap.ccsdk.apps.blueprintsprocessor.db.primary.repository.BlueprintProcessorModelRepository +import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants +import org.onap.ccsdk.apps.controllerblueprints.core.common.ApplicationConstants +import org.onap.ccsdk.apps.controllerblueprints.core.config.BluePrintLoadConfiguration +import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintValidatorService +import org.onap.ccsdk.apps.controllerblueprints.core.utils.BluePrintArchiveUtils +import org.onap.ccsdk.apps.controllerblueprints.core.utils.BluePrintMetadataUtils +import org.onap.ccsdk.apps.controllerblueprints.db.resources.BlueprintCatalogServiceImpl +import org.springframework.stereotype.Service +import java.io.File +import java.nio.file.Files + +/** +Similar/Duplicate implementation in [org.onap.ccsdk.apps.controllerblueprints.service.load.ControllerBlueprintCatalogServiceImpl] + */ +@Service +class BlueprintProcessorCatalogServiceImpl(bluePrintLoadConfiguration: BluePrintLoadConfiguration, + private val bluePrintValidatorService: BluePrintValidatorService, + private val blueprintModelContentRepository: BlueprintProcessorModelContentRepository, + private val blueprintModelRepository: BlueprintProcessorModelRepository) + : BlueprintCatalogServiceImpl(bluePrintLoadConfiguration) { + + override fun saveToDataBase(extractedDirectory: File, id: String, archiveFile: File, checkValidity: Boolean?) { + var valid = false + val firstItem = BluePrintArchiveUtils.getFirstItemInDirectory(extractedDirectory) + val blueprintBaseDirectory = extractedDirectory.absolutePath + "/" + firstItem + // Validate Blueprint + val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(id, blueprintBaseDirectory) + + // Check Validity of blueprint + if (checkValidity!!) { + valid = bluePrintValidatorService.validateBluePrints(bluePrintRuntimeService) + } + + if ((valid && checkValidity!!) || (!valid && !checkValidity!!)) { + val metaData = bluePrintRuntimeService.bluePrintContext().metadata!! + // FIXME("Check Duplicate for Artifact Name and Artifact Version") + val blueprintModel = BlueprintProcessorModel() + blueprintModel.id = id + blueprintModel.artifactType = ApplicationConstants.ASDC_ARTIFACT_TYPE_SDNC_MODEL + blueprintModel.published = ApplicationConstants.ACTIVE_N + blueprintModel.artifactName = metaData[BluePrintConstants.METADATA_TEMPLATE_NAME] + blueprintModel.artifactVersion = metaData[BluePrintConstants.METADATA_TEMPLATE_VERSION] + blueprintModel.updatedBy = metaData[BluePrintConstants.METADATA_TEMPLATE_AUTHOR] + blueprintModel.tags = metaData[BluePrintConstants.METADATA_TEMPLATE_TAGS] + blueprintModel.artifactDescription = "Controller Blueprint for ${blueprintModel.artifactName}:${blueprintModel.artifactVersion}" + + val blueprintModelContent = BlueprintProcessorModelContent() + blueprintModelContent.id = id // For quick access both id's are same.always have one to one mapping. + blueprintModelContent.contentType = "CBA_ZIP" + blueprintModelContent.name = "${blueprintModel.artifactName}:${blueprintModel.artifactVersion}" + blueprintModelContent.description = "(${blueprintModel.artifactName}:${blueprintModel.artifactVersion} CBA Zip Content" + blueprintModelContent.content = Files.readAllBytes(archiveFile.toPath()) + + // Set the Blueprint Model into blueprintModelContent + blueprintModelContent.blueprintModel = blueprintModel + + // Set the Blueprint Model Content into blueprintModel + blueprintModel.blueprintModelContent = blueprintModelContent + + blueprintModelRepository.saveAndFlush(blueprintModel) + } + } +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDatabaseConfiguration.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDatabaseConfiguration.kt index bf76e213d..98b6221d6 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDatabaseConfiguration.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDatabaseConfiguration.kt @@ -45,8 +45,7 @@ open class PrimaryDatabaseConfiguration(private val primaryDataSourceProperties: open fun primaryEntityManager(): LocalContainerEntityManagerFactoryBean { val em = LocalContainerEntityManagerFactoryBean() em.dataSource = primaryDataSource() - em.setPackagesToScan( - "org.onap.ccsdk.apps.blueprintsprocessor.db.primary") + em.setPackagesToScan("org.onap.ccsdk.apps.blueprintsprocessor.db.primary") val vendorAdapter = HibernateJpaVendorAdapter() em.jpaVendorAdapter = vendorAdapter diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/domain/BlueprintProcessorModel.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/domain/BlueprintProcessorModel.kt new file mode 100755 index 000000000..00d4830ea --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/domain/BlueprintProcessorModel.kt @@ -0,0 +1,93 @@ +/* + * Copyright © 2019 Bell Canada + * + * 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. + */ + +package org.onap.ccsdk.apps.blueprintsprocessor.db.primary.domain + +import com.fasterxml.jackson.annotation.JsonFormat +import io.swagger.annotations.ApiModelProperty +import javax.persistence.Entity +import javax.persistence.EntityListeners +import javax.persistence.Table +import org.hibernate.annotations.Proxy +import org.springframework.data.annotation.LastModifiedDate +import org.springframework.data.jpa.domain.support.AuditingEntityListener +import java.io.Serializable +import java.util.* +import javax.persistence.CascadeType +import javax.persistence.Column +import javax.persistence.FetchType +import javax.persistence.Id +import javax.persistence.Lob +import javax.persistence.OneToOne +import javax.persistence.Temporal +import javax.persistence.TemporalType + +@EntityListeners(AuditingEntityListener::class) +@Entity +@Table(name = "BLUEPRINT_RUNTIME") +@Proxy(lazy = false) +class BlueprintProcessorModel : Serializable { + @Id + @Column(name = "config_model_id") + var id: String? = null + + @Column(name = "artifact_uuid") + var artifactUUId: String? = null + + @Column(name = "artifact_type") + var artifactType: String? = null + + @Column(name = "artifact_version", nullable = false) + @ApiModelProperty(required = true) + var artifactVersion: String? = null + + @Lob + @Column(name = "artifact_description") + var artifactDescription: String? = null + + @Column(name = "internal_version") + var internalVersion: Int? = null + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") + @LastModifiedDate + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "creation_date") + var createdDate = Date() + + @Column(name = "artifact_name", nullable = false) + @ApiModelProperty(required = true) + var artifactName: String? = null + + @Column(name = "published", nullable = false) + @ApiModelProperty(required = true) + var published: String? = null + + @Column(name = "updated_by", nullable = false) + @ApiModelProperty(required = true) + var updatedBy: String? = null + + @Lob + @Column(name = "tags", nullable = false) + @ApiModelProperty(required = true) + var tags: String? = null + + @OneToOne(mappedBy = "blueprintModel", fetch = FetchType.EAGER, orphanRemoval = true, cascade = [CascadeType.ALL]) + var blueprintModelContent: BlueprintProcessorModelContent? = null + + companion object { + private const val serialVersionUID = 1L + } +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/domain/BlueprintProcessorModelContent.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/domain/BlueprintProcessorModelContent.kt new file mode 100644 index 000000000..d012af58f --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/domain/BlueprintProcessorModelContent.kt @@ -0,0 +1,101 @@ +/* + * Copyright © 2019 Bell Canada + * + * 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. + */ + +package org.onap.ccsdk.apps.blueprintsprocessor.db.primary.domain + +import com.fasterxml.jackson.annotation.JsonFormat +import io.swagger.annotations.ApiModelProperty +import java.io.Serializable +import java.util.Date +import java.util.Objects +import javax.persistence.Column +import javax.persistence.Entity +import javax.persistence.EntityListeners +import javax.persistence.Id +import javax.persistence.JoinColumn +import javax.persistence.Lob +import javax.persistence.OneToOne +import javax.persistence.Table +import javax.persistence.Temporal +import javax.persistence.TemporalType +import org.springframework.data.annotation.LastModifiedDate +import org.springframework.data.jpa.domain.support.AuditingEntityListener + +@EntityListeners(AuditingEntityListener::class) +@Entity +@Table(name = "BLUEPRINT_CONTENT_RUNTIME") +class BlueprintProcessorModelContent : Serializable { + + @Id + @Column(name = "config_model_content_id") + var id: String? = null + + @Column(name = "name", nullable = false) + @ApiModelProperty(required = true) + var name: String? = null + + @Column(name = "content_type", nullable = false) + @ApiModelProperty(required = true) + var contentType: String? = null + + @OneToOne + @JoinColumn(name = "config_model_id") + var blueprintModel: BlueprintProcessorModel? = null + + @Lob + @Column(name = "description") + var description: String? = null + + @Lob + @Column(name = "content", nullable = false) + @ApiModelProperty(required = true) + var content: ByteArray? = null + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") + @LastModifiedDate + @Temporal(TemporalType.TIMESTAMP) + @Column(name = "updated_date") + var creationDate = Date() + + override fun toString(): String { + return "[" + "id = " + id + + ", name = " + name + + ", contentType = " + contentType + + "]" + } + + override fun equals(o: Any?): Boolean { + + if (o === this) { + return true + } + if (o !is BlueprintProcessorModelContent) { + return false + } + val blueprintModelContent = o as BlueprintProcessorModelContent? + return (id == blueprintModelContent!!.id && name == blueprintModelContent.name + && contentType == blueprintModelContent.contentType) + } + + override fun hashCode(): Int { + return Objects.hash(id, name, contentType) + } + + companion object { + private const val serialVersionUID = 1L + } + +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/repository/BlueprintProcessorModelContentRepository.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/repository/BlueprintProcessorModelContentRepository.kt new file mode 100644 index 000000000..e614544e9 --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/repository/BlueprintProcessorModelContentRepository.kt @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2019 Bell Canada. + * + * 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. + */ +package org.onap.ccsdk.apps.blueprintsprocessor.db.primary.repository + +import org.onap.ccsdk.apps.blueprintsprocessor.db.primary.domain.BlueprintProcessorModel +import org.onap.ccsdk.apps.blueprintsprocessor.db.primary.domain.BlueprintProcessorModelContent +import org.onap.ccsdk.apps.controllerblueprints.db.resources.repository.ModelContentRepository + +interface BlueprintProcessorModelContentRepository : ModelContentRepository \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/repository/BlueprintProcessorModelRepository.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/repository/BlueprintProcessorModelRepository.kt new file mode 100644 index 000000000..25f3dac9a --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/repository/BlueprintProcessorModelRepository.kt @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2019 Bell Canada. + * + * 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. + */ +package org.onap.ccsdk.apps.blueprintsprocessor.db.primary.repository + +import org.onap.ccsdk.apps.blueprintsprocessor.db.primary.domain.BlueprintProcessorModel +import org.onap.ccsdk.apps.controllerblueprints.db.resources.repository.ModelRepository + +interface BlueprintProcessorModelRepository : ModelRepository diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDatabaseConfigurationTest.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDatabaseConfigurationTest.kt index aa48c8e3a..3f737e314 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDatabaseConfigurationTest.kt +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDatabaseConfigurationTest.kt @@ -21,7 +21,10 @@ import org.junit.runner.RunWith import org.onap.ccsdk.apps.blueprintsprocessor.core.BluePrintProperties import org.onap.ccsdk.apps.blueprintsprocessor.core.BlueprintPropertyConfiguration import org.onap.ccsdk.apps.blueprintsprocessor.db.BluePrintDBLibConfiguration +import org.onap.ccsdk.apps.controllerblueprints.core.config.BluePrintLoadConfiguration import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.autoconfigure.EnableAutoConfiguration +import org.springframework.context.annotation.ComponentScan import org.springframework.test.context.ContextConfiguration import org.springframework.test.context.TestPropertySource import org.springframework.test.context.junit4.SpringRunner @@ -30,8 +33,10 @@ import kotlin.test.assertNotNull @RunWith(SpringRunner::class) @ContextConfiguration(classes = [BlueprintPropertyConfiguration::class, BluePrintProperties::class, - BluePrintDBLibConfiguration::class]) + BluePrintDBLibConfiguration::class, BluePrintLoadConfiguration::class]) @TestPropertySource(locations = ["classpath:application-test.properties"]) +@ComponentScan(basePackages = ["org.onap.ccsdk.apps.blueprintsprocessor", "org.onap.ccsdk.apps.controllerblueprints"]) +@EnableAutoConfiguration class PrimaryDatabaseConfigurationTest { @Autowired diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/resources/application-test.properties b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/resources/application-test.properties index 672ff80f6..6f10626e0 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/src/test/resources/application-test.properties +++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/test/resources/application-test.properties @@ -21,4 +21,8 @@ blueprintsprocessor.db.primary.driverClassName=org.h2.Driver blueprintsprocessor.db.primary.hibernateHbm2ddlAuto=create-drop blueprintsprocessor.db.primary.hibernateDDLAuto=update blueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy -blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.H2Dialect \ No newline at end of file +blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.H2Dialect + +# Controller Blueprints Core Configuration +blueprintsprocessor.blueprintDeployPath=./target/blueprints/deploy +blueprintsprocessor.blueprintArchivePath=./target/blueprints/archive \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/service/RestClientServiceTest.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/service/RestClientServiceTest.kt index 502758a4f..1481406ed 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/service/RestClientServiceTest.kt +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/service/RestClientServiceTest.kt @@ -22,6 +22,7 @@ import org.onap.ccsdk.apps.blueprintsprocessor.core.BlueprintPropertyConfigurati import org.onap.ccsdk.apps.blueprintsprocessor.rest.BluePrintRestLibConfiguration import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.autoconfigure.EnableAutoConfiguration +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration import org.springframework.boot.test.context.SpringBootTest import org.springframework.test.context.ContextConfiguration import org.springframework.test.context.TestPropertySource @@ -32,8 +33,8 @@ import org.springframework.web.bind.annotation.RestController import kotlin.test.Test import kotlin.test.assertNotNull -@EnableAutoConfiguration @RunWith(SpringRunner::class) +@EnableAutoConfiguration(exclude = [DataSourceAutoConfiguration::class]) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @ContextConfiguration(classes = [BluePrintRestLibConfiguration::class, BlueprintPropertyConfiguration::class, SampleController::class, BluePrintProperties::class]) diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml index f319ca412..2c6da2e7f 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -15,7 +15,7 @@ ~ limitations under the License. --> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintCatalogServiceImpl.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintCatalogServiceImpl.kt deleted file mode 100755 index 484972a9f..000000000 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintCatalogServiceImpl.kt +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * 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. - */ - -package org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api - -import org.onap.ccsdk.apps.blueprintsprocessor.core.BluePrintCoreConfiguration -import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintCatalogService -import org.springframework.stereotype.Service -import java.io.File - -@Service -class BluePrintCatalogServiceImpl(private val bluePrintCoreConfiguration: BluePrintCoreConfiguration) : BluePrintCatalogService { - - override fun uploadToDataBase(file: String, validate : Boolean): String { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - - override fun downloadFromDataBase(name: String, version: String, path: String): String { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - - override fun prepareBluePrint(name: String, version: String): String { - //TODO("Get the Blueprint from the DB") - return bluePrintCoreConfiguration.deployPath.plus(File.separator) - .plus(name).plus(File.separator).plus(version) - - } - - override fun downloadFromDataBase(uuid: String, path: String): String { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } -} \ No newline at end of file -- cgit 1.2.3-korg From d7d47b415d9e1b509e18c85f3e33e980a91ad872 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Fri, 4 Jan 2019 10:43:33 -0500 Subject: Update to use correct parent pom Updated neng microservice to use springboot v1 parent as opposed to odlparent. Without that change, javadoc was failing when compiled with Fluorine version of odlparent-lite parent pom. Change-Id: I677278d90869f493c281c7c5432b271dd43e7513 Issue-ID: CCSDK-870 Signed-off-by: Timoney, Dan (dt5972) --- ms/blueprintsprocessor/application/pom.xml | 2 +- ms/blueprintsprocessor/functions/netconf-executor/pom.xml | 2 +- ms/blueprintsprocessor/functions/pom.xml | 2 +- ms/blueprintsprocessor/functions/python-executor/pom.xml | 2 +- ms/blueprintsprocessor/functions/resource-resolution/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/core/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/db-lib/pom.xml | 5 ++--- ms/blueprintsprocessor/modules/commons/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml | 2 +- ms/blueprintsprocessor/modules/inbounds/pom.xml | 2 +- ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml | 2 +- ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml | 5 ++--- ms/blueprintsprocessor/modules/outbounds/pom.xml | 2 +- ms/blueprintsprocessor/modules/pom.xml | 2 +- ms/blueprintsprocessor/modules/services/execution-service/pom.xml | 2 +- ms/blueprintsprocessor/modules/services/pom.xml | 2 +- ms/blueprintsprocessor/modules/services/workflow-service/pom.xml | 2 +- ms/blueprintsprocessor/parent/pom.xml | 4 ++-- ms/blueprintsprocessor/pom.xml | 2 +- 19 files changed, 22 insertions(+), 24 deletions(-) (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/application/pom.xml b/ms/blueprintsprocessor/application/pom.xml index 19208071b..679a8b909 100644 --- a/ms/blueprintsprocessor/application/pom.xml +++ b/ms/blueprintsprocessor/application/pom.xml @@ -21,7 +21,7 @@ org.onap.ccsdk.apps.blueprintsprocessor parent - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT ../parent application diff --git a/ms/blueprintsprocessor/functions/netconf-executor/pom.xml b/ms/blueprintsprocessor/functions/netconf-executor/pom.xml index 3128b641a..51c625025 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/pom.xml +++ b/ms/blueprintsprocessor/functions/netconf-executor/pom.xml @@ -18,7 +18,7 @@ org.onap.ccsdk.apps.blueprintsprocessor functions - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor.functions diff --git a/ms/blueprintsprocessor/functions/pom.xml b/ms/blueprintsprocessor/functions/pom.xml index 4de42beec..2a952f88e 100644 --- a/ms/blueprintsprocessor/functions/pom.xml +++ b/ms/blueprintsprocessor/functions/pom.xml @@ -18,7 +18,7 @@ org.onap.ccsdk.apps.blueprintsprocessor parent - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT ../parent 4.0.0 diff --git a/ms/blueprintsprocessor/functions/python-executor/pom.xml b/ms/blueprintsprocessor/functions/python-executor/pom.xml index ba97d22b3..120ded780 100644 --- a/ms/blueprintsprocessor/functions/python-executor/pom.xml +++ b/ms/blueprintsprocessor/functions/python-executor/pom.xml @@ -18,7 +18,7 @@ functions org.onap.ccsdk.apps.blueprintsprocessor - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT 4.0.0 diff --git a/ms/blueprintsprocessor/functions/resource-resolution/pom.xml b/ms/blueprintsprocessor/functions/resource-resolution/pom.xml index 07ae44bdc..2f08c5807 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/pom.xml +++ b/ms/blueprintsprocessor/functions/resource-resolution/pom.xml @@ -19,7 +19,7 @@ org.onap.ccsdk.apps.blueprintsprocessor functions - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT org.onap.ccsdk.apps.blueprintsprocessor.functions resource-resolution diff --git a/ms/blueprintsprocessor/modules/commons/core/pom.xml b/ms/blueprintsprocessor/modules/commons/core/pom.xml index bc6019da9..42710b517 100644 --- a/ms/blueprintsprocessor/modules/commons/core/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/core/pom.xml @@ -21,7 +21,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT core diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml index cf265fc37..53c9b185f 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml @@ -14,13 +14,12 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor commons - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT db-lib diff --git a/ms/blueprintsprocessor/modules/commons/pom.xml b/ms/blueprintsprocessor/modules/commons/pom.xml index 0c027d457..4df89857e 100644 --- a/ms/blueprintsprocessor/modules/commons/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/pom.xml @@ -19,7 +19,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT commons diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml index 230001490..82e8cd731 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml @@ -19,7 +19,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT rest-lib diff --git a/ms/blueprintsprocessor/modules/inbounds/pom.xml b/ms/blueprintsprocessor/modules/inbounds/pom.xml index 695c54e22..1384b8a10 100644 --- a/ms/blueprintsprocessor/modules/inbounds/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/pom.xml @@ -19,7 +19,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT inbounds diff --git a/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml index ece517226..6395963be 100644 --- a/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml @@ -19,7 +19,7 @@ org.onap.ccsdk.apps.blueprintsprocessor inbounds - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT resource-api diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml index 2c6da2e7f..db6fdd27e 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -14,13 +14,12 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor inbounds - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT selfservice-api diff --git a/ms/blueprintsprocessor/modules/outbounds/pom.xml b/ms/blueprintsprocessor/modules/outbounds/pom.xml index e7e4d7c9b..e957c881d 100644 --- a/ms/blueprintsprocessor/modules/outbounds/pom.xml +++ b/ms/blueprintsprocessor/modules/outbounds/pom.xml @@ -19,7 +19,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT outbounds diff --git a/ms/blueprintsprocessor/modules/pom.xml b/ms/blueprintsprocessor/modules/pom.xml index 210320758..5cc31c46e 100644 --- a/ms/blueprintsprocessor/modules/pom.xml +++ b/ms/blueprintsprocessor/modules/pom.xml @@ -21,7 +21,7 @@ org.onap.ccsdk.apps.blueprintsprocessor parent - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT ../parent diff --git a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml index 1b86fafd6..035f14d90 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml @@ -19,7 +19,7 @@ org.onap.ccsdk.apps.blueprintsprocessor services - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT execution-service diff --git a/ms/blueprintsprocessor/modules/services/pom.xml b/ms/blueprintsprocessor/modules/services/pom.xml index ae434fbaf..8cb3c6f1d 100644 --- a/ms/blueprintsprocessor/modules/services/pom.xml +++ b/ms/blueprintsprocessor/modules/services/pom.xml @@ -19,7 +19,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT services diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/pom.xml b/ms/blueprintsprocessor/modules/services/workflow-service/pom.xml index f681ba572..6e3dade65 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/workflow-service/pom.xml @@ -18,7 +18,7 @@ org.onap.ccsdk.apps.blueprintsprocessor services - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT 4.0.0 diff --git a/ms/blueprintsprocessor/parent/pom.xml b/ms/blueprintsprocessor/parent/pom.xml index 935ed64d8..b44236b88 100644 --- a/ms/blueprintsprocessor/parent/pom.xml +++ b/ms/blueprintsprocessor/parent/pom.xml @@ -21,7 +21,7 @@ org.onap.ccsdk.apps blueprintsprocessor - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT org.onap.ccsdk.apps.blueprintsprocessor parent @@ -37,7 +37,7 @@ 1.16.1 3.6.1 1.0.0 - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT 26.0-jre 2.7.1 2.9.2 diff --git a/ms/blueprintsprocessor/pom.xml b/ms/blueprintsprocessor/pom.xml index 2020781e9..df4932cd8 100644 --- a/ms/blueprintsprocessor/pom.xml +++ b/ms/blueprintsprocessor/pom.xml @@ -19,7 +19,7 @@ org.onap.ccsdk.apps ccsdk-apps-ms - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT blueprintsprocessor pom -- cgit 1.2.3-korg From 44cb2fcd7f6686e6531a5a5222d45bdf31739efb Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Sun, 13 Jan 2019 16:49:32 -0500 Subject: Implement BluePrintManagementServiceGrpc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I66a6a3c23b5a3c24ce8d61178f00f053cb8bbbdc Issue-ID: CCSDK-909 Signed-off-by: Alexis de Talhouët --- .../modules/inbounds/selfservice-api/pom.xml | 5 ++ .../api/BluePrintManagementGRPCHandler.kt | 93 ++++++++++++++++------ .../selfservice/api/utils/TimeUtils.kt | 27 +++++++ .../api/BluePrintManagementGRPCHandlerTest.kt | 42 ++++++---- .../api/BluePrintProcessingGRPCHandlerTest.kt | 17 ++-- .../selfservice/api/ExecutionServiceHandlerTest.kt | 35 +++++--- .../selfservice/api/mock/SelfServiceApiMocks.kt | 57 ------------- .../src/test/resources/application-test.properties | 11 +++ 8 files changed, 171 insertions(+), 116 deletions(-) create mode 100644 ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/utils/TimeUtils.kt delete mode 100755 ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/mock/SelfServiceApiMocks.kt (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml index db6fdd27e..7041dab3c 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -32,6 +32,11 @@ io.grpc grpc-testing + + com.h2database + h2 + test + diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt index 17191f31d..aa01f2204 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt @@ -1,5 +1,6 @@ /* * Copyright © 2017-2018 AT&T Intellectual Property. + * Modifications Copyright © 2019 Bell Canada. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,48 +17,94 @@ package org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api +import io.grpc.StatusException import io.grpc.stub.StreamObserver import org.apache.commons.io.FileUtils import org.onap.ccsdk.apps.blueprintsprocessor.core.BluePrintCoreConfiguration -import org.onap.ccsdk.apps.controllerblueprints.management.api.* +import org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api.utils.currentTimestamp +import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintCatalogService +import org.onap.ccsdk.apps.controllerblueprints.management.api.BluePrintManagementInput +import org.onap.ccsdk.apps.controllerblueprints.management.api.BluePrintManagementOutput +import org.onap.ccsdk.apps.controllerblueprints.management.api.BluePrintManagementServiceGrpc +import org.onap.ccsdk.apps.controllerblueprints.management.api.CommonHeader +import org.onap.ccsdk.apps.controllerblueprints.management.api.Status import org.slf4j.LoggerFactory import org.springframework.stereotype.Service import java.io.File @Service -class BluePrintManagementGRPCHandler(private val bluePrintCoreConfiguration: BluePrintCoreConfiguration) +class BluePrintManagementGRPCHandler(private val bluePrintCoreConfiguration: BluePrintCoreConfiguration, + private val bluePrintCatalogService: BluePrintCatalogService) : BluePrintManagementServiceGrpc.BluePrintManagementServiceImplBase() { private val log = LoggerFactory.getLogger(BluePrintManagementGRPCHandler::class.java) - override fun uploadBlueprint(request: BluePrintUploadInput, responseObserver: StreamObserver) { - val response = BluePrintUploadOutput.newBuilder().setCommonHeader(request.commonHeader).build() + override fun uploadBlueprint(request: BluePrintManagementInput, responseObserver: StreamObserver) { + val blueprintName = request.blueprintName + val blueprintVersion = request.blueprintVersion + val blueprint = "blueprint $blueprintName:$blueprintVersion" + + log.info("request(${request.commonHeader.requestId}): Received upload $blueprint") + + val blueprintArchivedFilePath = "${bluePrintCoreConfiguration.archivePath}/$blueprintName/$blueprintVersion/$blueprintName.zip" try { - val blueprintName = request.blueprintName - val blueprintVersion = request.blueprintVersion - val filePath = "${bluePrintCoreConfiguration.archivePath}/$blueprintName/$blueprintVersion" - val blueprintDir = File(filePath) + val blueprintArchivedFile = File(blueprintArchivedFilePath) + + saveToDisk(request, blueprintArchivedFile) + val blueprintId = bluePrintCatalogService.saveToDatabase(blueprintArchivedFile) + + File("${bluePrintCoreConfiguration.archivePath}/$blueprintName").deleteRecursively() - log.info("Re-creating blueprint directory(${blueprintDir.absolutePath})") - FileUtils.deleteDirectory(blueprintDir) - FileUtils.forceMkdir(blueprintDir) + responseObserver.onNext(successStatus("Successfully uploaded $blueprint with id($blueprintId)", request.commonHeader)) + responseObserver.onCompleted() + } catch (e: Exception) { + failStatus("request(${request.commonHeader.requestId}): Failed to upload $blueprint at path $blueprintArchivedFilePath", e) + } + } - val file = File("${blueprintDir.absolutePath}/$blueprintName.zip") - log.info("Writing CBA File under :${file.absolutePath}") + override fun removeBlueprint(request: BluePrintManagementInput, responseObserver: StreamObserver) { + val blueprintName = request.blueprintName + val blueprintVersion = request.blueprintVersion + val blueprint = "blueprint $blueprintName:$blueprintVersion" - val fileChunk = request.fileChunk + log.info("request(${request.commonHeader.requestId}): Received delete $blueprint") - file.writeBytes(fileChunk.chunk.toByteArray()).apply { - log.info("CBA file(${file.absolutePath} written successfully") - } + try { + bluePrintCatalogService.deleteFromDatabase(blueprintName, blueprintVersion) + responseObserver.onNext(successStatus("Successfully deleted $blueprint", request.commonHeader)) + responseObserver.onCompleted() } catch (e: Exception) { - log.error("failed to upload file ", e) + failStatus("request(${request.commonHeader.requestId}): Failed to delete $blueprint", e) + } + } + + private fun saveToDisk(request: BluePrintManagementInput, blueprintDir: File) { + log.debug("request(${request.commonHeader.requestId}): Writing CBA File under :${blueprintDir.absolutePath}") + if (blueprintDir.exists()) { + log.debug("request(${request.commonHeader.requestId}): Re-creating blueprint directory(${blueprintDir.absolutePath})") + FileUtils.deleteDirectory(blueprintDir.parentFile) + } + FileUtils.forceMkdir(blueprintDir.parentFile) + blueprintDir.writeBytes(request.fileChunk.chunk.toByteArray()).apply { + log.debug("request(${request.commonHeader.requestId}): CBA file(${blueprintDir.absolutePath} written successfully") } - responseObserver.onNext(response) - responseObserver.onCompleted() } - override fun removeBlueprint(request: BluePrintRemoveInput?, responseObserver: StreamObserver?) { - //TODO + private fun successStatus(message: String, header: CommonHeader): BluePrintManagementOutput = + BluePrintManagementOutput.newBuilder() + .setCommonHeader(header) + .setStatus(Status.newBuilder() + .setTimestamp(currentTimestamp()) + .setMessage(message) + .setCode(200) + .build()) + .build() + + private fun failStatus(message: String, e: Exception): StatusException { + log.error(message, e) + return io.grpc.Status.INTERNAL + .withDescription(message) + .withCause(e) + .asException() } -} \ No newline at end of file +} diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/utils/TimeUtils.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/utils/TimeUtils.kt new file mode 100644 index 000000000..78fd022fe --- /dev/null +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/utils/TimeUtils.kt @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2019 Bell Canada. + * + * 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. + */ +package org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api.utils + +import java.time.LocalDateTime +import java.time.ZoneId +import java.time.format.DateTimeFormatter + + +fun currentTimestamp(): String { + val now = LocalDateTime.now(ZoneId.systemDefault()) + val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") + return formatter.format(now) +} diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandlerTest.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandlerTest.kt index c870bf7f8..a48e699cb 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandlerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandlerTest.kt @@ -1,5 +1,6 @@ /* * Copyright © 2017-2018 AT&T Intellectual Property. + * Modifications Copyright © 2019 Bell Canada. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,30 +23,30 @@ import org.apache.commons.io.FileUtils import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith -import org.onap.ccsdk.apps.blueprintsprocessor.core.BluePrintCoreConfiguration +import org.onap.ccsdk.apps.controllerblueprints.management.api.BluePrintManagementInput import org.onap.ccsdk.apps.controllerblueprints.management.api.BluePrintManagementServiceGrpc -import org.onap.ccsdk.apps.controllerblueprints.management.api.BluePrintUploadInput import org.onap.ccsdk.apps.controllerblueprints.management.api.CommonHeader import org.onap.ccsdk.apps.controllerblueprints.management.api.FileChunk -import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired -import org.springframework.test.context.ContextConfiguration +import org.springframework.boot.autoconfigure.EnableAutoConfiguration +import org.springframework.context.annotation.ComponentScan +import org.springframework.test.annotation.DirtiesContext import org.springframework.test.context.TestPropertySource import org.springframework.test.context.junit4.SpringRunner import java.io.File import java.nio.file.Paths import kotlin.test.AfterTest import kotlin.test.BeforeTest -import kotlin.test.assertNotNull +import kotlin.test.assertEquals import kotlin.test.assertTrue @RunWith(SpringRunner::class) -@ContextConfiguration(classes = [BluePrintManagementGRPCHandler::class, BluePrintCoreConfiguration::class]) +@EnableAutoConfiguration +@DirtiesContext +@ComponentScan(basePackages = ["org.onap.ccsdk.apps.blueprintsprocessor", "org.onap.ccsdk.apps.controllerblueprints"]) @TestPropertySource(locations = ["classpath:application-test.properties"]) class BluePrintManagementGRPCHandlerTest { - private val log = LoggerFactory.getLogger(BluePrintProcessingGRPCHandlerTest::class.java)!! - @get:Rule val grpcServerRule = GrpcServerRule().directExecutor() @@ -64,29 +65,42 @@ class BluePrintManagementGRPCHandlerTest { } @Test - fun testFileUpload() { + fun `test upload blueprint`() { val blockingStub = BluePrintManagementServiceGrpc.newBlockingStub(grpcServerRule.channel) + val id = "123" + val output = blockingStub.uploadBlueprint(createInputRequest(id)) + assertEquals(200, output.status.code) + assertTrue(output.status.message.contains("Successfully uploaded blueprint sample:1.0.0 with id(")) + assertEquals(id, output.commonHeader.requestId) + } + @Test + fun `test delete blueprint`() { + val blockingStub = BluePrintManagementServiceGrpc.newBlockingStub(grpcServerRule.channel) + val id = "123" + val req = createInputRequest(id) + blockingStub.uploadBlueprint(req) + blockingStub.removeBlueprint(req) + } + + private fun createInputRequest(id: String): BluePrintManagementInput { val file = Paths.get("./src/test/resources/test-cba.zip").toFile() assertTrue(file.exists(), "couldnt get file ${file.absolutePath}") val commonHeader = CommonHeader.newBuilder() .setTimestamp("2012-04-23T18:25:43.511Z") .setOriginatorId("System") - .setRequestId("1234") + .setRequestId(id) .setSubRequestId("1234-56").build() val fileChunk = FileChunk.newBuilder().setChunk(ByteString.copyFrom(file.inputStream().readBytes())) .build() - val input = BluePrintUploadInput.newBuilder() + return BluePrintManagementInput.newBuilder() .setCommonHeader(commonHeader) .setBlueprintName("sample") .setBlueprintVersion("1.0.0") .setFileChunk(fileChunk) .build() - - val output = blockingStub.uploadBlueprint(input) - assertNotNull(output, "failed to get upload response") } } \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandlerTest.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandlerTest.kt index cd871b4a8..811bd953d 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandlerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandlerTest.kt @@ -1,5 +1,6 @@ /* * Copyright © 2017-2018 AT&T Intellectual Property. + * Modifications Copyright © 2019 Bell Canada. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,30 +23,26 @@ import io.grpc.testing.GrpcServerRule import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith -import org.onap.ccsdk.apps.blueprintsprocessor.core.BluePrintCoreConfiguration -import org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api.mock.MockBluePrintCatalogService -import org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api.mock.MockBlueprintDGExecutionService import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils import org.onap.ccsdk.apps.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc import org.onap.ccsdk.apps.controllerblueprints.processing.api.CommonHeader import org.onap.ccsdk.apps.controllerblueprints.processing.api.ExecutionServiceInput -import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired -import org.springframework.test.context.ContextConfiguration +import org.springframework.boot.autoconfigure.EnableAutoConfiguration +import org.springframework.context.annotation.ComponentScan +import org.springframework.test.annotation.DirtiesContext import org.springframework.test.context.TestPropertySource import org.springframework.test.context.junit4.SpringRunner import kotlin.test.BeforeTest import kotlin.test.assertNotNull @RunWith(SpringRunner::class) -@ContextConfiguration(classes = [BluePrintProcessingGRPCHandler::class, ExecutionServiceHandler::class, - MockBlueprintDGExecutionService::class, MockBluePrintCatalogService::class, - BluePrintCoreConfiguration::class]) +@DirtiesContext +@EnableAutoConfiguration +@ComponentScan(basePackages = ["org.onap.ccsdk.apps.blueprintsprocessor", "org.onap.ccsdk.apps.controllerblueprints"]) @TestPropertySource(locations = ["classpath:application-test.properties"]) class BluePrintProcessingGRPCHandlerTest { - private val log = LoggerFactory.getLogger(BluePrintProcessingGRPCHandlerTest::class.java)!! - @get:Rule val grpcServerRule = GrpcServerRule().directExecutor() diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandlerTest.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandlerTest.kt index e9e10307b..15e6ca946 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandlerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandlerTest.kt @@ -1,5 +1,6 @@ /* * Copyright © 2017-2018 AT&T Intellectual Property. + * Modifications Copyright © 2019 Bell Canada. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,35 +17,45 @@ package org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api +import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceInput -import org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api.mock.MockBluePrintCatalogService -import org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api.mock.MockBlueprintDGExecutionService -import org.onap.ccsdk.apps.controllerblueprints.core.utils.BluePrintMetadataUtils +import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintCatalogService import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils import org.springframework.beans.factory.annotation.Autowired -import org.springframework.test.context.ContextConfiguration +import org.springframework.boot.autoconfigure.EnableAutoConfiguration +import org.springframework.context.annotation.ComponentScan +import org.springframework.test.annotation.DirtiesContext +import org.springframework.test.context.TestPropertySource import org.springframework.test.context.junit4.SpringRunner +import java.nio.file.Paths +import kotlin.test.assertTrue +@Ignore @RunWith(SpringRunner::class) -@ContextConfiguration(classes = [MockBluePrintCatalogService::class, - MockBlueprintDGExecutionService::class, ExecutionServiceHandler::class]) +@DirtiesContext +@EnableAutoConfiguration +@ComponentScan(basePackages = ["org.onap.ccsdk.apps.blueprintsprocessor", "org.onap.ccsdk.apps.controllerblueprints"]) +@TestPropertySource(locations = ["classpath:application-test.properties"]) class ExecutionServiceHandlerTest { @Autowired lateinit var executionServiceHandler: ExecutionServiceHandler + @Autowired + lateinit var blueprintCatalog: BluePrintCatalogService + @Test fun testProcess() { - val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime("1234", - "./../../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration") + val file = Paths.get("./src/test/resources/test-cba.zip").toFile() + assertTrue(file.exists(), "couldnt get file ${file.absolutePath}") + + blueprintCatalog.saveToDatabase(file) val executionServiceInput = JacksonUtils.readValueFromClassPathFile("execution-input/default-input.json", ExecutionServiceInput::class.java)!! - executionServiceHandler.process(executionServiceInput) + executionServiceHandler.process(executionServiceInput) } -} - - +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/mock/SelfServiceApiMocks.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/mock/SelfServiceApiMocks.kt deleted file mode 100755 index e8f25a896..000000000 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/mock/SelfServiceApiMocks.kt +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * - * 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. - */ - -package org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api.mock - -import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceInput -import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceOutput -import org.onap.ccsdk.apps.blueprintsprocessor.services.workflow.BlueprintDGExecutionService -import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintCatalogService -import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRuntimeService -import org.springframework.stereotype.Service -import java.io.File -import java.nio.file.Path -import java.nio.file.Paths -import kotlin.test.assertNotNull - -@Service -class MockBlueprintDGExecutionService : BlueprintDGExecutionService { - override fun executeDirectedGraph(bluePrintRuntimeService: BluePrintRuntimeService<*>, executionServiceInput: ExecutionServiceInput): ExecutionServiceOutput { - - assertNotNull(executionServiceInput, "failed to get executionServiceInput") - - val executionServiceOutput = ExecutionServiceOutput() - executionServiceOutput.commonHeader = executionServiceInput.commonHeader - return executionServiceOutput - } -} - -@Service -class MockBluePrintCatalogService : BluePrintCatalogService { - override fun deleteFromDatabase(name: String, version: String) { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - - override fun saveToDatabase(blueprintFile: File, validate: Boolean): String { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - - override fun getFromDatabase(name: String, version: String, extract: Boolean): Path { - assertNotNull(name, "failed to get blueprint Name") - assertNotNull(version, "failed to get blueprint version") - return Paths.get("./../../../../../components/model-catalog/blueprint-model/starter-blueprint/baseconfiguration") - } -} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/application-test.properties b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/application-test.properties index edb51022f..8a26ee6ea 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/application-test.properties +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/resources/application-test.properties @@ -13,5 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. # +blueprintsprocessor.db.primary.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1 +blueprintsprocessor.db.primary.username=sa +blueprintsprocessor.db.primary.password= +blueprintsprocessor.db.primary.driverClassName=org.h2.Driver +blueprintsprocessor.db.primary.hibernateHbm2ddlAuto=create-drop +blueprintsprocessor.db.primary.hibernateDDLAuto=update +blueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy +blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.H2Dialect +# Controller Blueprints Core Configuration blueprintsprocessor.blueprintDeployPath=./target/blueprints/deploy blueprintsprocessor.blueprintArchivePath=./target/blueprints/archive +# executor +blueprints.processor.functions.python.executor.executionPath="./target/" -- cgit 1.2.3-korg From c96644c5d07d5634916db30f01c9ed5279791b38 Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Tue, 15 Jan 2019 16:17:17 -0500 Subject: Add support for async REST MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ieb53cbd75c2e21355b153611f6490c1b2af6053b Issue-ID: CCSDK-662 Signed-off-by: Alexis de Talhouët --- .../core/api/data/BlueprintProcessorData.kt | 196 ++++++++++----------- .../modules/inbounds/selfservice-api/pom.xml | 4 + .../selfservice/api/ExecutionServiceController.kt | 6 +- .../selfservice/api/ExecutionServiceHandler.kt | 42 +++++ 4 files changed, 145 insertions(+), 103 deletions(-) (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt index b0483dc3f..438e755cf 100644 --- a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt +++ b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt @@ -1,99 +1,97 @@ -/* - * Copyright © 2017-2018 AT&T Intellectual Property. - * Modifications Copyright © 2018 IBM. - * - * 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. - */ - -package org.onap.ccsdk.apps.blueprintsprocessor.core.api.data - -import com.fasterxml.jackson.annotation.JsonFormat -import com.fasterxml.jackson.databind.node.ObjectNode -import io.swagger.annotations.ApiModelProperty -import java.util.* - -/** - * BlueprintProcessorData - * @author Brinda Santh - * DATE : 8/15/2018 - */ - -open class ExecutionServiceInput { - @get:ApiModelProperty(required = true) - lateinit var commonHeader: CommonHeader - @get:ApiModelProperty(required = true) - lateinit var actionIdentifiers: ActionIdentifiers - @get:ApiModelProperty(required = true) - lateinit var payload: ObjectNode -} - -open class ExecutionServiceOutput { - @get:ApiModelProperty(required = true) - lateinit var commonHeader: CommonHeader - @get:ApiModelProperty(required = true) - lateinit var actionIdentifiers: ActionIdentifiers - @get:ApiModelProperty(required = true) - var status: Status = Status() - @get:ApiModelProperty(required = true) - lateinit var payload: ObjectNode -} - -open class ActionIdentifiers { - @get:ApiModelProperty(required = false) - lateinit var blueprintName: String - @get:ApiModelProperty(required = false) - lateinit var blueprintVersion: String - @get:ApiModelProperty(required = true) - lateinit var actionName: String - @get:ApiModelProperty(required = true, allowableValues = "sync, async") - lateinit var mode: String -} - -open class CommonHeader { - @get:ApiModelProperty(required = true, example = "2012-04-23T18:25:43.511Z") - @get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") - var timestamp: Date = Date() - @get:ApiModelProperty(required = true) - lateinit var originatorId: String - @get:ApiModelProperty(required = true) - lateinit var requestId: String - @get:ApiModelProperty(required = true) - lateinit var subRequestId: String - @get:ApiModelProperty(required = false) - var flags: Flags? = null -} - -open class Flags { - var isForce: Boolean = false - @get:ApiModelProperty(value = "3600") - var ttl: Int = 3600 -} - -open class Status { - @get:ApiModelProperty(required = true) - var code: Int = 200 - @get:ApiModelProperty(required = true) - var eventType: String = "EVENT-ACTION-RESPONSE" - @get:ApiModelProperty(required = true, example = "2012-04-23T18:25:43.511Z") - @get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") - var timestamp: Date = Date() - @get:ApiModelProperty(required = false) - var errorMessage: String? = null - @get:ApiModelProperty(required = true) - var message: String = "success" -} - - - - - +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * Modifications Copyright © 2018 IBM. + * + * 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. + */ + +package org.onap.ccsdk.apps.blueprintsprocessor.core.api.data + +import com.fasterxml.jackson.annotation.JsonFormat +import com.fasterxml.jackson.databind.node.ObjectNode +import io.swagger.annotations.ApiModelProperty +import java.util.* + +/** + * BlueprintProcessorData + * @author Brinda Santh + * DATE : 8/15/2018 + */ + +open class ExecutionServiceInput { + @get:ApiModelProperty(required = true) + lateinit var commonHeader: CommonHeader + @get:ApiModelProperty(required = true) + lateinit var actionIdentifiers: ActionIdentifiers + @get:ApiModelProperty(required = true) + lateinit var payload: ObjectNode +} + +open class ExecutionServiceOutput { + @get:ApiModelProperty(required = true) + lateinit var commonHeader: CommonHeader + @get:ApiModelProperty(required = true) + lateinit var actionIdentifiers: ActionIdentifiers + @get:ApiModelProperty(required = true) + var status: Status = Status() + @get:ApiModelProperty(required = true) + lateinit var payload: ObjectNode +} + +const val ACTION_MODE_ASYNC = "async" +const val ACTION_MODE_SYNC = "sync" + +open class ActionIdentifiers { + @get:ApiModelProperty(required = false) + lateinit var blueprintName: String + @get:ApiModelProperty(required = false) + lateinit var blueprintVersion: String + @get:ApiModelProperty(required = true) + lateinit var actionName: String + @get:ApiModelProperty(required = true, allowableValues = "sync, async") + lateinit var mode: String +} + +open class CommonHeader { + @get:ApiModelProperty(required = true, example = "2012-04-23T18:25:43.511Z") + @get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") + var timestamp: Date = Date() + @get:ApiModelProperty(required = true) + lateinit var originatorId: String + @get:ApiModelProperty(required = true) + lateinit var requestId: String + @get:ApiModelProperty(required = true) + lateinit var subRequestId: String + @get:ApiModelProperty(required = false) + var flags: Flags? = null +} + +open class Flags { + var isForce: Boolean = false + @get:ApiModelProperty(value = "3600") + var ttl: Int = 3600 +} + +open class Status { + @get:ApiModelProperty(required = true) + var code: Int = 200 + @get:ApiModelProperty(required = true) + var eventType: String = "EVENT-ACTION-RESPONSE" + @get:ApiModelProperty(required = true, example = "2012-04-23T18:25:43.511Z") + @get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") + var timestamp: Date = Date() + @get:ApiModelProperty(required = false) + var errorMessage: String? = null + @get:ApiModelProperty(required = true) + var message: String = "success" +} diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml index 7041dab3c..5562df62c 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -28,6 +28,10 @@ Blueprints Processor Selfservice API + + org.jetbrains.kotlinx + kotlinx-coroutines-core + io.grpc grpc-testing diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt index 35d4e67c5..e4734c441 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt @@ -38,7 +38,6 @@ class ExecutionServiceController { @Autowired lateinit var executionServiceHandler: ExecutionServiceHandler - @RequestMapping(path = ["/ping"], method = [RequestMethod.GET], produces = [MediaType.APPLICATION_JSON_VALUE]) @ResponseBody fun ping(): Mono { @@ -58,8 +57,7 @@ class ExecutionServiceController { @RequestMapping(path = ["/process"], method = [RequestMethod.POST], produces = [MediaType.APPLICATION_JSON_VALUE]) @ApiOperation(value = "Resolve Resource Mappings", notes = "Takes the blueprint information and process as per the payload") @ResponseBody - fun process(@RequestBody executionServiceInput: ExecutionServiceInput): Mono { - val executionServiceOutput = executionServiceHandler.process(executionServiceInput) - return Mono.just(executionServiceOutput) + fun process(@RequestBody executionServiceInput: ExecutionServiceInput): ExecutionServiceOutput { + return executionServiceHandler.process(executionServiceInput) } } diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt index 56903745d..0b361d8ae 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandler.kt @@ -16,11 +16,18 @@ package org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.GlobalScope +import kotlinx.coroutines.launch import org.onap.ccsdk.apps.blueprintsprocessor.core.BluePrintCoreConfiguration +import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ACTION_MODE_ASYNC +import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ACTION_MODE_SYNC import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceOutput +import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.Status import org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api.utils.saveCBAFile import org.onap.ccsdk.apps.blueprintsprocessor.services.workflow.BlueprintDGExecutionService +import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintCatalogService import org.onap.ccsdk.apps.controllerblueprints.core.utils.BluePrintFileUtils @@ -50,7 +57,20 @@ class ExecutionServiceHandler(private val bluePrintCoreConfiguration: BluePrintC } fun process(executionServiceInput: ExecutionServiceInput): ExecutionServiceOutput { + return when { + executionServiceInput.actionIdentifiers.mode == ACTION_MODE_ASYNC -> { + GlobalScope.launch(Dispatchers.Default) { + // TODO post result in DMaaP + val executionServiceOutput = doProcess(executionServiceInput) + } + response(executionServiceInput) + } + executionServiceInput.actionIdentifiers.mode == ACTION_MODE_SYNC -> doProcess(executionServiceInput) + else -> response(executionServiceInput, true) + } + } + fun doProcess(executionServiceInput: ExecutionServiceInput): ExecutionServiceOutput { val requestId = executionServiceInput.commonHeader.requestId log.info("processing request id $requestId") @@ -66,4 +86,26 @@ class ExecutionServiceHandler(private val bluePrintCoreConfiguration: BluePrintC return blueprintDGExecutionService.executeDirectedGraph(blueprintRuntimeService, executionServiceInput) } + + fun response(executionServiceInput: ExecutionServiceInput, failure: Boolean = false): ExecutionServiceOutput { + val executionServiceOutput = ExecutionServiceOutput() + executionServiceOutput.commonHeader = executionServiceInput.commonHeader + executionServiceOutput.actionIdentifiers = executionServiceInput.actionIdentifiers + executionServiceOutput.payload = executionServiceInput.payload + + val status = Status() + if (failure) { + status.eventType = "EVENT-COMPONENT-FAILURE" + status.code = 500 + status.message = BluePrintConstants.STATUS_FAILURE + } else { + status.eventType = "EVENT-COMPONENT-PROCESSING" + status.code = 200 + status.message = BluePrintConstants.STATUS_PROCESSING + } + + executionServiceOutput.status = status + + return executionServiceOutput + } } \ No newline at end of file -- cgit 1.2.3-korg From 6d3652c55ee0c0ab9f0dd7571d4d824ac6ab1963 Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Fri, 18 Jan 2019 14:29:38 -0500 Subject: Create module for .proto definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That way 3rd party system can depend on it to create a client Change-Id: I96e8588251eb0911a7dd7bee270954e966d9fc40 Issue-ID: CCSDK-947 Signed-off-by: Alexis de Talhouët --- .../modules/inbounds/selfservice-api/pom.xml | 43 +++------------------- 1 file changed, 5 insertions(+), 38 deletions(-) (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml index 5562df62c..c510734da 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -14,7 +14,8 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor @@ -29,8 +30,9 @@ - org.jetbrains.kotlinx - kotlinx-coroutines-core + org.onap.ccsdk.apps.controllerblueprints + proto-definition + ${project.version} io.grpc @@ -43,39 +45,4 @@ - - - - kr.motd.maven - os-maven-plugin - 1.6.1 - - - - - org.xolstice.maven.plugins - protobuf-maven-plugin - 0.6.1 - - - com.google.protobuf:protoc:3.5.1-1:exe:${os.detected.classifier} - - grpc-java - - io.grpc:protoc-gen-grpc-java:1.16.1:exe:${os.detected.classifier} - - ./../../../../../components/model-catalog/api-definition - - - - - compile - compile-custom - - - - - - - -- cgit 1.2.3-korg From a5f9b6f46959a3686e47c361340a8238b358eccb Mon Sep 17 00:00:00 2001 From: Steve Alphonse Siani Date: Mon, 21 Jan 2019 11:55:48 -0500 Subject: ControllerBlueprint blueprintsProcessor container Change-Id: I77df77757c276fca705091c1566c386f842269c4 Issue-ID: CCSDK-949 Signed-off-by: Steve Alphonse Siani --- ms/blueprintsprocessor/application/etc/logback.xml | 36 ++++ ms/blueprintsprocessor/application/etc/run.source | 12 ++ .../opt/app/onap/config/application.properties | 36 ++++ .../application/opt/app/onap/config/logback.xml | 36 ++++ ms/blueprintsprocessor/application/pom.xml | 85 ++++++++- .../src/main/resources/application-dev.properties | 36 ++++ .../src/main/resources/application.properties | 7 +- .../src/test/resources/application.properties | 2 + ms/blueprintsprocessor/distribution/pom.xml | 196 +++++++++++++++++++++ .../distribution/src/main/dc/docker-compose.yaml | 33 ++++ .../distribution/src/main/docker/Dockerfile | 20 +++ .../distribution/src/main/docker/distribution.xml | 69 ++++++++ .../distribution/src/main/docker/startService.sh | 9 + ms/blueprintsprocessor/functions/pom.xml | 0 .../modules/commons/db-lib/pom.xml | 4 + ms/blueprintsprocessor/modules/commons/pom.xml | 2 + .../modules/commons/rest-lib/pom.xml | 4 + .../modules/inbounds/resource-api/pom.xml | 20 +-- .../modules/inbounds/selfservice-api/pom.xml | 7 + ms/blueprintsprocessor/modules/outbounds/pom.xml | 20 +-- .../modules/services/execution-service/pom.xml | 4 + ms/blueprintsprocessor/modules/services/pom.xml | 2 + .../modules/services/workflow-service/pom.xml | 4 + ms/blueprintsprocessor/parent/pom.xml | 11 ++ ms/blueprintsprocessor/pom.xml | 56 +++--- 25 files changed, 662 insertions(+), 49 deletions(-) create mode 100755 ms/blueprintsprocessor/application/etc/logback.xml create mode 100755 ms/blueprintsprocessor/application/etc/run.source create mode 100755 ms/blueprintsprocessor/application/opt/app/onap/config/application.properties create mode 100755 ms/blueprintsprocessor/application/opt/app/onap/config/logback.xml mode change 100644 => 100755 ms/blueprintsprocessor/application/pom.xml create mode 100755 ms/blueprintsprocessor/application/src/main/resources/application-dev.properties mode change 100644 => 100755 ms/blueprintsprocessor/application/src/main/resources/application.properties create mode 100755 ms/blueprintsprocessor/distribution/pom.xml create mode 100755 ms/blueprintsprocessor/distribution/src/main/dc/docker-compose.yaml create mode 100755 ms/blueprintsprocessor/distribution/src/main/docker/Dockerfile create mode 100755 ms/blueprintsprocessor/distribution/src/main/docker/distribution.xml create mode 100755 ms/blueprintsprocessor/distribution/src/main/docker/startService.sh mode change 100644 => 100755 ms/blueprintsprocessor/functions/pom.xml mode change 100644 => 100755 ms/blueprintsprocessor/modules/commons/pom.xml mode change 100644 => 100755 ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml mode change 100644 => 100755 ms/blueprintsprocessor/modules/services/pom.xml mode change 100644 => 100755 ms/blueprintsprocessor/parent/pom.xml mode change 100644 => 100755 ms/blueprintsprocessor/pom.xml (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/application/etc/logback.xml b/ms/blueprintsprocessor/application/etc/logback.xml new file mode 100755 index 000000000..a97bb8c3d --- /dev/null +++ b/ms/blueprintsprocessor/application/etc/logback.xml @@ -0,0 +1,36 @@ + + + + + + + %d{HH:mm:ss.SSS} %-5level %logger{100} - %msg%n + + + + + + + + + + + + + + diff --git a/ms/blueprintsprocessor/application/etc/run.source b/ms/blueprintsprocessor/application/etc/run.source new file mode 100755 index 000000000..7557ab126 --- /dev/null +++ b/ms/blueprintsprocessor/application/etc/run.source @@ -0,0 +1,12 @@ +java -classpath "/etc:${APP_HOME}/lib/*:/lib/*:/src:/schema:/generated-sources:${APP_CONFIG_HOME}:${APP_HOME}" \ +-DappName=${APPLICATIONNAME} -DappVersion=${BUNDLEVERSION} \ +-DrouteOffer=${ROUTEOFFER} \ +-DVERSION_ROUTEOFFER_ENVCONTEXT=${BUNDLEVERSION}/${STICKYSELECTORKEY}/${ENVCONTEXT} \ +-DSecurityFilePath=/etc \ +-DREST_NAME_NORMALIZER_PATTERN_FILE=/etc/PatternInputs.txt \ +-Dms_name=org.onap.ccsdk.apps.blueprintsprocessor \ +-Dlogging.config=${APP_CONFIG_HOME}/logback.xml \ +-Djava.security.egd=file:/dev/./urandom \ +-DAPPNAME=${APP_NAME} -DAPPENV=${APP_ENV} -DAPPVERSION=${APP_VERSION} -DNAMESPACE=${NAMESPACE} \ +-Dspring.config.location=${APP_CONFIG_HOME}/ \ +org.onap.ccsdk.apps.blueprintsprocessor.BlueprintProcessorApplication diff --git a/ms/blueprintsprocessor/application/opt/app/onap/config/application.properties b/ms/blueprintsprocessor/application/opt/app/onap/config/application.properties new file mode 100755 index 000000000..c4880b676 --- /dev/null +++ b/ms/blueprintsprocessor/application/opt/app/onap/config/application.properties @@ -0,0 +1,36 @@ +# +# Copyright � 2017-2018 AT&T Intellectual Property. +# Modifications Copyright © 2019 Bell Canada. +# +# 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. +# +#logging.level.web=DEBUG + +# Web server config +server.port=8080 + +blueprintsprocessor.grpcEnable=false +blueprintsprocessor.httpPort=8080 +blueprintsprocessor.grpcPort=9111 +# Blueprint Processor File Execution and Handling Properties +blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy +blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive +# Primary Database Configuration +blueprintsprocessor.db.primary.url=jdbc:mysql://db:3306/sdnctl +blueprintsprocessor.db.primary.username=sdnctl +blueprintsprocessor.db.primary.password=sdnctl +blueprintsprocessor.db.primary.driverClassName=org.mariadb.jdbc.Driver +blueprintsprocessor.db.primary.hibernateHbm2ddlAuto=validate +blueprintsprocessor.db.primary.hibernateDDLAuto=none +blueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy +blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.MySQL5InnoDBDialect \ No newline at end of file diff --git a/ms/blueprintsprocessor/application/opt/app/onap/config/logback.xml b/ms/blueprintsprocessor/application/opt/app/onap/config/logback.xml new file mode 100755 index 000000000..a97bb8c3d --- /dev/null +++ b/ms/blueprintsprocessor/application/opt/app/onap/config/logback.xml @@ -0,0 +1,36 @@ + + + + + + + %d{HH:mm:ss.SSS} %-5level %logger{100} - %msg%n + + + + + + + + + + + + + + diff --git a/ms/blueprintsprocessor/application/pom.xml b/ms/blueprintsprocessor/application/pom.xml old mode 100644 new mode 100755 index 679a8b909..06752b793 --- a/ms/blueprintsprocessor/application/pom.xml +++ b/ms/blueprintsprocessor/application/pom.xml @@ -3,6 +3,7 @@ ~ Copyright © 2017-2018 AT&T Intellectual Property. ~ ~ Modifications Copyright © 2018 IBM. + ~ Modifications Copyright © 2019 Bell Canada. ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. @@ -30,6 +31,10 @@ Blueprints Processor Application + + org.onap.ccsdk.apps.controllerblueprints + core + org.springframework.boot spring-boot-devtools @@ -69,13 +74,91 @@ test - + + + + ${basedir}/etc + ${basedir}/target/etc + true + + **/* + + + + + ${basedir}/src/main/resources + ${basedir}/target/src/main/resources + true + + **/* + + + + src/main/resources + + **/* + + true + + org.springframework.boot spring-boot-maven-plugin + + maven-resources-plugin + 2.6 + + + copy-dockerfile + + copy-resources + + validate + + ${basedir}/target/docker-stage + + + src/main/docker + + * + + true + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + ant-test + package + + + + + + + run + + + + + + maven-compiler-plugin + 3.1 + + + 1.8 + 1.8 + + diff --git a/ms/blueprintsprocessor/application/src/main/resources/application-dev.properties b/ms/blueprintsprocessor/application/src/main/resources/application-dev.properties new file mode 100755 index 000000000..6bfa2407b --- /dev/null +++ b/ms/blueprintsprocessor/application/src/main/resources/application-dev.properties @@ -0,0 +1,36 @@ +# +# Copyright � 2017-2018 AT&T Intellectual Property. +# Modifications Copyright © 2019 IBM, Bell Canada. +# +# 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. +# +#logging.level.web=DEBUG + +# Web server config +server.port=8080 + +blueprintsprocessor.grpcEnable=false +blueprintsprocessor.httpPort=8080 +blueprintsprocessor.grpcPort=9111 +# Blueprint Processor File Execution and Handling Properties +blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy +blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive +# Primary Database Configuration +blueprintsprocessor.db.primary.url=jdbc:mysql://localhost:3306/sdnctl +blueprintsprocessor.db.primary.username=sdnctl +blueprintsprocessor.db.primary.password=sdnctl +blueprintsprocessor.db.primary.driverClassName=org.mariadb.jdbc.Driver +blueprintsprocessor.db.primary.hibernateHbm2ddlAuto=update +blueprintsprocessor.db.primary.hibernateDDLAuto=none +blueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy +blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.MySQL5InnoDBDialect \ No newline at end of file diff --git a/ms/blueprintsprocessor/application/src/main/resources/application.properties b/ms/blueprintsprocessor/application/src/main/resources/application.properties old mode 100644 new mode 100755 index fa1a1e6e4..62695207b --- a/ms/blueprintsprocessor/application/src/main/resources/application.properties +++ b/ms/blueprintsprocessor/application/src/main/resources/application.properties @@ -1,5 +1,6 @@ # # Copyright � 2017-2018 AT&T Intellectual Property. +# Modifications Copyright © 2019 IBM, Bell Canada. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,6 +15,10 @@ # limitations under the License. # #logging.level.web=DEBUG + +# Web server config +server.port=8080 + blueprintsprocessor.grpcEnable=false blueprintsprocessor.httpPort=8080 blueprintsprocessor.grpcPort=9111 @@ -21,7 +26,7 @@ blueprintsprocessor.grpcPort=9111 blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive # Primary Database Configuration -blueprintsprocessor.db.primary.url=jdbc:mysql://localhost:3306/sdnctl +blueprintsprocessor.db.primary.url=jdbc:mysql://db:3306/sdnctl blueprintsprocessor.db.primary.username=sdnctl blueprintsprocessor.db.primary.password=sdnctl blueprintsprocessor.db.primary.driverClassName=org.mariadb.jdbc.Driver diff --git a/ms/blueprintsprocessor/application/src/test/resources/application.properties b/ms/blueprintsprocessor/application/src/test/resources/application.properties index f896ee058..d21264c0d 100644 --- a/ms/blueprintsprocessor/application/src/test/resources/application.properties +++ b/ms/blueprintsprocessor/application/src/test/resources/application.properties @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# Web server config +server.port=8080 # Blueprint Processor File Execution and Handling Properties blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive diff --git a/ms/blueprintsprocessor/distribution/pom.xml b/ms/blueprintsprocessor/distribution/pom.xml new file mode 100755 index 000000000..fb5e3c128 --- /dev/null +++ b/ms/blueprintsprocessor/distribution/pom.xml @@ -0,0 +1,196 @@ + + + + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + parent + 0.4.1-SNAPSHOT + ../parent + + distribution + pom + Blueprints Processor Distribution + + maven + org.onap.ccsdk.apps + blueprintsprocessor + onap/ccsdk-blueprintsprocessor + ${https_proxy} + deploy + true + + + + + org.onap.ccsdk.apps.blueprintsprocessor + application + + + + + + maven-resources-plugin + 2.6 + + + copy-dockerfile + + copy-resources + + validate + + ${basedir}/target/docker-stage + + + src/main/docker + + * + + true + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + ant-test + package + + + + + + + run + + + + + + + maven-assembly-plugin + 3.1.0 + + + ${basedir}/target/docker-stage + + src/main/docker/distribution.xml + + posix + + + + ${assembly.id} + package + + single + + + + + + org.codehaus.groovy.maven + gmaven-plugin + 1.0 + + + validate + + execute + + + + println project.properties['ccsdk.project.version'] + def versionArray + if (project.properties['ccsdk.project.version'] != null ) { + versionArray = project.properties['ccsdk.project.version'].split('\\.') + } + + if (project.properties['ccsdk.project.version'].endsWith("-SNAPSHOT")) + { + project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest" + } else { + project.properties['project.docker.latesttag.version']=versionArray[0]+'.' + versionArray[1]+"-STAGING-latest" + } + + println 'New Tag for docker:' + project.properties['project.docker.latesttag.version'] + + + + + + + + + + + + docker + + + + io.fabric8 + docker-maven-plugin + 0.26.1 + false + + + + ${image.name} + + try + ${basedir}/target/docker-stage + + ${project.version} + ${project.version}-STAGING-${maven.build.timestamp} + ${project.docker.latesttag.version} + + + + + true + + + + generate-images + package + + build + + + + push-images + ${docker.push.phase} + + build + push + + + + + + + + + + \ No newline at end of file diff --git a/ms/blueprintsprocessor/distribution/src/main/dc/docker-compose.yaml b/ms/blueprintsprocessor/distribution/src/main/dc/docker-compose.yaml new file mode 100755 index 000000000..c0eade509 --- /dev/null +++ b/ms/blueprintsprocessor/distribution/src/main/dc/docker-compose.yaml @@ -0,0 +1,33 @@ +version: '3.3' + +services: + db: + image: mariadb:latest + container_name: ccsdk-mariadb + ports: + - "3306:3306" + volumes: + - ~/vm_mysql:/var/lib/mysql + restart: always + environment: + MYSQL_ROOT_PASSWORD: sdnctl + MYSQL_DATABASE: sdnctl + MYSQL_USER: sdnctl + MYSQL_PASSWORD: sdnctl + blueprints-processor: + depends_on: + - db + image: onap/ccsdk-blueprintsprocessor:latest + container_name: bp-rest + ports: + - "8000:8080" + restart: always + volumes: + - ~/share/vm_ms/blueprintsprocessor/config:/opt/app/onap/config + - ~/share/vm_ms/blueprintsprocessor/logs:/logs + environment: + APPLICATIONNAME: BlueprintsProcessor + BUNDLEVERSION: 1.0.0 + APP_CONFIG_HOME: /opt/app/onap/config + STICKYSELECTORKEY: + ENVCONTEXT: dev \ No newline at end of file diff --git a/ms/blueprintsprocessor/distribution/src/main/docker/Dockerfile b/ms/blueprintsprocessor/distribution/src/main/docker/Dockerfile new file mode 100755 index 000000000..213623299 --- /dev/null +++ b/ms/blueprintsprocessor/distribution/src/main/docker/Dockerfile @@ -0,0 +1,20 @@ +FROM anapsix/alpine-java:8_jdk + +ENV HTTP_PROXY ${HTTP_PROXY} +ENV HTTPS_PROXY ${HTTPS_PROXY} + +RUN apk add --no-cache curl + +COPY startService.sh /startService.sh +RUN chmod 777 /startService.sh && dos2unix /startService.sh + +COPY @project.build.finalName@-@assembly.id@.tar.gz /source.tar.gz + +RUN (mkdir -p /source /opt/app/onap) && (tar -xzf /source.tar.gz -C /source) \ +&& (mv /source/@project.build.finalName@ /source/app) \ +&& (cp -rf /source/app/opt/app/onap/lib /opt/app/onap/) \ +&& (cp -rf /source/app/etc /) \ +&& (cp -rf /source/app/config /) \ +&& (rm -rf /source) + +ENTRYPOINT /startService.sh \ No newline at end of file diff --git a/ms/blueprintsprocessor/distribution/src/main/docker/distribution.xml b/ms/blueprintsprocessor/distribution/src/main/docker/distribution.xml new file mode 100755 index 000000000..b538b73bb --- /dev/null +++ b/ms/blueprintsprocessor/distribution/src/main/docker/distribution.xml @@ -0,0 +1,69 @@ + + + + + + ${assembly.id} + + tar.gz + + + + /opt/app/onap/lib + ${artifact.groupId}-${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension} + + + + + + + ${project.basedir}/../application/src/main/resources + + application.properties + logback.xml + + ./ + true + + + ${project.basedir}/src/main/docker + + Dockerfile + startService.sh + + ./ + true + + + ${project.basedir}/../application/src/main/resources + src/main/resources + true + + + ${project.basedir}/../application/opt/app/onap/config + ./config + true + + + ${project.basedir}/../application/etc + ./etc + true + + + \ No newline at end of file diff --git a/ms/blueprintsprocessor/distribution/src/main/docker/startService.sh b/ms/blueprintsprocessor/distribution/src/main/docker/startService.sh new file mode 100755 index 000000000..79bcbc064 --- /dev/null +++ b/ms/blueprintsprocessor/distribution/src/main/docker/startService.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +nodeName=BlueprintsProcessor_1.0.0_$(cat /proc/self/cgroup | grep docker | sed s/\\//\\n/g | tail -1) + +echo "APP Config HOME : ${APP_CONFIG_HOME}" +export APP_HOME=/opt/app/onap + +cp -rf /config /opt/app/onap/ +source /etc/run.source diff --git a/ms/blueprintsprocessor/functions/pom.xml b/ms/blueprintsprocessor/functions/pom.xml old mode 100644 new mode 100755 diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml index 53c9b185f..590c87f0f 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml @@ -28,6 +28,10 @@ Blueprints Processor DB Lib + + org.onap.ccsdk.apps.controllerblueprints + core + org.onap.ccsdk.apps.controllerblueprints db-resources diff --git a/ms/blueprintsprocessor/modules/commons/pom.xml b/ms/blueprintsprocessor/modules/commons/pom.xml old mode 100644 new mode 100755 index 4df89857e..8d900a895 --- a/ms/blueprintsprocessor/modules/commons/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/pom.xml @@ -2,6 +2,8 @@ - 4.0.0 - - org.onap.ccsdk.apps.blueprintsprocessor - inbounds - 0.4.1-SNAPSHOT - + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + inbounds + 0.4.1-SNAPSHOT + - resource-api - jar - Blueprints Processor Resource API - Blueprints Processor Resource API + resource-api + jar + Blueprints Processor Resource API + Blueprints Processor Resource API diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml old mode 100644 new mode 100755 index c510734da..a15632b7a --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -2,6 +2,8 @@ - 4.0.0 - - org.onap.ccsdk.apps.blueprintsprocessor - modules - 0.4.1-SNAPSHOT - + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + modules + 0.4.1-SNAPSHOT + - outbounds - pom - Blueprints Processor Outbounds POM - Blueprints Processor Outbounds + outbounds + pom + Blueprints Processor Outbounds POM + Blueprints Processor Outbounds diff --git a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml index 035f14d90..96bb09f2f 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml @@ -28,6 +28,10 @@ Blueprints Processor Execution Service + + org.onap.ccsdk.apps.controllerblueprints + core + org.onap.ccsdk.apps.blueprintsprocessor core diff --git a/ms/blueprintsprocessor/modules/services/pom.xml b/ms/blueprintsprocessor/modules/services/pom.xml old mode 100644 new mode 100755 index 8cb3c6f1d..469899d04 --- a/ms/blueprintsprocessor/modules/services/pom.xml +++ b/ms/blueprintsprocessor/modules/services/pom.xml @@ -2,6 +2,8 @@ + + org.onap.ccsdk.apps.blueprintsprocessor + application + ${project.version} + org.onap.ccsdk.apps.blueprintsprocessor db-lib @@ -304,6 +310,11 @@ resource-dict ${project.version} + + org.onap.ccsdk.apps.controllerblueprints + core + ${project.version} + diff --git a/ms/blueprintsprocessor/pom.xml b/ms/blueprintsprocessor/pom.xml old mode 100644 new mode 100755 index df4932cd8..774e177e0 --- a/ms/blueprintsprocessor/pom.xml +++ b/ms/blueprintsprocessor/pom.xml @@ -1,6 +1,7 @@ - 4.0.0 - - org.onap.ccsdk.apps - ccsdk-apps-ms - 0.4.1-SNAPSHOT - - blueprintsprocessor - pom - Blueprints Processor Root - Blueprints Processor Root + 4.0.0 + + org.onap.ccsdk.apps + ccsdk-apps-ms + 0.4.1-SNAPSHOT + + blueprintsprocessor + pom + Blueprints Processor Root + Blueprints Processor Root - - BlueprintsProcessor - UTF-8 - UTF-8 - yyyyMMdd'T'HHmmss'Z' - ${maven.build.timestamp} - 1.8 - 1.8 - 1.8 - ${project.version} - + + BlueprintsProcessor + UTF-8 + UTF-8 + yyyyMMdd'T'HHmmss'Z' + ${maven.build.timestamp} + 1.8 + 1.8 + 1.8 + ${project.version} + - - parent - modules - functions - application - + + parent + modules + functions + application + distribution + -- cgit 1.2.3-korg From 890002174644c0a471a2eafb3e5c4e4b179f0cb5 Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Fri, 25 Jan 2019 09:46:28 -0500 Subject: Fix wrong groupId MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://gerrit.onap.org/r/#/c/76291/ changed the groupId, forget to update dependent artifacts. Change-Id: I808b7df2fc0032bdb12d7c3a50200de3e9733821 Issue-ID: CCSDK-1001 Signed-off-by: Alexis de Talhouët --- ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml index c510734da..c4aa08df0 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -30,7 +30,7 @@ - org.onap.ccsdk.apps.controllerblueprints + org.onap.ccsdk.apps.components proto-definition ${project.version} -- cgit 1.2.3-korg From 2ecd4e75058a2f7623ba07a6b66391972ae99981 Mon Sep 17 00:00:00 2001 From: "Muthuramalingam, Brinda Santh" Date: Thu, 7 Feb 2019 14:51:50 -0500 Subject: Refactor components core and resource dict modules Change-Id: I04e9e723d68a38ecefe48206e67fddbe43c55854 Issue-ID: CCSDK-1047 Signed-off-by: Muthuramalingam, Brinda Santh --- ms/blueprintsprocessor/application/pom.xml | 2 +- .../functions/python/executor/ComponentJythonExecutorTest.kt | 3 --- ms/blueprintsprocessor/modules/commons/db-lib/pom.xml | 3 ++- ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml | 3 ++- ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml | 3 ++- ms/blueprintsprocessor/modules/services/execution-service/pom.xml | 3 ++- ms/blueprintsprocessor/modules/services/workflow-service/pom.xml | 3 ++- ms/blueprintsprocessor/parent/pom.xml | 2 +- 8 files changed, 12 insertions(+), 10 deletions(-) (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/application/pom.xml b/ms/blueprintsprocessor/application/pom.xml index 06752b793..9ad2ccbf1 100755 --- a/ms/blueprintsprocessor/application/pom.xml +++ b/ms/blueprintsprocessor/application/pom.xml @@ -33,7 +33,7 @@ org.onap.ccsdk.apps.controllerblueprints - core + blueprint-core org.springframework.boot diff --git a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentJythonExecutorTest.kt b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentJythonExecutorTest.kt index 83cf59c29..96d683cc1 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentJythonExecutorTest.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/functions/python/executor/ComponentJythonExecutorTest.kt @@ -17,11 +17,8 @@ package org.onap.ccsdk.apps.blueprintsprocessor.functions.python.executor import com.fasterxml.jackson.databind.JsonNode -import com.fasterxml.jackson.databind.node.JsonNodeFactory import org.junit.Test import org.junit.runner.RunWith -import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ActionIdentifiers -import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.CommonHeader import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceInput import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants import org.onap.ccsdk.apps.controllerblueprints.core.asJsonNode diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml index 590c87f0f..7c5aecb7a 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml @@ -1,6 +1,7 @@ -- cgit 1.2.3-korg From e4a1f83b13426ce7878e451fe864f9571424d1a7 Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Mon, 4 Mar 2019 21:37:27 -0500 Subject: Add gRPC & REST basic auth support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iaa187a8288a9c84aa80b596a14e66de10a9b7501 Issue-ID: CCSDK-1055 Signed-off-by: Alexis de Talhouët --- ms/blueprintsprocessor/application/pom.xml | 8 +- .../blueprintsprocessor/BlueprintGRPCServer.java | 13 +-- .../blueprintsprocessor/BlueprintHttpServer.java | 8 +- .../BlueprintProcessorApplication.java | 5 +- .../ccsdk/apps/blueprintsprocessor/WebConfig.java | 47 +++++++++-- .../security/AuthenticationManager.java | 40 +++++++++ .../security/BasicAuthServerInterceptor.java | 97 ++++++++++++++++++++++ .../security/SecurityConfiguration.java | 59 +++++++++++++ .../security/SecurityContextRepository.java | 75 +++++++++++++++++ .../src/main/resources/application.properties | 3 + .../src/test/resources/application.properties | 6 ++ .../modules/inbounds/selfservice-api/pom.xml | 6 ++ .../api/BluePrintManagementGRPCHandler.kt | 5 +- .../api/BluePrintProcessingGRPCHandler.kt | 4 +- .../selfservice/api/ExecutionServiceController.kt | 5 +- .../selfservice/api/ExecutionServiceHandlerTest.kt | 3 +- 16 files changed, 358 insertions(+), 26 deletions(-) create mode 100644 ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/security/AuthenticationManager.java create mode 100644 ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/security/BasicAuthServerInterceptor.java create mode 100644 ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/security/SecurityConfiguration.java create mode 100644 ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/security/SecurityContextRepository.java (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/application/pom.xml b/ms/blueprintsprocessor/application/pom.xml index 83dc7061f..f42cdfade 100755 --- a/ms/blueprintsprocessor/application/pom.xml +++ b/ms/blueprintsprocessor/application/pom.xml @@ -17,7 +17,8 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor @@ -40,6 +41,11 @@ spring-boot-devtools runtime + + org.springframework.boot + spring-boot-starter-security + + org.onap.ccsdk.apps.blueprintsprocessor diff --git a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintGRPCServer.java b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintGRPCServer.java index 86fdccd4b..3ac1a6e62 100644 --- a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintGRPCServer.java +++ b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintGRPCServer.java @@ -18,6 +18,7 @@ package org.onap.ccsdk.apps.blueprintsprocessor; import io.grpc.Server; import io.grpc.ServerBuilder; +import org.onap.ccsdk.apps.blueprintsprocessor.security.BasicAuthServerInterceptor; import org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api.BluePrintManagementGRPCHandler; import org.onap.ccsdk.apps.blueprintsprocessor.selfservice.api.BluePrintProcessingGRPCHandler; import org.slf4j.Logger; @@ -37,9 +38,10 @@ public class BlueprintGRPCServer implements ApplicationListener authenticate(Authentication authentication) { + try { + return Mono.just(authenticationProvider.authenticate(authentication)); + } catch (AuthenticationException e) { + return Mono.error(e); + } + } +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/security/BasicAuthServerInterceptor.java b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/security/BasicAuthServerInterceptor.java new file mode 100644 index 000000000..db0bfce46 --- /dev/null +++ b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/security/BasicAuthServerInterceptor.java @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2019 Bell Canada. + * + * 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. + */ +package org.onap.ccsdk.apps.blueprintsprocessor.security; + +import com.google.common.base.Strings; +import io.grpc.Metadata; +import io.grpc.ServerCall; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import io.grpc.Status; +import java.nio.charset.StandardCharsets; +import java.util.Base64; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Component; + +@Component +public class BasicAuthServerInterceptor implements ServerInterceptor { + + private static Logger log = LoggerFactory.getLogger(BasicAuthServerInterceptor.class); + + @Autowired + private AuthenticationManager authenticationManager; + + + @Override + public ServerCall.Listener interceptCall( + ServerCall call, + Metadata headers, + ServerCallHandler next) { + String authHeader = headers.get(Metadata.Key.of("Authorization", Metadata.ASCII_STRING_MARSHALLER)); + + if (Strings.isNullOrEmpty(authHeader)) { + throw Status.UNAUTHENTICATED.withDescription("Missing required authentication").asRuntimeException(); + + } + + try { + String[] tokens = decodeBasicAuth(authHeader); + String username = tokens[0]; + + log.info("Basic Authentication Authorization header found for user: {}", username); + + Authentication authRequest = new UsernamePasswordAuthenticationToken(username, tokens[1]); + Authentication authResult = authenticationManager.authenticate(authRequest).block(); + + log.info("Authentication success: {}", authResult); + + SecurityContextHolder.getContext().setAuthentication(authResult); + + } catch (AuthenticationException e) { + SecurityContextHolder.clearContext(); + + log.info("Authentication request failed: {}", e.getMessage()); + + throw Status.UNAUTHENTICATED.withDescription(e.getMessage()).withCause(e).asRuntimeException(); + } + + return next.startCall(call, headers); + } + + private String[] decodeBasicAuth(String authHeader) { + String basicAuth; + try { + basicAuth = new String(Base64.getDecoder().decode(authHeader.substring(6).getBytes(StandardCharsets.UTF_8)), + StandardCharsets.UTF_8); + } catch (IllegalArgumentException | IndexOutOfBoundsException e) { + throw new BadCredentialsException("Failed to decode basic authentication token"); + } + + int delim = basicAuth.indexOf(':'); + if (delim == -1) { + throw new BadCredentialsException("Failed to decode basic authentication token"); + } + + return new String[]{basicAuth.substring(0, delim), basicAuth.substring(delim + 1)}; + } +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/security/SecurityConfiguration.java b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/security/SecurityConfiguration.java new file mode 100644 index 000000000..7ddc42ccd --- /dev/null +++ b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/security/SecurityConfiguration.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2019 Bell Canada. + * + * 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. + */ +package org.onap.ccsdk.apps.blueprintsprocessor.security; + +import java.util.Collections; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.authentication.AuthenticationProvider; +import org.springframework.security.authentication.dao.DaoAuthenticationProvider; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.provisioning.InMemoryUserDetailsManager; + +@Configuration +public class SecurityConfiguration { + + @Value("${security.user.name}") + private String username; + + @Value("${security.user.password}") + private String password; + + @Bean + public UserDetailsService inMemoryUserService() { + UserDetails user = new User(username, password, + Collections.singletonList(new SimpleGrantedAuthority("USER"))); + return new InMemoryUserDetailsManager(user); + } + + @Bean + public PasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } + + @Bean + public AuthenticationProvider inMemoryAuthenticationProvider() { + DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); + provider.setUserDetailsService(inMemoryUserService()); + return provider; + } +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/security/SecurityContextRepository.java b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/security/SecurityContextRepository.java new file mode 100644 index 000000000..f9e184a11 --- /dev/null +++ b/ms/blueprintsprocessor/application/src/main/java/org/onap/ccsdk/apps/blueprintsprocessor/security/SecurityContextRepository.java @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2019 Bell Canada. + * + * 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. + */ +package org.onap.ccsdk.apps.blueprintsprocessor.security; + +import java.nio.charset.StandardCharsets; +import java.util.Base64; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.server.reactive.ServerHttpRequest; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContext; +import org.springframework.security.core.context.SecurityContextImpl; +import org.springframework.security.web.server.context.ServerSecurityContextRepository; +import org.springframework.stereotype.Component; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Mono; + +@Component +public class SecurityContextRepository implements ServerSecurityContextRepository { + + @Autowired + private AuthenticationManager authenticationManager; + + @Override + public Mono save(ServerWebExchange swe, SecurityContext sc) { + throw new UnsupportedOperationException("Not supported."); + } + + @Override + public Mono load(ServerWebExchange swe) { + ServerHttpRequest request = swe.getRequest(); + String authHeader = request.getHeaders().getFirst(HttpHeaders.AUTHORIZATION); + if (authHeader != null && authHeader.startsWith("Basic")) { + String[] tokens = decodeBasicAuth(authHeader); + String username = tokens[0]; + String password = tokens[1]; + Authentication auth = new UsernamePasswordAuthenticationToken(username, password); + return this.authenticationManager.authenticate(auth).map(SecurityContextImpl::new); + } else { + return Mono.empty(); + } + } + + private String[] decodeBasicAuth(String authHeader) { + String basicAuth; + try { + basicAuth = new String(Base64.getDecoder().decode(authHeader.substring(6).getBytes(StandardCharsets.UTF_8)), + StandardCharsets.UTF_8); + } catch (IllegalArgumentException | IndexOutOfBoundsException e) { + throw new BadCredentialsException("Failed to decode basic authentication token"); + } + + int delim = basicAuth.indexOf(':'); + if (delim == -1) { + throw new BadCredentialsException("Failed to decode basic authentication token"); + } + + return new String[]{basicAuth.substring(0, delim), basicAuth.substring(delim + 1)}; + } +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/application/src/main/resources/application.properties b/ms/blueprintsprocessor/application/src/main/resources/application.properties index cfef4f82f..e955c97c3 100755 --- a/ms/blueprintsprocessor/application/src/main/resources/application.properties +++ b/ms/blueprintsprocessor/application/src/main/resources/application.properties @@ -36,3 +36,6 @@ blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.MySQL5Inno # Python executor blueprints.processor.functions.python.executor.executionPath=/opt/app/onap/scripts/jython/ccsdk_blueprints blueprints.processor.functions.python.executor.modulePaths=/opt/app/onap/scripts/jython/ccsdk_blueprints,/opt/app/onap/scripts/jython/ccsdk_netconf + +security.user.password: {bcrypt}$2a$10$duaUzVUVW0YPQCSIbGEkQOXwafZGwQ/b32/Ys4R1iwSSawFgz7QNu +security.user.name: ccsdkapps diff --git a/ms/blueprintsprocessor/application/src/test/resources/application.properties b/ms/blueprintsprocessor/application/src/test/resources/application.properties index 2b5bea109..393024516 100644 --- a/ms/blueprintsprocessor/application/src/test/resources/application.properties +++ b/ms/blueprintsprocessor/application/src/test/resources/application.properties @@ -17,6 +17,9 @@ # # Web server config server.port=8080 +blueprintsprocessor.grpcEnable=false +blueprintsprocessor.httpPort=8080 +blueprintsprocessor.grpcPort=9111 # Blueprint Processor File Execution and Handling Properties blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive @@ -32,3 +35,6 @@ blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.H2Dialect # Python executor blueprints.processor.functions.python.executor.executionPath=/opt/app/onap/scripts/jython blueprints.processor.functions.python.executor.modulePaths=/opt/app/onap/scripts/jython + +security.user.password: {bcrypt}$2a$10$duaUzVUVW0YPQCSIbGEkQOXwafZGwQ/b32/Ys4R1iwSSawFgz7QNu +security.user.name: ccsdkapps diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml index c05b84ad9..f538a152d 100755 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -32,6 +32,12 @@ Blueprints Processor Selfservice API + + + org.springframework.security + spring-security-core + + org.onap.ccsdk.apps.components proto-definition diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt index fb0bc5678..d689187e8 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintManagementGRPCHandler.kt @@ -28,16 +28,18 @@ import org.onap.ccsdk.apps.controllerblueprints.management.api.BluePrintManageme import org.onap.ccsdk.apps.controllerblueprints.management.api.BluePrintManagementOutput import org.onap.ccsdk.apps.controllerblueprints.management.api.BluePrintManagementServiceGrpc import org.slf4j.LoggerFactory +import org.springframework.security.access.prepost.PreAuthorize import org.springframework.stereotype.Service import java.io.File @Service -class BluePrintManagementGRPCHandler(private val bluePrintCoreConfiguration: BluePrintCoreConfiguration, +open class BluePrintManagementGRPCHandler(private val bluePrintCoreConfiguration: BluePrintCoreConfiguration, private val bluePrintCatalogService: BluePrintCatalogService) : BluePrintManagementServiceGrpc.BluePrintManagementServiceImplBase() { private val log = LoggerFactory.getLogger(BluePrintManagementGRPCHandler::class.java) + @PreAuthorize("hasRole('USER')") override fun uploadBlueprint(request: BluePrintManagementInput, responseObserver: StreamObserver) { val blueprintName = request.blueprintName val blueprintVersion = request.blueprintVersion @@ -61,6 +63,7 @@ class BluePrintManagementGRPCHandler(private val bluePrintCoreConfiguration: Blu } } + @PreAuthorize("hasRole('USER')") override fun removeBlueprint(request: BluePrintManagementInput, responseObserver: StreamObserver) { val blueprintName = request.blueprintName val blueprintVersion = request.blueprintVersion diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandler.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandler.kt index edb1d31dc..aadbec83a 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandler.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintProcessingGRPCHandler.kt @@ -23,14 +23,16 @@ import org.onap.ccsdk.apps.controllerblueprints.processing.api.BluePrintProcessi import org.onap.ccsdk.apps.controllerblueprints.processing.api.ExecutionServiceInput import org.onap.ccsdk.apps.controllerblueprints.processing.api.ExecutionServiceOutput import org.slf4j.LoggerFactory +import org.springframework.security.access.prepost.PreAuthorize import org.springframework.stereotype.Service @Service -class BluePrintProcessingGRPCHandler(private val bluePrintCoreConfiguration: BluePrintCoreConfiguration, +open class BluePrintProcessingGRPCHandler(private val bluePrintCoreConfiguration: BluePrintCoreConfiguration, private val executionServiceHandler: ExecutionServiceHandler) : BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase() { private val log = LoggerFactory.getLogger(BluePrintProcessingGRPCHandler::class.java) + @PreAuthorize("hasRole('USER')") override fun process( responseObserver: StreamObserver): StreamObserver { diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt index 6477c0678..16f0fa869 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt @@ -23,6 +23,7 @@ import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceOut import org.springframework.beans.factory.annotation.Autowired import org.springframework.http.MediaType import org.springframework.http.codec.multipart.FilePart +import org.springframework.security.access.prepost.PreAuthorize import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RequestBody import org.springframework.web.bind.annotation.RequestMapping @@ -34,7 +35,7 @@ import reactor.core.publisher.Mono @RestController @RequestMapping("/api/v1/execution-service") -class ExecutionServiceController { +open class ExecutionServiceController { @Autowired lateinit var executionServiceHandler: ExecutionServiceHandler @@ -48,6 +49,7 @@ class ExecutionServiceController { @PostMapping(path = ["/upload"], consumes = [MediaType.MULTIPART_FORM_DATA_VALUE]) @ApiOperation(value = "Upload CBA", notes = "Takes a File and load it in the runtime database") @ResponseBody + @PreAuthorize("hasRole('USER')") fun upload(@RequestPart("file") parts: Mono): Mono { return parts .filter { it is FilePart } @@ -59,6 +61,7 @@ class ExecutionServiceController { @ApiOperation(value = "Resolve Resource Mappings", notes = "Takes the blueprint information and process as per the payload") @ResponseBody + @PreAuthorize("hasRole('USER')") fun process(@RequestBody executionServiceInput: ExecutionServiceInput): ExecutionServiceOutput { if (executionServiceInput.actionIdentifiers.mode == ACTION_MODE_ASYNC) { throw IllegalStateException("Can't process async request through the REST endpoint. Use gRPC for async processing.") diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandlerTest.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandlerTest.kt index de1201488..b730472e8 100644 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandlerTest.kt +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/ExecutionServiceHandlerTest.kt @@ -24,6 +24,7 @@ import org.onap.ccsdk.apps.blueprintsprocessor.core.api.data.ExecutionServiceInp import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintCatalogService import org.onap.ccsdk.apps.controllerblueprints.core.utils.JacksonUtils import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.autoconfigure.security.SecurityProperties import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest import org.springframework.context.annotation.ComponentScan import org.springframework.core.io.ByteArrayResource @@ -39,7 +40,7 @@ import kotlin.test.assertTrue @RunWith(SpringRunner::class) @WebFluxTest -@ContextConfiguration(classes = [ExecutionServiceHandler::class, BluePrintCoreConfiguration::class, BluePrintCatalogService::class]) +@ContextConfiguration(classes = [ExecutionServiceHandler::class, BluePrintCoreConfiguration::class, BluePrintCatalogService::class, SecurityProperties::class]) @ComponentScan(basePackages = ["org.onap.ccsdk.apps.blueprintsprocessor", "org.onap.ccsdk.apps.controllerblueprints"]) @TestPropertySource(locations = ["classpath:application-test.properties"]) class ExecutionServiceHandlerTest { -- cgit 1.2.3-korg From 743f1dcbd282cd240cab9b5fdd332711924d4e4b Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Thu, 14 Mar 2019 13:55:01 -0400 Subject: Prepare for release 0.4.1 Prepare to create release version 0.4.1 by using released version of parent pom Change-Id: Icf8432e14626a55b916b6f4d4a8992b79c29eff7 Issue-ID: CCSDK-1156 Signed-off-by: Timoney, Dan (dt5972) --- ms/blueprintsprocessor/application/pom.xml | 3 +-- ms/blueprintsprocessor/distribution/pom.xml | 7 ++----- ms/blueprintsprocessor/functions/netconf-executor/pom.xml | 3 +-- ms/blueprintsprocessor/functions/resource-resolution/pom.xml | 3 +-- ms/blueprintsprocessor/functions/restconf-executor/pom.xml | 7 ++----- ms/blueprintsprocessor/modules/commons/pom.xml | 3 +-- ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml | 3 +-- ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml | 3 +-- ms/blueprintsprocessor/modules/services/execution-service/pom.xml | 3 +-- ms/blueprintsprocessor/parent/pom.xml | 3 +-- 10 files changed, 12 insertions(+), 26 deletions(-) (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/application/pom.xml b/ms/blueprintsprocessor/application/pom.xml index c96bd0864..ff7680d50 100755 --- a/ms/blueprintsprocessor/application/pom.xml +++ b/ms/blueprintsprocessor/application/pom.xml @@ -17,8 +17,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor diff --git a/ms/blueprintsprocessor/distribution/pom.xml b/ms/blueprintsprocessor/distribution/pom.xml index 97d4271d2..8fcad07b4 100755 --- a/ms/blueprintsprocessor/distribution/pom.xml +++ b/ms/blueprintsprocessor/distribution/pom.xml @@ -14,9 +14,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor @@ -81,8 +79,7 @@ package - + diff --git a/ms/blueprintsprocessor/functions/netconf-executor/pom.xml b/ms/blueprintsprocessor/functions/netconf-executor/pom.xml index 99c3994ee..3041132de 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/pom.xml +++ b/ms/blueprintsprocessor/functions/netconf-executor/pom.xml @@ -14,8 +14,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + org.onap.ccsdk.apps.blueprintsprocessor functions diff --git a/ms/blueprintsprocessor/functions/resource-resolution/pom.xml b/ms/blueprintsprocessor/functions/resource-resolution/pom.xml index 9d56829a6..840124fa2 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/pom.xml +++ b/ms/blueprintsprocessor/functions/resource-resolution/pom.xml @@ -14,8 +14,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor diff --git a/ms/blueprintsprocessor/functions/restconf-executor/pom.xml b/ms/blueprintsprocessor/functions/restconf-executor/pom.xml index b87b29485..e81c52765 100644 --- a/ms/blueprintsprocessor/functions/restconf-executor/pom.xml +++ b/ms/blueprintsprocessor/functions/restconf-executor/pom.xml @@ -14,10 +14,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - - + functions org.onap.ccsdk.apps.blueprintsprocessor @@ -42,4 +39,4 @@ - \ No newline at end of file + diff --git a/ms/blueprintsprocessor/modules/commons/pom.xml b/ms/blueprintsprocessor/modules/commons/pom.xml index e1c07ddb9..07d7551f5 100755 --- a/ms/blueprintsprocessor/modules/commons/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/pom.xml @@ -17,8 +17,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml index 625297bf0..0c8e163fc 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml @@ -15,8 +15,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml index f538a152d..abd76dc1e 100755 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -17,8 +17,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor diff --git a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml index f5e3b3d05..42d2e074d 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml @@ -15,8 +15,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor diff --git a/ms/blueprintsprocessor/parent/pom.xml b/ms/blueprintsprocessor/parent/pom.xml index 9d570768d..48f18eff6 100755 --- a/ms/blueprintsprocessor/parent/pom.xml +++ b/ms/blueprintsprocessor/parent/pom.xml @@ -17,8 +17,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 org.onap.ccsdk.apps -- cgit 1.2.3-korg From 5da3a8132b004c2a3b626fba6c54867bed7051c0 Mon Sep 17 00:00:00 2001 From: "Timoney, Dan (dt5972)" Date: Tue, 19 Mar 2019 16:31:51 -0400 Subject: Compile against Fluorine SR2 Updated to compile against Fluorine SR2 Change-Id: I434068531ce4a661a04c20201e0fddf3f6b92f47 Issue-ID: CCSDK-1156 Signed-off-by: Timoney, Dan (dt5972) --- ms/blueprintsprocessor/application/pom.xml | 2 +- ms/blueprintsprocessor/distribution/pom.xml | 2 +- ms/blueprintsprocessor/functions/cli-executor/pom.xml | 9 +++------ ms/blueprintsprocessor/functions/netconf-executor/pom.xml | 2 +- ms/blueprintsprocessor/functions/pom.xml | 2 +- ms/blueprintsprocessor/functions/python-executor/pom.xml | 2 +- ms/blueprintsprocessor/functions/resource-resolution/pom.xml | 2 +- ms/blueprintsprocessor/functions/restconf-executor/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/db-lib/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/dmaap-lib/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/processor-core/pom.xml | 2 +- ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml | 2 +- ms/blueprintsprocessor/modules/inbounds/pom.xml | 2 +- ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml | 2 +- ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml | 2 +- ms/blueprintsprocessor/modules/outbounds/pom.xml | 2 +- ms/blueprintsprocessor/modules/pom.xml | 2 +- .../modules/services/execution-service/pom.xml | 2 +- ms/blueprintsprocessor/modules/services/pom.xml | 2 +- ms/blueprintsprocessor/modules/services/workflow-service/pom.xml | 2 +- ms/blueprintsprocessor/parent/pom.xml | 2 +- ms/blueprintsprocessor/pom.xml | 2 +- 23 files changed, 25 insertions(+), 28 deletions(-) (limited to 'ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml') diff --git a/ms/blueprintsprocessor/application/pom.xml b/ms/blueprintsprocessor/application/pom.xml index ff7680d50..8757a0367 100755 --- a/ms/blueprintsprocessor/application/pom.xml +++ b/ms/blueprintsprocessor/application/pom.xml @@ -22,7 +22,7 @@ org.onap.ccsdk.apps.blueprintsprocessor parent - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT ../parent application diff --git a/ms/blueprintsprocessor/distribution/pom.xml b/ms/blueprintsprocessor/distribution/pom.xml index 8fcad07b4..2bd16e5c0 100755 --- a/ms/blueprintsprocessor/distribution/pom.xml +++ b/ms/blueprintsprocessor/distribution/pom.xml @@ -19,7 +19,7 @@ org.onap.ccsdk.apps.blueprintsprocessor parent - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT ../parent distribution diff --git a/ms/blueprintsprocessor/functions/cli-executor/pom.xml b/ms/blueprintsprocessor/functions/cli-executor/pom.xml index 52a789077..9077c13c6 100644 --- a/ms/blueprintsprocessor/functions/cli-executor/pom.xml +++ b/ms/blueprintsprocessor/functions/cli-executor/pom.xml @@ -14,14 +14,11 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - - + functions org.onap.ccsdk.apps.blueprintsprocessor - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT 4.0.0 cli-executor @@ -37,4 +34,4 @@ - \ No newline at end of file + diff --git a/ms/blueprintsprocessor/functions/netconf-executor/pom.xml b/ms/blueprintsprocessor/functions/netconf-executor/pom.xml index 3041132de..2e6d77edc 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/pom.xml +++ b/ms/blueprintsprocessor/functions/netconf-executor/pom.xml @@ -18,7 +18,7 @@ org.onap.ccsdk.apps.blueprintsprocessor functions - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor.functions diff --git a/ms/blueprintsprocessor/functions/pom.xml b/ms/blueprintsprocessor/functions/pom.xml index 4bc0159f9..5bc26d5f4 100755 --- a/ms/blueprintsprocessor/functions/pom.xml +++ b/ms/blueprintsprocessor/functions/pom.xml @@ -19,7 +19,7 @@ org.onap.ccsdk.apps.blueprintsprocessor parent - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT ../parent 4.0.0 diff --git a/ms/blueprintsprocessor/functions/python-executor/pom.xml b/ms/blueprintsprocessor/functions/python-executor/pom.xml index 120ded780..e0c617493 100644 --- a/ms/blueprintsprocessor/functions/python-executor/pom.xml +++ b/ms/blueprintsprocessor/functions/python-executor/pom.xml @@ -18,7 +18,7 @@ functions org.onap.ccsdk.apps.blueprintsprocessor - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT 4.0.0 diff --git a/ms/blueprintsprocessor/functions/resource-resolution/pom.xml b/ms/blueprintsprocessor/functions/resource-resolution/pom.xml index 840124fa2..eafdb9a01 100644 --- a/ms/blueprintsprocessor/functions/resource-resolution/pom.xml +++ b/ms/blueprintsprocessor/functions/resource-resolution/pom.xml @@ -19,7 +19,7 @@ org.onap.ccsdk.apps.blueprintsprocessor functions - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT org.onap.ccsdk.apps.blueprintsprocessor.functions resource-resolution diff --git a/ms/blueprintsprocessor/functions/restconf-executor/pom.xml b/ms/blueprintsprocessor/functions/restconf-executor/pom.xml index e81c52765..1ee23d3d0 100644 --- a/ms/blueprintsprocessor/functions/restconf-executor/pom.xml +++ b/ms/blueprintsprocessor/functions/restconf-executor/pom.xml @@ -18,7 +18,7 @@ functions org.onap.ccsdk.apps.blueprintsprocessor - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT 4.0.0 org.onap.ccsdk.apps.blueprintsprocessor.functions diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml index 1f8251bda..045c871ff 100644 --- a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT db-lib diff --git a/ms/blueprintsprocessor/modules/commons/dmaap-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/dmaap-lib/pom.xml index 0dd3da350..6ad7d8433 100644 --- a/ms/blueprintsprocessor/modules/commons/dmaap-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/dmaap-lib/pom.xml @@ -23,7 +23,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT dmaap-lib diff --git a/ms/blueprintsprocessor/modules/commons/pom.xml b/ms/blueprintsprocessor/modules/commons/pom.xml index 07d7551f5..205fd94c5 100755 --- a/ms/blueprintsprocessor/modules/commons/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/pom.xml @@ -22,7 +22,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT commons diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/pom.xml b/ms/blueprintsprocessor/modules/commons/processor-core/pom.xml index aadff9c9f..32e4b3d4a 100644 --- a/ms/blueprintsprocessor/modules/commons/processor-core/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/processor-core/pom.xml @@ -21,7 +21,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT processor-core diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml index 0c8e163fc..1ed157dcc 100644 --- a/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor commons - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT rest-lib diff --git a/ms/blueprintsprocessor/modules/inbounds/pom.xml b/ms/blueprintsprocessor/modules/inbounds/pom.xml index 273abd51b..060c7e42d 100644 --- a/ms/blueprintsprocessor/modules/inbounds/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT inbounds diff --git a/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml index dcf42c207..26ce4a8c7 100644 --- a/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/resource-api/pom.xml @@ -19,7 +19,7 @@ org.onap.ccsdk.apps.blueprintsprocessor inbounds - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT resource-api diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml index abd76dc1e..0c6b8e77d 100755 --- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml +++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml @@ -22,7 +22,7 @@ org.onap.ccsdk.apps.blueprintsprocessor inbounds - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT selfservice-api diff --git a/ms/blueprintsprocessor/modules/outbounds/pom.xml b/ms/blueprintsprocessor/modules/outbounds/pom.xml index b6c26e67f..3fb7e382b 100644 --- a/ms/blueprintsprocessor/modules/outbounds/pom.xml +++ b/ms/blueprintsprocessor/modules/outbounds/pom.xml @@ -19,7 +19,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT outbounds diff --git a/ms/blueprintsprocessor/modules/pom.xml b/ms/blueprintsprocessor/modules/pom.xml index 5cc31c46e..26500f50d 100644 --- a/ms/blueprintsprocessor/modules/pom.xml +++ b/ms/blueprintsprocessor/modules/pom.xml @@ -21,7 +21,7 @@ org.onap.ccsdk.apps.blueprintsprocessor parent - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT ../parent diff --git a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml index 42d2e074d..913ce4671 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/execution-service/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps.blueprintsprocessor services - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT execution-service diff --git a/ms/blueprintsprocessor/modules/services/pom.xml b/ms/blueprintsprocessor/modules/services/pom.xml index 4388eeb9b..ee5b73cc7 100755 --- a/ms/blueprintsprocessor/modules/services/pom.xml +++ b/ms/blueprintsprocessor/modules/services/pom.xml @@ -22,7 +22,7 @@ org.onap.ccsdk.apps.blueprintsprocessor modules - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT services diff --git a/ms/blueprintsprocessor/modules/services/workflow-service/pom.xml b/ms/blueprintsprocessor/modules/services/workflow-service/pom.xml index 634d2233d..4331eec77 100644 --- a/ms/blueprintsprocessor/modules/services/workflow-service/pom.xml +++ b/ms/blueprintsprocessor/modules/services/workflow-service/pom.xml @@ -19,7 +19,7 @@ org.onap.ccsdk.apps.blueprintsprocessor services - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT 4.0.0 diff --git a/ms/blueprintsprocessor/parent/pom.xml b/ms/blueprintsprocessor/parent/pom.xml index 48f18eff6..46eba5afa 100755 --- a/ms/blueprintsprocessor/parent/pom.xml +++ b/ms/blueprintsprocessor/parent/pom.xml @@ -22,7 +22,7 @@ org.onap.ccsdk.apps blueprintsprocessor - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT org.onap.ccsdk.apps.blueprintsprocessor parent diff --git a/ms/blueprintsprocessor/pom.xml b/ms/blueprintsprocessor/pom.xml index 774e177e0..2f2576786 100755 --- a/ms/blueprintsprocessor/pom.xml +++ b/ms/blueprintsprocessor/pom.xml @@ -20,7 +20,7 @@ org.onap.ccsdk.apps ccsdk-apps-ms - 0.4.1-SNAPSHOT + 0.4.2-SNAPSHOT blueprintsprocessor pom -- cgit 1.2.3-korg