summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/commons/core/src
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-08-15 21:31:10 +0000
committerMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-08-16 14:47:23 +0000
commit4b3c8a0bb11d71c1be8ac5a966818dafec1124fe (patch)
tree98c4fd7230c3007fface1e0f62afa6c22962fa02 /ms/blueprintsprocessor/modules/commons/core/src
parent4a280c3155a47d7b053d4270f4dfa3648558ef64 (diff)
Blueprints Processor Service
Blueprints Processor API definitions Change-Id: Id44c74938f75e847a43b8e6d0733c36d4dc99e97 Issue-ID: CCSDK-411 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/core/src')
-rw-r--r--ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt131
-rw-r--r--ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorException.kt48
-rw-r--r--ms/blueprintsprocessor/modules/commons/core/src/main/resources/application.properties16
3 files changed, 195 insertions, 0 deletions
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 000000000..4836cd243
--- /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<ResourceAssignment>
+ @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<ResourceAssignment>
+}
+
+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 000000000..df4d67038
--- /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 000000000..2ce871476
--- /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.
+#
+