aboutsummaryrefslogtreecommitdiffstats
path: root/tutorials/ApacheCNF/templates/cba-dev
diff options
context:
space:
mode:
authorLukasz Rajewski <lukasz.rajewski@orange.com>2022-03-22 00:52:38 +0100
committerLukasz Rajewski <lukasz.rajewski@orange.com>2022-03-22 10:43:21 +0100
commita112ebd160d3acc20e6766d8550d757a0581797d (patch)
treead080e367a66f1e8777288943da79e87bbecbb14 /tutorials/ApacheCNF/templates/cba-dev
parentf491b9fa0e1f5481065f9071aca469180635778e (diff)
[APACHE] Add Apache CNF use case files
Issue-ID: INT-2094 Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com> Signed-off-by: Michal Chabiera <michal.chabiera@orange.com> Signed-off-by: Michal Grzesik <michal.grzesik@orange.com> Change-Id: Ie8f72b9804f1055f49e1bc85dd0d712841eb0f5d
Diffstat (limited to 'tutorials/ApacheCNF/templates/cba-dev')
-rw-r--r--tutorials/ApacheCNF/templates/cba-dev/bootstrap.sh23
-rw-r--r--tutorials/ApacheCNF/templates/cba-dev/build.sh39
-rw-r--r--tutorials/ApacheCNF/templates/cba-dev/deploy.sh22
-rw-r--r--tutorials/ApacheCNF/templates/cba-dev/enrich.sh23
-rw-r--r--tutorials/ApacheCNF/templates/cba-dev/run-vf-base-ra.sh65
-rw-r--r--tutorials/ApacheCNF/templates/cba-dev/run-vnf-config.sh49
-rw-r--r--tutorials/ApacheCNF/templates/cba-dev/run-vnf-ra.sh57
7 files changed, 278 insertions, 0 deletions
diff --git a/tutorials/ApacheCNF/templates/cba-dev/bootstrap.sh b/tutorials/ApacheCNF/templates/cba-dev/bootstrap.sh
new file mode 100644
index 00000000..74ec06a0
--- /dev/null
+++ b/tutorials/ApacheCNF/templates/cba-dev/bootstrap.sh
@@ -0,0 +1,23 @@
+#!/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/bootstrap' \
+--header 'Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==' \
+--header 'Content-Type: application/json' \
+--data '{"loadModelType": true, "loadResourceDictionary": true, "loadCBA": false}' | jq
diff --git a/tutorials/ApacheCNF/templates/cba-dev/build.sh b/tutorials/ApacheCNF/templates/cba-dev/build.sh
new file mode 100644
index 00000000..a7a34061
--- /dev/null
+++ b/tutorials/ApacheCNF/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/tutorials/ApacheCNF/templates/cba-dev/deploy.sh b/tutorials/ApacheCNF/templates/cba-dev/deploy.sh
new file mode 100644
index 00000000..59c9807d
--- /dev/null
+++ b/tutorials/ApacheCNF/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' \
+--header 'Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==' \
+--form 'file=@cba.zip' | jq
diff --git a/tutorials/ApacheCNF/templates/cba-dev/enrich.sh b/tutorials/ApacheCNF/templates/cba-dev/enrich.sh
new file mode 100644
index 00000000..632cb89f
--- /dev/null
+++ b/tutorials/ApacheCNF/templates/cba-dev/enrich.sh
@@ -0,0 +1,23 @@
+#!/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/enrich' \
+--header 'Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==' \
+-o 'cba.zip' \
+--form 'file=@../package_native/CBA.zip' | jq
diff --git a/tutorials/ApacheCNF/templates/cba-dev/run-vf-base-ra.sh b/tutorials/ApacheCNF/templates/cba-dev/run-vf-base-ra.sh
new file mode 100644
index 00000000..6151dc75
--- /dev/null
+++ b/tutorials/ApacheCNF/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="helm_apache"
+
+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": "APACHE",
+ "blueprintVersion": "1.0.0",
+ "actionName": "resource-assignment",
+ "mode": "sync"
+ },
+ "payload": {
+ "resource-assignment-request": {
+ "template-prefix": [
+ "'$TEMPLATE_NAME'"
+ ],
+ "resolution-key": "ra-test-resolution",
+ "resource-assignment-properties": {
+ "replica-count": 2,
+ "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/tutorials/ApacheCNF/templates/cba-dev/run-vnf-config.sh b/tutorials/ApacheCNF/templates/cba-dev/run-vnf-config.sh
new file mode 100644
index 00000000..a211a6bc
--- /dev/null
+++ b/tutorials/ApacheCNF/templates/cba-dev/run-vnf-config.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# ============LICENSE_START=======================================================
+# Copyright (C) 2021 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`
+ACTION=$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": "APACHE",
+ "blueprintVersion": "1.0.0",
+ "actionName": "'config-$ACTION'",
+ "mode": "sync"
+ },
+ "payload": {
+ "'config-$ACTION-request'": {
+ "resolution-key": "VF_apache_k8s_demo_CNF",
+ "'config-$ACTION-properties'": {
+ "service-instance-id": "2a2de3ec-35a4-4e1d-b313-ac5c4c8813a8",
+ "vnf-id": "6b6ff775-a170-4ce4-bcd0-85645d738390"
+ }
+ }
+ }
+}' | jq '.payload | .["'config-$ACTION-response'"]'
+
diff --git a/tutorials/ApacheCNF/templates/cba-dev/run-vnf-ra.sh b/tutorials/ApacheCNF/templates/cba-dev/run-vnf-ra.sh
new file mode 100644
index 00000000..9cf4c2a4
--- /dev/null
+++ b/tutorials/ApacheCNF/templates/cba-dev/run-vnf-ra.sh
@@ -0,0 +1,57 @@
+#!/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": "APACHE",
+ "blueprintVersion": "1.0.0",
+ "actionName": "resource-assignment",
+ "mode": "sync"
+ },
+ "payload": {
+ "resource-assignment-request": {
+ "template-prefix": [
+ "vnf"
+ ],
+ "resolution-key": "ra-test-resolution",
+ "resource-assignment-properties": {
+ "replica-count": 2,
+ "aic-cloud-region": "RegionOne",
+ "vnf-model-customization-uuid": "d73864db-1f6e-4e54-a533-a96773c926a4",
+ "service-instance-id": "2afee7c4-8b16-4f2f-a567-48fb7948abcf",
+ "vnf-id": "51274ece-55ca-4cbc-b7c4-0da0dcc65d38",
+ "vnf_name": "sample-vnf-name",
+ "k8s-rb-profile-namespace": "vfw-namespace",
+ "k8s-rb-profile-k8s-version": "1.18.9"
+ }
+ }
+ }
+}' | jq '.payload | .["resource-assignment-response"] | .["meshed-template"] | .vnf | fromjson | .["resource-accumulator-resolved-data"] '
+