Wrapper functions for placing output responseData and Status 12/93712/2
authorSteve Siani <steve.djissitchi@bell.ca>
Fri, 16 Aug 2019 01:42:50 +0000 (21:42 -0400)
committerSteve Siani <alphonse.steve.siani.djissitchi@ibm.com>
Fri, 16 Aug 2019 03:36:57 +0000 (23:36 -0400)
Issue-ID: CCSDK-1625
Change-Id: I80e6c0d8f04df3a05d9bfc230addda5f0501b1b1
Signed-off-by: Steve Siani <alphonse.steve.siani.djissitchi@ibm.com>
components/model-catalog/definition-type/starter-type/node_type/component-config-snapshots-executor.json
components/model-catalog/definition-type/starter-type/node_type/component-jython-executor.json
components/model-catalog/definition-type/starter-type/node_type/component-netconf-executor.json
components/model-catalog/definition-type/starter-type/node_type/component-remote-ansible-executor.json
components/model-catalog/definition-type/starter-type/node_type/component-script-executor.json
components/scripts/python/ccsdk_netconf/common.py
components/scripts/python/ccsdk_netconf/netconf_constant.py
components/scripts/python/ccsdk_netconf/netconfclient.py
components/scripts/python/ccsdk_restconf/restconf_client.py
components/scripts/python/ccsdk_restconf/restconf_constant.py [new file with mode: 0644]

index 1cc3666..caae68e 100644 (file)
     "config-snapshot-value": {
       "required": false,
       "type": "string"
+    },
+    "response-data": {
+      "required": false,
+      "type": "json"
     }
   },
   "capabilities": {
index b78a7c6..ae674f3 100644 (file)
@@ -1,6 +1,12 @@
 {
   "description": "This is Jython Execution Component.",
   "version": "1.0.0",
+  "attributes": {
+    "response-data": {
+      "required": false,
+      "type": "json"
+    }
+  },
   "capabilities": {
     "component-node": {
       "type": "tosca.capabilities.Node"
index 3233d21..e72cf95 100644 (file)
@@ -1,6 +1,12 @@
 {\r
   "description": "This is Netconf Transaction Configuration Component API",\r
   "version": "1.0.0",\r
+  "attributes": {\r
+    "response-data": {\r
+      "required": false,\r
+      "type": "json"\r
+    }\r
+  },\r
   "capabilities": {\r
     "component-node": {\r
       "type": "tosca.capabilities.Node"\r
index 498db82..508380c 100644 (file)
@@ -9,6 +9,10 @@
     "ansible-command-logs": {
       "required": true,
       "type": "string"
+    },
+    "response-data": {
+      "required": false,
+      "type": "json"
     }
   },
   "capabilities": {
index b241aa3..2259602 100644 (file)
@@ -1,6 +1,12 @@
 {
   "description": "This is CLI Transaction Configuration Component API",
   "version": "1.0.0",
+  "attributes": {
+    "response-data": {
+      "required": false,
+      "type": "json"
+    }
+  },
   "capabilities": {
     "component-node": {
       "type": "tosca.capabilities.Node"
index f7ac1ac..66c7a98 100644 (file)
@@ -26,3 +26,4 @@ class ResolutionHelper:
     def retrieve_resolved_template_from_database(self, key, artifact_template):
         return ResourceResolutionExtensionsKt.storedContentFromResolvedArtifact(self.component_function, key,
                                                                                 artifact_template)
+
index 534ca9e..52ac0ae 100644 (file)
@@ -8,6 +8,8 @@ PARAM_ACTION = "action"
 STATUS_SUCCESS = "success"
 STATUS_FAILURE = "failure"
 
+ATTRIBUTE_RESPONSE_DATA = "response-data"
+
 CONFIG_TARGET_RUNNING = "running"
 CONFIG_TARGET_CANDIDATE = "candidate"
 CONFIG_DEFAULT_OPERATION_MERGE = "merge"
index a942845..b3aef11 100644 (file)
@@ -1,5 +1,4 @@
-from netconf_constant import CONFIG_TARGET_RUNNING, CONFIG_TARGET_CANDIDATE, \
-    CONFIG_DEFAULT_OPERATION_REPLACE
+from netconf_constant import *
 from org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor import NetconfExecutorExtensionsKt
 
 
@@ -60,3 +59,6 @@ class NetconfClient:
     def discard_change(self):
         device_response = self.netconf_rpc_client.discardConfig()
         return device_response
+
+    def set_execution_attribute_response_data(self, response_data):
+        self.setAttribute(ATTRIBUTE_RESPONSE_DATA, response_data)
index 927c1fe..6e53dcf 100644 (file)
@@ -18,6 +18,7 @@
 # ============LICENSE_END=========================================================
 #
 from time import sleep
+from restconf_constant import *
 from org.onap.ccsdk.cds.blueprintsprocessor.functions.restconf.executor import RestconfExecutorExtensionsKt
 from org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution import ResourceResolutionExtensionsKt
 
@@ -92,3 +93,6 @@ class RestconfClient:
         url = self.__base_odl_url + nf_id
         self.__log.debug("sending unmount request, url: {}", url)
         web_client_service.exchangeResource("DELETE", url, "")
+
+    def set_execution_attribute_response_data(self, response_data):
+        self.setAttribute(ATTRIBUTE_RESPONSE_DATA, response_data)
diff --git a/components/scripts/python/ccsdk_restconf/restconf_constant.py b/components/scripts/python/ccsdk_restconf/restconf_constant.py
new file mode 100644 (file)
index 0000000..2e1c583
--- /dev/null
@@ -0,0 +1 @@
+ATTRIBUTE_RESPONSE_DATA = "response-data"
\ No newline at end of file