Removed resolution-key from K8S profile upload 42/100742/2
authorLukasz Rajewski <lukasz.rajewski@orange.com>
Fri, 24 Jan 2020 10:06:14 +0000 (11:06 +0100)
committerLukasz Rajewski <lukasz.rajewski@orange.com>
Fri, 24 Jan 2020 12:46:12 +0000 (13:46 +0100)
Removed resolution-key from K8S profile upload

Change-Id: If7c9106da4ca514d142c8bb898ac50630e41b577
Issue-ID: INT-1406
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
heat/vFW_CNF_CDS/templates/cba/Definitions/vFW_CNF_CDS.json
heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/KotlinK8sProfileUpload.kt

index c4b6516..f4c38ba 100644 (file)
@@ -39,8 +39,8 @@
       "url" : "http://multicloud-k8s:9015"
     },
     "profile-upload-properties" : {
-      "resolution-key" : {
-        "get_input" : "resolution-key"
+      "assignment-params": {
+        "get_attribute" : [ "resource-assignment", "assignment-params" ]
       },
       "api-access": "*multicloud-k8s-api"
     },
                   "artifact-prefix-names" : {
                     "get_input" : "template-prefix"
                   }
-                },
-                "store-result": true,
-                "resolution-key": {
-                  "get_input" : "resolution-key"
                 }
               }
             }
index 5231fb5..02c0441 100644 (file)
@@ -19,7 +19,6 @@ package org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts
 import com.fasterxml.jackson.databind.node.ObjectNode
 import com.fasterxml.jackson.databind.ObjectMapper
 import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
-import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.storedContentFromResolvedArtifactNB
 import org.onap.ccsdk.cds.blueprintsprocessor.rest.BasicAuthRestClientProperties
 import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties
 import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BasicAuthRestClientService
@@ -67,8 +66,6 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() {
 
     override suspend fun processNB(executionRequest: ExecutionServiceInput) {
         log.info("executing K8s Profile Upload script")
-        val resolution_key = getDynamicProperties("resolution-key").asText()
-        log.info("resolution_key: $resolution_key")
 
         val baseK8sApiUrl = getDynamicProperties("api-access").get("url").asText()
         val k8sApiUsername = getDynamicProperties("api-access").get("username").asText()
@@ -80,10 +77,10 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() {
             if (prefix.toLowerCase().equals("vnf"))
                 continue
 
-            val payload = storedContentFromResolvedArtifactNB(resolution_key, prefix)
-            log.info("Uploading K8S profile for template prefix $prefix")
+            val assignmentParams = getDynamicProperties("assignment-params")
+            val payloadObject = JacksonUtils.jsonNode(assignmentParams.get(prefix).asText()) as ObjectNode
 
-            val payloadObject = JacksonUtils.jsonNode(payload) as ObjectNode
+            log.info("Uploading K8S profile for template prefix $prefix")
 
             val vfModuleModelInvariantUuid: String = getResolvedParameter(payloadObject, "vf-module-model-invariant-uuid")
             val vfModuleModelUuid: String = getResolvedParameter(payloadObject, "vf-module-model-version")