From 3a3e9fcdd1141928473b5f793e224204eafe8f1b Mon Sep 17 00:00:00 2001 From: Lukasz Rajewski Date: Fri, 9 Oct 2020 20:59:32 +0200 Subject: vFW CDS CNF CBA with native k8s profile upload vFW CDS CNF CBA with native k8s profile upload Change-Id: Ic3357982af534ea261d4d617e050dc33bc339645 Issue-ID: INT-1658 Signed-off-by: Lukasz Rajewski --- heat/vFW_CNF_CDS/templates/cba-dev/build.sh | 39 +++++++++++++ heat/vFW_CNF_CDS/templates/cba-dev/deploy.sh | 22 +++++++ .../templates/cba-dev/run-vf-base-ra.sh | 65 +++++++++++++++++++++ .../vFW_CNF_CDS/templates/cba-dev/run-vf-pkg-ra.sh | 67 ++++++++++++++++++++++ heat/vFW_CNF_CDS/templates/cba-dev/run-vnf-ra.sh | 61 ++++++++++++++++++++ 5 files changed, 254 insertions(+) create mode 100755 heat/vFW_CNF_CDS/templates/cba-dev/build.sh create mode 100755 heat/vFW_CNF_CDS/templates/cba-dev/deploy.sh create mode 100755 heat/vFW_CNF_CDS/templates/cba-dev/run-vf-base-ra.sh create mode 100755 heat/vFW_CNF_CDS/templates/cba-dev/run-vf-pkg-ra.sh create mode 100755 heat/vFW_CNF_CDS/templates/cba-dev/run-vnf-ra.sh (limited to 'heat/vFW_CNF_CDS/templates/cba-dev') diff --git a/heat/vFW_CNF_CDS/templates/cba-dev/build.sh b/heat/vFW_CNF_CDS/templates/cba-dev/build.sh new file mode 100755 index 00000000..a7a34061 --- /dev/null +++ b/heat/vFW_CNF_CDS/templates/cba-dev/build.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +# ============LICENSE_START======================================================= +# Copyright (C) 2020 Orange +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END========================================================= + +cd ../cba/ + +mvn clean install + +if [ $? -eq 1 ] +then + echo "----------------" + echo "CBA BUILD FAILED" + echo "----------------" + exit 1 +fi + +CBA_NAME=`ls target/*.zip` +cp $CBA_NAME ../cba-dev/cba.zip + +echo "-----------------" +echo "CBA BUILD SUCCESS" +echo "-----------------" + +cd ../cba-dev diff --git a/heat/vFW_CNF_CDS/templates/cba-dev/deploy.sh b/heat/vFW_CNF_CDS/templates/cba-dev/deploy.sh new file mode 100755 index 00000000..8ddbe493 --- /dev/null +++ b/heat/vFW_CNF_CDS/templates/cba-dev/deploy.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +# ============LICENSE_START======================================================= +# Copyright (C) 2020 Orange +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END========================================================= + +curl --location --request POST 'http://127.0.0.1:8081/api/v1/blueprint-model/publish' \ +--header 'Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==' \ +--form 'file=@cba.zip' | jq diff --git a/heat/vFW_CNF_CDS/templates/cba-dev/run-vf-base-ra.sh b/heat/vFW_CNF_CDS/templates/cba-dev/run-vf-base-ra.sh new file mode 100755 index 00000000..840bb859 --- /dev/null +++ b/heat/vFW_CNF_CDS/templates/cba-dev/run-vf-base-ra.sh @@ -0,0 +1,65 @@ +#!/bin/sh + +# ============LICENSE_START======================================================= +# Copyright (C) 2020 Orange +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END========================================================= + +REQ_ID=`shuf -i 1-1000000 -n 1` +SUB_REQ_ID=$REQ_ID"-"`shuf -i 1-1000 -n 1` +TEMPLATE_NAME="base_template" + +curl --location --request POST 'http://localhost:8081/api/v1/execution-service/process' \ +--header 'Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "commonHeader": { + "originatorId": "onap-me-cm-adapter", + "requestId": "'$REQ_ID'", + "subRequestId": "'$SUB_REQ_ID'" + }, + "actionIdentifiers": { + "blueprintName": "vFW_CNF_CDS", + "blueprintVersion": "7.0.0", + "actionName": "resource-assignment", + "mode": "sync" + }, + "payload": { + "resource-assignment-request": { + "template-prefix": [ + "'$TEMPLATE_NAME'" + ], + "resolution-key": "ra-test-resolution", + "resource-assignment-properties": { + "vpg-management-port": 100, + "aic-cloud-region": "RegionOne", + "vnf-model-customization-uuid": "d73864db-1f6e-4e54-a533-a96773c926a4", + "service-instance-id": "2afee7c4-8b16-4f2f-a567-48fb7948abcf", + "vnf-id": "21dcbbd2-3ec2-4a9c-bb0d-599cafc16a1f", + "vnf_name": "sample-vnf-name", + "vf-module-name": "vf-module-name", + "vf-module-label": "'$TEMPLATE_NAME'", + "vf-module-type": "vf-module-type", + "vf-module-model-customization-uuid": "d3ae2df9-95d4-48cc-a466-9f12dee80458", + "vf-module-model-invariant-uuid": "564e55dc-3b90-4c9c-9e97-42f2c97d8f11", + "vf-module-model-version": "3d55e2a6-7634-4ceb-98e9-2852d621a544", + "vf-module-id": "3e6a0375-4b92-4bf5-9910-b0b893448a9c", + "vf-naming-policy" : "SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP", + "k8s-rb-profile-name": "vfw-cnf-cds-base-profile", + "management-prefix-id" : 3 + } + } + } +}' | jq '.payload | .["resource-assignment-response"] | .["meshed-template"] | .'$TEMPLATE_NAME' | fromjson | .["resource-accumulator-resolved-data"] ' diff --git a/heat/vFW_CNF_CDS/templates/cba-dev/run-vf-pkg-ra.sh b/heat/vFW_CNF_CDS/templates/cba-dev/run-vf-pkg-ra.sh new file mode 100755 index 00000000..b7835626 --- /dev/null +++ b/heat/vFW_CNF_CDS/templates/cba-dev/run-vf-pkg-ra.sh @@ -0,0 +1,67 @@ +#!/bin/sh + +# ============LICENSE_START======================================================= +# Copyright (C) 2020 Orange +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END========================================================= + +REQ_ID=`shuf -i 1-1000000 -n 1` +SUB_REQ_ID=$REQ_ID"-"`shuf -i 1-1000 -n 1` +TEMPLATE_NAME="vpkg" + +curl --location --request POST 'http://localhost:8081/api/v1/execution-service/process' \ +--header 'Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "commonHeader": { + "originatorId": "onap-me-cm-adapter", + "requestId": "'$REQ_ID'", + "subRequestId": "'$SUB_REQ_ID'" + }, + "actionIdentifiers": { + "blueprintName": "vFW_CNF_CDS", + "blueprintVersion": "7.0.0", + "actionName": "resource-assignment", + "mode": "sync" + }, + "payload": { + "resource-assignment-request": { + "template-prefix": [ + "'$TEMPLATE_NAME'" + ], + "resolution-key": "ra-test-resolution", + "resource-assignment-properties": { + "vpg-management-port": 100, + "aic-cloud-region": "RegionOne", + "vnf-model-customization-uuid": "d73864db-1f6e-4e54-a533-a96773c926a4", + "service-instance-id": "2afee7c4-8b16-4f2f-a567-48fb7948abcf", + "vnf-id": "21dcbbd2-3ec2-4a9c-bb0d-599cafc16a1f", + "vnf_name": "sample-vnf-name", + "vf-module-name": "vf-module-name", + "vf-module-label": "'$TEMPLATE_NAME'", + "vf-module-type": "vf-module-type", + "vf-module-model-customization-uuid": "d3ae2df9-95d4-48cc-a466-9f12dee80458", + "vf-module-model-invariant-uuid": "564e55dc-3b90-4c9c-9e97-42f2c97d8f11", + "vf-module-model-version": "3d55e2a6-7634-4ceb-98e9-2852d621a544", + "vf-module-id": "3e6a0375-4b92-4bf5-9910-b0b893448a9c", + "vf-naming-policy" : "SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP", + "k8s-rb-profile-name": "vpkg-modified", + "k8s-rb-profile-source": "vfw-cnf-cds-vpkg-profile", + "k8s-rb-profile-namespace": "test", + "management-prefix-id" : 3 + } + } + } +}' | jq '.payload | .["resource-assignment-response"] | .["meshed-template"] | .'$TEMPLATE_NAME' | fromjson | .["resource-accumulator-resolved-data"] ' diff --git a/heat/vFW_CNF_CDS/templates/cba-dev/run-vnf-ra.sh b/heat/vFW_CNF_CDS/templates/cba-dev/run-vnf-ra.sh new file mode 100755 index 00000000..8261ace3 --- /dev/null +++ b/heat/vFW_CNF_CDS/templates/cba-dev/run-vnf-ra.sh @@ -0,0 +1,61 @@ +#!/bin/sh + +# ============LICENSE_START======================================================= +# Copyright (C) 2020 Orange +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============LICENSE_END========================================================= + +REQ_ID=`shuf -i 1-1000000 -n 1` +SUB_REQ_ID=$REQ_ID"-"`shuf -i 1-1000 -n 1` + +curl --location --request POST 'http://localhost:8081/api/v1/execution-service/process' \ +--header 'Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "commonHeader": { + "originatorId": "onap-me-cm-adapter", + "requestId": "'$REQ_ID'", + "subRequestId": "'$SUB_REQ_ID'" + }, + "actionIdentifiers": { + "blueprintName": "vFW_CNF_CDS", + "blueprintVersion": "7.0.0", + "actionName": "resource-assignment", + "mode": "sync" + }, + "payload": { + "resource-assignment-request": { + "template-prefix": [ + "vnf" + ], + "resolution-key": "ra-test-resolution", + "resource-assignment-properties": { + "vpg-management-port": 100, + "aic-cloud-region": "RegionOne", + "vnf-model-customization-uuid": "d73864db-1f6e-4e54-a533-a96773c926a4", + "service-instance-id": "2afee7c4-8b16-4f2f-a567-48fb7948abcf", + "vnf-id": "21dcbbd2-3ec2-4a9c-bb0d-599cafc16a1f", + "vnf_name": "sample-vnf-name", + "k8s-rb-profile-namespace": "vfw-namespace", + "int_private1_net_cidr" : "192.168.10.0/24", + "int_private2_net_cidr" : "192.168.20.0/24", + "onap_private_net_cidr" : "10.0.0.0/16", + "private1-prefix-id" : 2, + "private2-prefix-id" : 1 + } + } + } +}' | jq '.payload | .["resource-assignment-response"] | .["meshed-template"] | .vnf | fromjson | .["resource-accumulator-resolved-data"] ' + -- cgit 1.2.3-korg