3 # ============LICENSE_START===============================================
4 # Copyright (C) 2020 Nordix Foundation. All rights reserved.
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
10 # http://www.apache.org/licenses/LICENSE-2.0
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 # ============LICENSE_END=================================================
20 # The scripts in data/ will generate some dummy data in the running system.
22 # one InfoProducer in ICS
27 # ./prepareIcsData.sh [ICS port] [http/https]
31 SHELL_FOLDER=$(cd "$(dirname "$0")";pwd)
33 echo "using ics port: "$ics_port
34 echo "using protocol: "$httpx
38 curl -skw " %{http_code}" $httpx://localhost:$ics_port/status
42 echo "Create InfoType:"
43 curl -X PUT -skw %{http_code} $httpx://localhost:$ics_port/data-producer/v1/info-types/type1 -H accept:application/json -H Content-Type:application/json --data-binary @${SHELL_FOLDER}/testdata/ICS/InfoType.json
48 curl -X GET -skw %{http_code} $httpx://localhost:$ics_port/data-producer/v1/info-types -H Content-Type:application/json | jq
51 # Get Individual InfoType
52 echo "Get Individual InfoType:"
53 curl -X GET -skw %{http_code} $httpx://localhost:$ics_port/data-producer/v1/info-types/type1 -H Content-Type:application/json | jq
57 echo "Create InfoProducer:"
58 curl -X PUT -skw %{http_code} $httpx://localhost:$ics_port/data-producer/v1/info-producers/1 -H Content-Type:application/json --data-binary @${SHELL_FOLDER}/testdata/ICS/InfoProducer.json
62 echo "Get InfoProducers:"
63 curl -X GET -skw %{http_code} $httpx://localhost:$ics_port/data-producer/v1/info-producers -H Content-Type:application/json | jq
66 # Get Individual InfoProducer
67 echo "Get Individual InfoProducer:"
68 curl -X GET -skw %{http_code} $httpx://localhost:$ics_port/data-producer/v1/info-producers/1 -H Content-Type:application/json | jq
71 # Get Individual InfoProducer Status
72 echo "Get Individual InfoProducer:"
73 curl -X GET -skw %{http_code} $httpx://localhost:$ics_port/data-producer/v1/info-producers/1/status -H Content-Type:application/json | jq
77 echo "Create InfoJob Of A Certain Type type1:"
78 curl -X PUT -skw %{http_code} $httpx://localhost:$ics_port/A1-EI/v1/eijobs/job1 -H Content-Type:application/json --data-binary @${SHELL_FOLDER}/testdata/ICS/InfoJob.json
83 curl -X GET -skw %{http_code} $httpx://localhost:$ics_port/A1-EI/v1/eijobs -H Content-Type:application/json | jq
86 # Get Individual InfoJob:
87 echo "Get Individual InfoJob:"
88 curl -X GET -skw %{http_code} $httpx://localhost:$ics_port/A1-EI/v1/eijobs/job1 -H Content-Type:application/json | jq