Fix case for all Software upgrade actions 73/102873/3
authorgummar <raj.gumma@est.tech>
Tue, 3 Mar 2020 14:48:22 +0000 (14:48 +0000)
committerRaj Gumma <raj.gumma@est.tech>
Tue, 3 Mar 2020 19:09:27 +0000 (19:09 +0000)
Issue-ID: CCSDK-2145
Signed-off-by: gummar <raj.gumma@est.tech>
Change-Id: Ie2a6b6c72997be65ac304f6cd1daac3a8aa85480

components/model-catalog/blueprint-model/uat-blueprints/PNF_CDS_RESTCONF/Definitions/PNF_CDS_RESTCONF.json
components/model-catalog/blueprint-model/uat-blueprints/PNF_CDS_RESTCONF/Definitions/data_types.json
components/model-catalog/blueprint-model/uat-blueprints/PNF_CDS_RESTCONF/Scripts/kotlin/RestconfSoftwareUpgrade.kt
components/model-catalog/blueprint-model/uat-blueprints/PNF_CDS_RESTCONF/Tests/uat.yaml

index 2e6c2f5..747fd8c 100644 (file)
         "get_input" : "resolution-key"
       }
     },
-    "precheck-properties" : {
+    "preCheck-properties" : {
       "resolution-key" : {
         "get_input" : "resolution-key"
       }
     },
-    "downloadNeSw-properties" : {
+    "downloadNESW-properties" : {
       "resolution-key" : {
         "get_input" : "resolution-key"
       }
     },
-    "activateNeSw-properties" : {
+    "activateNESW-properties" : {
       "resolution-key" : {
         "get_input" : "resolution-key"
       }
     },
-    "postcheck-properties" : {
+    "postCheck-properties" : {
       "resolution-key" : {
         "get_input" : "resolution-key"
       }
           }
         }
       },
-      "precheck" : {
+      "preCheck" : {
         "steps" : {
           "activate-process" : {
             "description" : "Check if pnf ready for sw upgrade",
-            "target" : "precheck",
+            "target" : "preCheck",
             "activities" : [ {
               "call_operation" : ""
             } ]
             "required" : true,
             "type" : "string"
           },
-          "precheck-properties" : {
-            "description" : "Dynamic PropertyDefinition for precheck workflow(software-upgrade).",
+          "preCheck-properties" : {
+            "description" : "Dynamic PropertyDefinition for preCheck workflow(software-upgrade).",
             "required" : true,
-            "type" : "dt-precheck-properties"
+            "type" : "dt-preCheck-properties"
           }
         }
       },
-      "downloadNeSw" : {
+      "downloadNESW" : {
         "steps" : {
           "activate-process" : {
             "description" : "Trigger download new software for sw upgrade",
-            "target" : "downloadNeSw",
+            "target" : "downloadNESW",
             "activities" : [ {
               "call_operation" : ""
             } ]
             "required" : true,
             "type" : "string"
           },
-          "downloadNeSw-properties" : {
-            "description" : "Dynamic PropertyDefinition for downloadNeSw workflow(software-upgrade).",
+          "downloadNESW-properties" : {
+            "description" : "Dynamic PropertyDefinition for downloadNESW workflow(software-upgrade).",
             "required" : true,
-            "type" : "dt-downloadNeSw-properties"
+            "type" : "dt-downloadNESW-properties"
           }
         }
       },
-      "activateNeSw" : {
+      "activateNESW" : {
         "steps" : {
           "activate-process" : {
             "description" : "Trigger activation of target software version for pnf upgrade",
-            "target" : "activateNeSw",
+            "target" : "activateNESW",
             "activities" : [ {
               "call_operation" : ""
             } ]
             "required" : true,
             "type" : "string"
           },
-          "activateNeSw-properties" : {
-            "description" : "Dynamic PropertyDefinition for activateNeSw workflow(software-upgrade).",
+          "activateNESW-properties" : {
+            "description" : "Dynamic PropertyDefinition for activateNESW workflow(software-upgrade).",
             "required" : true,
-            "type" : "dt-activateNeSw-properties"
+            "type" : "dt-activateNESW-properties"
           }
         }
       },
-      "postcheck" : {
+      "postCheck" : {
         "steps" : {
           "activate-process" : {
             "description" : "Check if pnf upgrade is completed",
-            "target" : "postcheck",
+            "target" : "postCheck",
             "activities" : [ {
               "call_operation" : ""
             } ]
             "required" : true,
             "type" : "string"
           },
-          "postcheck-properties" : {
-            "description" : "Dynamic PropertyDefinition for postcheck workflow(software-upgrade).",
+          "postCheck-properties" : {
+            "description" : "Dynamic PropertyDefinition for postCheck workflow(software-upgrade).",
             "required" : true,
-            "type" : "dt-postcheck-properties"
+            "type" : "dt-postCheck-properties"
           }
         }
       }
           }
         }
       },
-      "precheck" : {
+      "preCheck" : {
         "type" : "component-script-executor",
         "interfaces" : {
           "ComponentScriptExecutor" : {
                 "inputs" : {
                   "script-type" : "kotlin",
                   "script-class-reference" : "cba.pnf.swug.RestconfSoftwareUpgrade",
-                  "dynamic-properties" : "*precheck-properties"
+                  "dynamic-properties" : "*preCheck-properties"
                 },
                 "outputs" : {
                   "response-data" : "",
           }
         }
       },
-      "downloadNeSw" : {
+      "downloadNESW" : {
         "type" : "component-script-executor",
         "interfaces" : {
           "ComponentScriptExecutor" : {
                 "inputs" : {
                   "script-type" : "kotlin",
                   "script-class-reference" : "cba.pnf.swug.RestconfSoftwareUpgrade",
-                  "dynamic-properties" : "*downloadNeSw-properties"
+                  "dynamic-properties" : "*downloadNESW-properties"
                 },
                 "outputs" : {
                   "response-data" : "",
           }
         }
       },
-      "activateNeSw" : {
+      "activateNESW" : {
         "type" : "component-script-executor",
         "interfaces" : {
           "ComponentScriptExecutor" : {
                 "inputs" : {
                   "script-type" : "kotlin",
                   "script-class-reference" : "cba.pnf.swug.RestconfSoftwareUpgrade",
-                  "dynamic-properties" : "*activateNeSw-properties"
+                  "dynamic-properties" : "*activateNESW-properties"
                 },
                 "outputs" : {
                   "response-data" : "",
           }
         }
       },
-      "postcheck" : {
+      "postCheck" : {
         "type" : "component-script-executor",
         "interfaces" : {
           "ComponentScriptExecutor" : {
                 "inputs" : {
                   "script-type" : "kotlin",
                   "script-class-reference" : "cba.pnf.swug.RestconfSoftwareUpgrade",
-                  "dynamic-properties" : "*postcheck-properties"
+                  "dynamic-properties" : "*postCheck-properties"
                 },
                 "outputs" : {
                   "response-data" : "",
index e3d216c..2a42ac0 100644 (file)
@@ -19,8 +19,8 @@
       },
       "derived_from" : "tosca.datatypes.Dynamic"
     },
-    "dt-precheck-properties": {
-      "description": "Dynamic DataType definition for the precheck workflow(upgrade-software).",
+    "dt-preCheck-properties": {
+      "description": "Dynamic DataType definition for the preCheck workflow(upgrade-software).",
       "version": "1.0.0",
       "properties": {
         "pnf-id": {
@@ -32,8 +32,8 @@
       },
       "derived_from": "tosca.datatypes.Dynamic"
     },
-    "dt-downloadNeSw-properties": {
-      "description": "Dynamic DataType definition for the downloadNeSw workflow(upgrade-software).",
+    "dt-downloadNESW-properties": {
+      "description": "Dynamic DataType definition for the downloadNESW workflow(upgrade-software).",
       "version": "1.0.0",
       "properties": {
         "pnf-id": {
@@ -45,8 +45,8 @@
       },
       "derived_from": "tosca.datatypes.Dynamic"
     },
-    "dt-activateNeSw-properties": {
-      "description": "Dynamic DataType definition for the activateNeSw workflow(upgrade-software).",
+    "dt-activateNESW-properties": {
+      "description": "Dynamic DataType definition for the activateNESW workflow(upgrade-software).",
       "version": "1.0.0",
       "properties": {
         "pnf-id": {
@@ -58,8 +58,8 @@
       },
       "derived_from": "tosca.datatypes.Dynamic"
     },
-    "dt-postcheck-properties": {
-      "description": "Dynamic DataType definition for the postcheck workflow(upgrade-software).",
+    "dt-postCheck-properties": {
+      "description": "Dynamic DataType definition for the postCheck workflow(upgrade-software).",
       "version": "1.0.0",
       "properties": {
         "pnf-id": {
index 07e804b..9d00c60 100644 (file)
@@ -60,10 +60,10 @@ class RestconfSoftwareUpgrade : AbstractScriptComponentFunction() {
             restconfMountDevice(model.client, model.deviceId, mountPayload, mutableMapOf("Content-Type" to "application/json"))
 
             when (model.action) {
-                Action.PRE_CHECK -> processPrecheck(model)
-                Action.DOWNLOAD_NE_SW -> processDownloadNeSw(model)
-                Action.ACTIVATE_NE_SW -> processActivateNeSw(model)
-                Action.POST_CHECK -> processPostcheck(model)
+                Action.PRE_CHECK -> processPreCheck(model)
+                Action.DOWNLOAD_NE_SW -> processDownloadNESW(model)
+                Action.ACTIVATE_NE_SW -> processActivateNESW(model)
+                Action.POST_CHECK -> processPostCheck(model)
                 Action.CANCEL -> processCancel(model)
             }
 
@@ -74,7 +74,7 @@ class RestconfSoftwareUpgrade : AbstractScriptComponentFunction() {
         }
     }
 
-    private suspend fun processPrecheck(model: SoftwareUpgradeModel) {
+    private suspend fun processPreCheck(model: SoftwareUpgradeModel) {
         log.debug("In PNF SW upgrade : processPreCheck")
         //Log the current configuration for the subtree
         val payloadObject = getCurrentConfig(model)
@@ -82,8 +82,8 @@ class RestconfSoftwareUpgrade : AbstractScriptComponentFunction() {
         log.info("PNF is Healthy!")
     }
 
-    private suspend fun processDownloadNeSw(model: SoftwareUpgradeModel) {
-        log.debug("In PNF SW upgrade : processDownloadNeSw")
+    private suspend fun processDownloadNESW(model: SoftwareUpgradeModel) {
+        log.debug("In PNF SW upgrade : processDownloadNESW")
         //Check if there is existing config for the targeted software version
 
         var downloadConfigPayload: String
@@ -106,8 +106,8 @@ class RestconfSoftwareUpgrade : AbstractScriptComponentFunction() {
         checkExecution(model)
     }
 
-    private suspend fun processActivateNeSw(model: SoftwareUpgradeModel) {
-        log.debug("In PNF SW upgrade : processActivateNeSw")
+    private suspend fun processActivateNESW(model: SoftwareUpgradeModel) {
+        log.debug("In PNF SW upgrade : processActivateNESW")
         //Check if the software is downloaded and ready to be activated
         if (checkIfSwReadyToPerformAction(Action.DOWNLOAD_NE_SW, model)) {
             var activateConfigPayload: String = contentFromResolvedArtifactNB("configure")
@@ -124,8 +124,8 @@ class RestconfSoftwareUpgrade : AbstractScriptComponentFunction() {
         }
     }
 
-    private suspend fun processPostcheck(model: SoftwareUpgradeModel) {
-        log.info("In PNF SW upgrade : processPostcheck")
+    private suspend fun processPostCheck(model: SoftwareUpgradeModel) {
+        log.info("In PNF SW upgrade : processPostCheck")
         //Log the current configuration for the subtree
         if (checkIfSwReadyToPerformAction(Action.POST_CHECK, model)) {
             log.info("PNF is healthy post activation!")
@@ -175,10 +175,10 @@ class RestconfSoftwareUpgrade : AbstractScriptComponentFunction() {
 }
 
 enum class Action(val actionName: String, val completionStatus: String) {
-    PRE_CHECK("precheck", "INITIALIZED"),
-    DOWNLOAD_NE_SW("downloadNeSw", "DOWNLOAD_COMPLETED"),
-    ACTIVATE_NE_SW("activateNeSw", "ACTIVATION_COMPLETED"),
-    POST_CHECK("postcheck", "ACTIVATION_COMPLETED"),
+    PRE_CHECK("preCheck", "INITIALIZED"),
+    DOWNLOAD_NE_SW("downloadNESW", "DOWNLOAD_COMPLETED"),
+    ACTIVATE_NE_SW("activateNESW", "ACTIVATION_COMPLETED"),
+    POST_CHECK("postCheck", "ACTIVATION_COMPLETED"),
     CANCEL("cancel", "CANCELLED")
     ;
     companion object{
index 79328e6..7136b1b 100644 (file)
@@ -56,21 +56,21 @@ processes:
         errorMessage: null
         eventType: EVENT_COMPONENT_EXECUTED
         message: success
-  - name: precheck
+  - name: preCheck
     request:
       commonHeader: &swugCommonHeader
         originatorId: sdnc
         requestId: "123456-1000"
         subRequestId: sub-123456-1000
-      actionIdentifiers: &precheck-ai
+      actionIdentifiers: &preCheck-ai
         blueprintName: PNF_CDS_RESTCONF
         blueprintVersion: "1.0.0"
-        actionName: precheck
+        actionName: preCheck
         mode: sync
       payload:
-        precheck-request:
+        preCheck-request:
           resolution-key: &resKey "RES-KEY 61"
-          precheck-properties: &actionProps
+          preCheck-properties: &actionProps
             service-instance-id: siid_1234
             pnf-id: &pnfId pnf-id-2019-07-12
             target-software-version: "2.0.2"
@@ -78,26 +78,26 @@ processes:
             pnf-customization-uuid: pnf-customization-uuid
     expectedResponse:
       commonHeader: *swugCommonHeader
-      actionIdentifiers: *precheck-ai
+      actionIdentifiers: *preCheck-ai
       status:
         code: 200
         eventType: EVENT_COMPONENT_EXECUTED
         errorMessage: null
         message: success
       payload:
-        precheck-response: {}
-  - name: downloadNeSw
+        preCheck-response: {}
+  - name: downloadNESW
     request:
       commonHeader: *swugCommonHeader
       actionIdentifiers: &download-ai
         blueprintName: PNF_CDS_RESTCONF
         blueprintVersion: "1.0.0"
-        actionName: downloadNeSw
+        actionName: downloadNESW
         mode: sync
       payload:
-        downloadNeSw-request:
+        downloadNESW-request:
           resolution-key: *resKey
-          downloadNeSw-properties: *actionProps
+          downloadNESW-properties: *actionProps
     expectedResponse:
       commonHeader: *swugCommonHeader
       actionIdentifiers: *download-ai
@@ -107,19 +107,19 @@ processes:
         errorMessage: null
         message: success
       payload:
-        downloadNeSw-response: {}
-  - name: activateNeSw
+        downloadNESW-response: {}
+  - name: activateNESW
     request:
       commonHeader: *swugCommonHeader
       actionIdentifiers: &activate-ai
         blueprintName: PNF_CDS_RESTCONF
         blueprintVersion: "1.0.0"
-        actionName: activateNeSw
+        actionName: activateNESW
         mode: sync
       payload:
-        activateNeSw-request:
+        activateNESW-request:
           resolution-key: *resKey
-          activateNeSw-properties: *actionProps
+          activateNESW-properties: *actionProps
     expectedResponse:
       commonHeader: *swugCommonHeader
       actionIdentifiers: *activate-ai
@@ -129,29 +129,29 @@ processes:
         errorMessage: null
         message: success
       payload:
-        activateNeSw-response: {}
-  - name: postcheck
+        activateNESW-response: {}
+  - name: postCheck
     request:
       commonHeader: *swugCommonHeader
-      actionIdentifiers: &postcheck-ai
+      actionIdentifiers: &postCheck-ai
         blueprintName: PNF_CDS_RESTCONF
         blueprintVersion: "1.0.0"
-        actionName: postcheck
+        actionName: postCheck
         mode: sync
       payload:
-        postcheck-request:
+        postCheck-request:
           resolution-key: *resKey
-          postcheck-properties: *actionProps
+          postCheck-properties: *actionProps
     expectedResponse:
       commonHeader: *swugCommonHeader
-      actionIdentifiers: *postcheck-ai
+      actionIdentifiers: *postCheck-ai
       status:
         code: 200
         eventType: EVENT_COMPONENT_EXECUTED
         errorMessage: null
         message: success
       payload:
-        postcheck-response: {}
+        postCheck-response: {}
 external-services:
   - selector: aai-data
     expectations: