Marco Platania | 9442f8f | 2019-06-17 09:12:21 -0400 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | echo "Create Generic SDNC Naming Policy for VNF" |
| 4 | |
| 5 | sleep 1 |
| 6 | |
| 7 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 8 | "configBody": "{ \"service\": \"SDNC-GenerateName\", \"version\": \"CSIT\", \"content\": { \"policy-instance-name\": \"ONAP_VNF_NAMING_TIMESTAMP\", \"naming-models\": [ { \"naming-properties\": [ { \"property-name\": \"AIC_CLOUD_REGION\" }, { \"property-name\": \"CONSTANT\", \"property-value\": \"ONAP-NF\" }, { \"property-name\": \"TIMESTAMP\" }, { \"property-value\": \"_\", \"property-name\": \"DELIMITER\" } ], \"naming-type\": \"VNF\", \"naming-recipe\": \"AIC_CLOUD_REGION|DELIMITER|CONSTANT|DELIMITER|TIMESTAMP\" }, { \"naming-properties\": [ { \"property-name\": \"VNF_NAME\" }, { \"property-name\": \"SEQUENCE\", \"increment-sequence\": { \"max\": \"zzz\", \"scope\": \"ENTIRETY\", \"start-value\": \"001\", \"length\": \"3\", \"increment\": \"1\", \"sequence-type\": \"alpha-numeric\" } }, { \"property-name\": \"NFC_NAMING_CODE\" }, { \"property-value\": \"_\", \"property-name\": \"DELIMITER\" } ], \"naming-type\": \"VNFC\", \"naming-recipe\": \"VNF_NAME|DELIMITER|NFC_NAMING_CODE|DELIMITER|SEQUENCE\" }, { \"naming-properties\": [ { \"property-name\": \"VNF_NAME\" }, { \"property-value\": \"_\", \"property-name\": \"DELIMITER\" }, { \"property-name\": \"VF_MODULE_LABEL\" }, { \"property-name\": \"VF_MODULE_TYPE\" }, { \"property-name\": \"SEQUENCE\", \"increment-sequence\": { \"max\": \"zzz\", \"scope\": \"PRECEEDING\", \"start-value\": \"01\", \"length\": \"3\", \"increment\": \"1\", \"sequence-type\": \"alpha-numeric\" } } ], \"naming-type\": \"VF-MODULE\", \"naming-recipe\": \"VNF_NAME|DELIMITER|VF_MODULE_LABEL|DELIMITER|VF_MODULE_TYPE|DELIMITER|SEQUENCE\" } ] } }", |
| 9 | "policyName": "SDNC_Policy.ONAP_VNF_NAMING_TIMESTAMP", |
| 10 | "policyConfigType": "MicroService", |
| 11 | "onapName": "SDNC", |
| 12 | "riskLevel": "4", |
| 13 | "riskType": "test", |
| 14 | "guard": "false", |
| 15 | "priority": "4", |
| 16 | "description": "ONAP_VNF_NAMING_TIMESTAMP" |
| 17 | }' 'https://pdp:8081/pdp/api/createPolicy' |
| 18 | |
| 19 | sleep 10 |
| 20 | |
| 21 | echo "Pushing SDNC Naming Policy" |
| 22 | |
| 23 | sleep 1 |
| 24 | |
| 25 | echo "pushPolicy : PUT : SDNC_Policy.ONAP_VNF_NAMING_TIMESTAMP" |
| 26 | curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ |
| 27 | "pdpGroup": "default", |
| 28 | "policyName": "SDNC_Policy.ONAP_VNF_NAMING_TIMESTAMP", |
| 29 | "policyType": "MicroService" |
| 30 | }' 'https://pdp:8081/pdp/api/pushPolicy' |
| 31 | |
| 32 | sleep 10 |
| 33 | |
| 34 | echo "Validate that SDNC Naming Policy has been successfully created" |
| 35 | |
| 36 | sleep 1 |
| 37 | |
| 38 | curl -k -v --silent -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{"policyName": ".*"}' 'https://pdp:8081/pdp/api/getConfig' |