[vFW_CNF_CDS] Update package with latest CDS/Policy changes 92/108192/1
authorKonrad Bańka <k.banka@samsung.com>
Mon, 25 May 2020 10:03:38 +0000 (12:03 +0200)
committerKonrad Bańka <k.banka@samsung.com>
Mon, 25 May 2020 10:03:38 +0000 (12:03 +0200)
Rename csar directory with proper name.
Update CBA to refer to default naming policy.
Remove policy creating script/docs as it's no longer relevant.

Issue-ID: INT-1457
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: I7d3b888ce073a88e6dfd41883a8853fbf7cb0539

15 files changed:
heat/vFW_CNF_CDS/templates/.gitignore
heat/vFW_CNF_CDS/templates/Makefile
heat/vFW_CNF_CDS/templates/cba/Definitions/vFW_CNF_CDS.json
heat/vFW_CNF_CDS/templates/cba/TOSCA-Metadata/TOSCA.meta
heat/vFW_CNF_CDS/templates/cba/Templates/base_template-template.vtl
heat/vFW_CNF_CDS/templates/cba/Templates/k8s-profiles/ssh-service-template.vtl
heat/vFW_CNF_CDS/templates/cba/Templates/vfw-template.vtl
heat/vFW_CNF_CDS/templates/cba/Templates/vnf-mapping.json
heat/vFW_CNF_CDS/templates/cba/Templates/vpkg-template.vtl
heat/vFW_CNF_CDS/templates/cba/Templates/vsn-template.vtl
heat/vFW_CNF_CDS/templates/policy/README.txt [deleted file]
heat/vFW_CNF_CDS/templates/policy/create.json [deleted file]
heat/vFW_CNF_CDS/templates/policy/get.json [deleted file]
heat/vFW_CNF_CDS/templates/policy/policy.sh [deleted file]
heat/vFW_CNF_CDS/templates/policy/push.json [deleted file]

index 5cae204..66dbb29 100644 (file)
@@ -7,24 +7,24 @@ clean_all:
        $(MAKE) all
 
 #Can't use .csar extension or SDC will panic
-all: csar/ helm base cba
-       cd csar/ && zip -r $(ONBOARDING_PACKAGE_NAME).zip .
-       mv csar/$(ONBOARDING_PACKAGE_NAME).zip .
+all: package/ helm base cba
+       cd package/ && zip -r $(ONBOARDING_PACKAGE_NAME).zip .
+       mv package/$(ONBOARDING_PACKAGE_NAME).zip .
 
-helm: csar/
+helm: package/
        make -C helm
