summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/python-executor
diff options
context:
space:
mode:
authorLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2022-06-20 22:27:19 +0200
committerLukasz Rajewski <lukasz.rajewski@t-mobile.pl>2022-07-22 07:17:11 +0000
commit9c1cb6a1db4a290ceccb09c003ad2c131aa91bc9 (patch)
treed8e21cf93c4b8e4c183be483ff90ff7b7adb9c40 /ms/blueprintsprocessor/functions/python-executor
parent8c37e60d8c2666a0ad9e821b94255af12193e3e4 (diff)
Aligned attributes of CDS components
Issue-ID: CCSDK-3698 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@t-mobile.pl> Change-Id: Ie5c78a9a347373b5faf588627e42138806d69c0c (cherry picked from commit ea1c8b477e615f4dd45204b221fe7eacfe5474af)
Diffstat (limited to 'ms/blueprintsprocessor/functions/python-executor')
-rw-r--r--ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt2
-rw-r--r--ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorDSL.kt30
2 files changed, 31 insertions, 1 deletions
diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt
index eaefde7ce..45a3f8fe9 100644
--- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt
+++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt
@@ -83,6 +83,8 @@ open class ComponentRemotePythonExecutor(
const val ATTRIBUTE_PREPARE_ENV_LOG = "prepare-environment-logs"
const val ATTRIBUTE_EXEC_CMD_LOG = "execute-command-logs"
const val ATTRIBUTE_RESPONSE_DATA = "response-data"
+ const val OUTPUT_RESPONSE_DATA = "response-data"
+ const val OUTPUT_STATUS = "status"
const val DEFAULT_ENV_PREPARE_TIMEOUT_IN_SEC = 120
const val DEFAULT_EXECUTE_TIMEOUT_IN_SEC = 180
const val DEFAULT_CBA_UPLOAD_TIMEOUT_IN_SEC = 30
diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorDSL.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorDSL.kt
index 3df25c402..7f9f2b105 100644
--- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorDSL.kt
+++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutorDSL.kt
@@ -18,6 +18,7 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.python.executor
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.node.ArrayNode
+import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ComponentScriptExecutor
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
@@ -53,6 +54,10 @@ fun BluePrintTypes.nodeTypeComponentRemotePythonExecutor(): NodeType {
ComponentRemotePythonExecutor.ATTRIBUTE_RESPONSE_DATA, BluePrintConstants.DATA_TYPE_JSON,
false
)
+ attribute(
+ ComponentRemotePythonExecutor.ATTRIBUTE_EXEC_CMD_STATUS, BluePrintConstants.DATA_TYPE_STRING,
+ true
+ )
operation("ComponentRemotePythonExecutor", "ComponentRemotePythonExecutor Operation") {
inputs {
@@ -84,6 +89,16 @@ fun BluePrintTypes.nodeTypeComponentRemotePythonExecutor(): NodeType {
entrySchema("dt-system-packages")
}
}
+ outputs {
+ property(
+ ComponentRemotePythonExecutor.OUTPUT_RESPONSE_DATA, BluePrintConstants.DATA_TYPE_JSON,
+ false, "Output Response"
+ )
+ property(
+ ComponentRemotePythonExecutor.OUTPUT_STATUS, BluePrintConstants.DATA_TYPE_STRING,
+ true, "Status of the Component Execution ( success or failure )"
+ )
+ }
}
}
}
@@ -184,5 +199,18 @@ class ComponentRemotePythonExecutorNodeTemplateBuilder(id: String, description:
}
}
- class OutputsBuilder : PropertiesAssignmentBuilder()
+ class OutputsBuilder : PropertiesAssignmentBuilder() {
+
+ fun status(status: String) = status(status.asJsonPrimitive())
+
+ fun status(status: JsonNode) {
+ property(ComponentScriptExecutor.OUTPUT_STATUS, status)
+ }
+
+ fun responseData(responseData: String) = responseData(responseData.asJsonType())
+
+ fun responseData(responseData: JsonNode) {
+ property(ComponentScriptExecutor.OUTPUT_RESPONSE_DATA, responseData)
+ }
+ }
}