6151dc75f7fb02230f589c13be8fdcf9f9336874
[demo.git] / tutorials / ApacheCNF / templates / cba-dev / run-vf-base-ra.sh
1 #!/bin/sh
2
3 # ============LICENSE_START=======================================================
4 # Copyright (C) 2020 Orange
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # ============LICENSE_END=========================================================
19
20 REQ_ID=`shuf -i 1-1000000 -n 1`
21 SUB_REQ_ID=$REQ_ID"-"`shuf -i 1-1000 -n 1`
22 TEMPLATE_NAME="helm_apache"
23
24 curl --location --request POST 'http://localhost:8081/api/v1/execution-service/process' \
25 --header 'Authorization: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==' \
26 --header 'Content-Type: application/json' \
27 --data-raw '{
28     "commonHeader": {
29         "originatorId": "onap-me-cm-adapter",
30         "requestId": "'$REQ_ID'",
31         "subRequestId": "'$SUB_REQ_ID'"
32     },
33     "actionIdentifiers": {
34         "blueprintName": "APACHE",
35         "blueprintVersion": "1.0.0",
36         "actionName": "resource-assignment",
37         "mode": "sync"
38     },
39     "payload": {
40         "resource-assignment-request": {
41             "template-prefix": [
42                 "'$TEMPLATE_NAME'"
43             ],
44             "resolution-key": "ra-test-resolution",
45             "resource-assignment-properties": {
46                 "replica-count": 2,
47                 "aic-cloud-region": "RegionOne",
48                 "vnf-model-customization-uuid": "d73864db-1f6e-4e54-a533-a96773c926a4",
49                 "service-instance-id": "2afee7c4-8b16-4f2f-a567-48fb7948abcf",
50                 "vnf-id": "21dcbbd2-3ec2-4a9c-bb0d-599cafc16a1f",
51                 "vnf_name": "sample-vnf-name",
52                 "vf-module-name": "vf-module-name",
53                 "vf-module-label": "'$TEMPLATE_NAME'",
54                 "vf-module-type": "vf-module-type",
55                 "vf-module-model-customization-uuid": "d3ae2df9-95d4-48cc-a466-9f12dee80458",
56                 "vf-module-model-invariant-uuid": "564e55dc-3b90-4c9c-9e97-42f2c97d8f11",
57                 "vf-module-model-version": "3d55e2a6-7634-4ceb-98e9-2852d621a544",
58                 "vf-module-id": "3e6a0375-4b92-4bf5-9910-b0b893448a9c",
59                 "vf-naming-policy" : "SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP",
60                 "k8s-rb-profile-name": "vfw-cnf-cds-base-profile",
61                 "management-prefix-id" : 3
62             }
63         }
64     }
65 }' | jq '.payload | .["resource-assignment-response"] | .["meshed-template"] | .'$TEMPLATE_NAME' | fromjson | .["resource-accumulator-resolved-data"] '