From 8bcc7270dc5ac5b93adf156327a018d6eb856066 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/commons/adaptors/pom.xml | 34 ++++++ .../modules/commons/core/pom.xml | 45 +++++++ .../core/api/data/BlueprintProcessorData.kt | 131 +++++++++++++++++++++ .../core/api/data/BlueprintProcessorException.kt | 48 ++++++++ .../core/src/main/resources/application.properties | 16 +++ .../modules/commons/db-lib/pom.xml | 54 +++++++++ ms/blueprintsprocessor/modules/commons/pom.xml | 62 ++++++++++ .../modules/commons/rest-lib/pom.xml | 37 ++++++ 8 files changed, 427 insertions(+) create mode 100644 ms/blueprintsprocessor/modules/commons/adaptors/pom.xml create mode 100644 ms/blueprintsprocessor/modules/commons/core/pom.xml create mode 100644 ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt create mode 100644 ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorException.kt create mode 100644 ms/blueprintsprocessor/modules/commons/core/src/main/resources/application.properties create mode 100644 ms/blueprintsprocessor/modules/commons/db-lib/pom.xml create mode 100644 ms/blueprintsprocessor/modules/commons/pom.xml create mode 100644 ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml (limited to 'ms/blueprintsprocessor/modules/commons') diff --git a/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml b/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml new file mode 100644 index 00000000..efd7d74b --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml @@ -0,0 +1,34 @@ + + + + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + commons + 0.0.3-SNAPSHOT + + + adaptors + pom + Blueprints Processor Adaptors POM + Blueprints Processor Adaptors + + + + + diff --git a/ms/blueprintsprocessor/modules/commons/core/pom.xml b/ms/blueprintsprocessor/modules/commons/core/pom.xml new file mode 100644 index 00000000..a601560b --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/core/pom.xml @@ -0,0 +1,45 @@ + + + + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + commons + 0.0.3-SNAPSHOT + + + core + jar + Blueprints Processor Core + Blueprints Processor Core + + + + org.onap.ccsdk.apps.blueprintsprocessor + db-lib + + + org.onap.ccsdk.apps.blueprintsprocessor + rest-lib + + + org.onap.ccsdk.apps + controllerblueprints-resource-dict + + + 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 new file mode 100644 index 00000000..4836cd24 --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt @@ -0,0 +1,131 @@ +/* + * 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.core.api.data + +import com.fasterxml.jackson.annotation.JsonFormat +import com.fasterxml.jackson.databind.node.ObjectNode +import io.swagger.annotations.ApiModelProperty +import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment + +/* + * 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. + */ + +/** + * BlueprintProcessorData + * @author Brinda Santh + * DATE : 8/15/2018 + */ + +open class ResourceResolutionInput { + @get:ApiModelProperty(required=true) + lateinit var commonHeader: CommonHeader + @get:ApiModelProperty(required=true) + lateinit var actionIdentifiers: ActionIdentifiers + @get:ApiModelProperty(required=true) + lateinit var resourceAssignments: List + @get:ApiModelProperty(required=true ) + lateinit var payload: ObjectNode +} + +open class ResourceResolutionOutput { + @get:ApiModelProperty(required=true) + lateinit var commonHeader: CommonHeader + @get:ApiModelProperty(required=true) + lateinit var actionIdentifiers: ActionIdentifiers + @get:ApiModelProperty(required=true) + lateinit var status: Status + @get:ApiModelProperty(required=true) + lateinit var resourceAssignments: List +} + +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) + lateinit var 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'") + lateinit var timestamp: String + @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=false) + var errorMessage: String? = null + @get:ApiModelProperty(required=true) + lateinit var message: String +} + + + + + diff --git a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorException.kt b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorException.kt new file mode 100644 index 00000000..df4d6703 --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorException.kt @@ -0,0 +1,48 @@ +/* + * 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.core.api.data + +/** + * BlueprintProcessorException + * @author Brinda Santh + * DATE : 8/15/2018 + */ +open class BlueprintProcessorException : Exception { + var code: Int = 100 + + constructor(cause: Throwable) : super(cause) + constructor(message: String) : super(message) + constructor(message: String, cause: Throwable) : super(message, cause) + constructor(cause: Throwable, message: String, vararg args: Any?) : super(String.format(message, *args), cause) + + constructor(code: Int, cause: Throwable) : super(cause) { + this.code = code + } + + constructor(code: Int, message: String) : super(message) { + this.code = code + } + + constructor(code: Int, message: String, cause: Throwable) : super(message, cause) { + this.code = code + } + + constructor(code: Int, cause: Throwable, message: String, vararg args: Any?) + : super(String.format(message, *args), cause) { + this.code = code + } +} \ No newline at end of file diff --git a/ms/blueprintsprocessor/modules/commons/core/src/main/resources/application.properties b/ms/blueprintsprocessor/modules/commons/core/src/main/resources/application.properties new file mode 100644 index 00000000..2ce87147 --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/core/src/main/resources/application.properties @@ -0,0 +1,16 @@ +# +# 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. +# + diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml new file mode 100644 index 00000000..31abb40d --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml @@ -0,0 +1,54 @@ + + + + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + commons + 0.0.3-SNAPSHOT + + + db-lib + jar + Blueprints Processor DB Lib + Blueprints Processor DB Lib + + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + javax.validation + validation-api + + + + com.h2database + h2 + + + org.hibernate + hibernate-testing + test + + + + + diff --git a/ms/blueprintsprocessor/modules/commons/pom.xml b/ms/blueprintsprocessor/modules/commons/pom.xml new file mode 100644 index 00000000..83a3cb8b --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/pom.xml @@ -0,0 +1,62 @@ + + + + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + modules + 0.0.3-SNAPSHOT + + + commons + pom + Blueprints Processor Commons POM + Blueprints Processor Commons + + + db-lib + rest-lib + adaptors + core + + + + com.fasterxml.jackson.module + jackson-module-kotlin + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + + + org.jetbrains.kotlin + kotlin-reflect + + + org.jetbrains.kotlin + kotlin-test + test + + + io.projectreactor + reactor-test + test + + + + diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml new file mode 100644 index 00000000..d671f120 --- /dev/null +++ b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml @@ -0,0 +1,37 @@ + + + + 4.0.0 + + org.onap.ccsdk.apps.blueprintsprocessor + commons + 0.0.3-SNAPSHOT + + + rest-lib + jar + Blueprints Processor Rest Lib + Blueprints Processor Rest Lib + + + org.springframework.boot + spring-boot-starter-webflux + + + + -- cgit 1.2.3-korg