-       mv helm/*.tgz csar/
+       mv helm/*.tgz package/
 
-base: csar/
-       cp base/* csar/
+base: package/
+       cp base/* package/
 
-cba: csar/
+cba: package/
        cd cba/ && zip -r $(CBA_NAME).zip .
-       mv cba/$(CBA_NAME).zip csar/
+       mv cba/$(CBA_NAME).zip package/
 
-csar/:
-       mkdir csar/
+package/:
+       mkdir package/
 
 clean:
-       rm -rf csar/
+       rm -rf package/
        rm -f $(ONBOARDING_PACKAGE_NAME).zip
index 914405b..01e14b5 100644 (file)
@@ -5,7 +5,7 @@
         "author-email": "abdelmuhaimen.seaudi@orange.com",
         "user-groups": "ADMIN, OPERATION",
         "template_name": "vFW_CNF_CDS",
-        "template_version": "1.0.44",
+        "template_version": "1.0.45",
         "template_tags": "Samuli Silvius, vFW_CNF_CDS",
         "template_type": "DEFAULT"
     },
@@ -66,7 +66,7 @@
             "type": "maria-db",
             "url": "jdbc:mysql://mariadb-galera:3306/sdnctl",
             "username": "root",
-            "password": "secretpassword"
+            "password": "TepsMavaFota9+"
         }
     },
     "topology_template": {
index 8405b70..80d82af 100644 (file)
@@ -3,6 +3,6 @@ CSAR-Version: 1.0
 Created-By: Samuli Silvius <s.silvius@partner.samsung.com>
 Entry-Definitions: Definitions/vFW_CNF_CDS.json
 Template-Name: vFW_CNF_CDS
-Template-Version: 1.0.44
+Template-Version: 1.0.45
 Template-Type: DEFAULT
 Template-Tags: Samuli Silvius, vFW_CNF_CDS
index 888b842..401a0bd 100644 (file)
                             "param-name": "VNF_NAME",
                             "param-value": "${vnf_name}"
                         },
+                        {
+                            "param-name": "VF_MODULE_TYPE",
+                            "param-value": "vfmt"
+                        },
                         {
                             "param-name": "VF_MODULE_LABEL",
                             "param-value": "${vf-module-label}"
index 98cc9e7..3dc2eb5 100644 (file)
@@ -1,7 +1,7 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ .Values.vpg_name_0 }}-ssh-access
+  name: {{ .Values.vpg_name_0 }}-ssh
   labels:
     vnf-name: {{ .Values.vnf_name }}
     vf-module-name: {{ .Values.vpg_name_0 }}
index 754ff73..d65b6f9 100644 (file)
                         }
                     ],
                     "payload": [
+                        {
+                            "param-name": "VF_MODULE_TYPE",
+                            "param-value": "vfmt"
+                        },
                         {
                             "param-name": "resource-name",
                             "param-value": "vf_module_name"
index 70a95cb..bee80d1 100644 (file)
@@ -99,7 +99,7 @@
             "description": "",
             "required": false,
             "type": "string",
-            "default": "SDNC_Policy.Config_MS_ONAP_CNF_NAMING_TIMESTAMP"
+            "default": "SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP"
         },
         "input-param": false,
         "dictionary-name": "vf-naming-policy",
index 6f0461b..18511d5 100644 (file)
                         }
                     ],
                     "payload": [
+                        {
+                            "param-name": "VF_MODULE_TYPE",
+                            "param-value": "vfmt"
+                        },
                         {
                             "param-name": "resource-name",
                             "param-value": "vf_module_name"
index 394bf16..3e2d8c1 100644 (file)
                         }
                     ],
                     "payload": [
+                        {
+                            "param-name": "VF_MODULE_TYPE",
+                            "param-value": "vfmt"
+                        },
                         {
                             "param-name": "resource-name",
                             "param-value": "vf_module_name"
diff --git a/heat/vFW_CNF_CDS/templates/policy/README.txt b/heat/vFW_CNF_CDS/templates/policy/README.txt
deleted file mode 100644 (file)
index afb30f7..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-`policy.sh` script allows to create and push naming policy for CNF usecase. Execution of script can be checked by calling `./policy.sh -h`. As pdp doesn't expose it's service externally, this folder needs to be copied to some ONAP pod with bash and curl available (for example, mariadb-galera) and executed within.
-Scope of changes and reasoning behind is described in related ticket: https://jira.onap.org/browse/SDNC-1109.
-
-Example execution flow:
-```
-cd ..
-kubectl cp policy onap-mariadb-galera-mariadb-galera-0:/tmp/policy
-kubectl exec -it onap-mariadb-galera-mariadb-galera-0 bash
-cd /tmp/policy
-./policy.sh get #See that CNF naming policy is not uploaded yet
-./policy.sh create #Create and push CNF naming policy
-./policy.sh get #Verify that now it's visible
-```
diff --git a/heat/vFW_CNF_CDS/templates/policy/create.json b/heat/vFW_CNF_CDS/templates/policy/create.json
deleted file mode 100644 (file)
index 2443d55..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-    "configBody": "{ \"content\": { \"naming-models\": [ { \"naming-properties\": [ { \"property-name\": \"AIC_CLOUD_REGION\" }, { \"property-name\": \"CONSTANT\", \"property-value\": \"onap-nf\" }, { \"increment-sequence\": { \"increment\": \"1\", \"length\": \"3\", \"max\": \"zzz\", \"scope\": \"ENTIRETY\", \"sequence-type\": \"alpha-numeric\", \"start-value\": \"001\" }, \"property-name\": \"SEQUENCE\" }, { \"property-name\": \"DELIMITER\", \"property-value\": \"-\" } ], \"naming-recipe\": \"AIC_CLOUD_REGION|DELIMITER|CONSTANT|DELIMITER|SEQUENCE\", \"naming-type\": \"VNF\" }, { \"naming-properties\": [ { \"property-name\": \"VNF_NAME\" }, { \"increment-sequence\": { \"increment\": \"1\", \"length\": \"3\", \"max\": \"zzz\", \"scope\": \"ENTIRETY\", \"sequence-type\": \"alpha-numeric\", \"start-value\": \"001\" }, \"property-name\": \"SEQUENCE\" }, { \"property-name\": \"NFC_NAMING_CODE\" }, { \"property-name\": \"DELIMITER\", \"property-value\": \"-\" } ], \"naming-recipe\": \"VNF_NAME|DELIMITER|NFC_NAMING_CODE|DELIMITER|SEQUENCE\", \"naming-type\": \"VNFC\" }, { \"naming-properties\": [ { \"property-name\": \"VNF_NAME\" }, { \"property-name\": \"DELIMITER\", \"property-value\": \"-\" }, { \"property-name\": \"VF_MODULE_LABEL\" }, { \"increment-sequence\": { \"increment\": \"1\", \"length\": \"3\", \"max\": \"zzz\", \"scope\": \"PRECEEDING\", \"sequence-type\": \"alpha-numeric\", \"start-value\": \"01\" }, \"property-name\": \"SEQUENCE\" } ], \"naming-recipe\": \"VNF_NAME|DELIMITER|VF_MODULE_LABEL|DELIMITER|SEQUENCE\", \"naming-type\": \"VF-MODULE\" } ], \"policy-instance-name\": \"ONAP_VNF_NAMING_TIMESTAMP\" }, \"service\": \"SDNC-GenerateName\", \"version\": \"CSIT\" }",
-    "description": "ONAP_CNF_NAMING_TIMESTAMP",
-    "guard": "false",
-    "onapName": "SDNC",
-    "policyConfigType": "MicroService",
-    "policyName": "SDNC_Policy.ONAP_CNF_NAMING_TIMESTAMP",
-    "priority": "4",
-    "riskLevel": "4",
-    "riskType": "test"
-}
diff --git a/heat/vFW_CNF_CDS/templates/policy/get.json b/heat/vFW_CNF_CDS/templates/policy/get.json
deleted file mode 100644 (file)
index b9a6281..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-    "policyName": "SDNC_Policy.Config_MS_ONAP_CNF_NAMING_TIMESTAMP.*.xml"
-}
diff --git a/heat/vFW_CNF_CDS/templates/policy/policy.sh b/heat/vFW_CNF_CDS/templates/policy/policy.sh
deleted file mode 100755 (executable)
index a09ab0a..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-
-set -e
-
-check(){
-    if ! which curl >/dev/null 2>&1; then
-        echo "Fatal error, curl command not available" >&2
-        return 1
-    fi
-
-    for arg; do
-        if ! test -f "$arg"; then
-            echo "Fatal error, REST payload - $arg - not found in current directory" >&2
-            return 1
-        fi
-    done
-}
-
-query_policy(){
-    local mode="$1"
-    local content="$2"
-    local url="$3"
-
-    declare -a flags=(-kf -H 'Content-Type: application/json'
-                      -H 'ClientAuth: cHl0aG9uOnRlc3Q=' -u testpdp:alpha123
-                      -H 'Environment: TEST')
-
-    check "$content"
-
-    curl -X "$mode" -d @"$content" "${flags[@]}" "${PDP_URL:-https://pdp:8081}/$url"
-}
-
-case "$1" in
-    -h|--help|help|?|"")
-        echo "Script usage:"
-        echo "$0 get|verify - query policy for CNF policy"
-        echo "$0 create - Create CNF naming policy and push it"
-        echo "$0 update - Update CNF naming policy and push it"
-        ;;
-    get|verify)
-        query_policy POST get.json pdp/api/getConfig
-        ;;
-    create|update)
-        query_policy PUT create.json "pdp/api/$1Policy"
-        query_policy PUT push.json "pdp/api/pushPolicy"
-        ;;
-    *)
-        echo "Wrong usage, check '$0 -h'" >&2
-        exit 1
-        ;;
-esac
diff --git a/heat/vFW_CNF_CDS/templates/policy/push.json b/heat/vFW_CNF_CDS/templates/policy/push.json
deleted file mode 100644 (file)
index 9a8f9ae..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-    "pdpGroup": "default",
-    "policyName": "SDNC_Policy.ONAP_CNF_NAMING_TIMESTAMP",
-    "policyType": "MicroService"
-}