From: ecaiyanlinux Date: Mon, 31 May 2021 12:04:53 +0000 (+0800) Subject: Add docker-compose file for Non-RT-RIC X-Git-Tag: 2.2.0~10 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=f44c0a436ce33157b817f189d7d3c45a35469e3c;p=oam.git Add docker-compose file for Non-RT-RIC Signed-off-by: ecaiyanlinux Issue-ID: NONRTRIC-520 Change-Id: I06298055d7fb8bbc81b8ed5f699aa7ffdb1d9651 --- diff --git a/solution/integration/smo/non-rt-ric/config/control-panel/nginx.conf b/solution/integration/smo/non-rt-ric/config/control-panel/nginx.conf new file mode 100644 index 0000000..916caef --- /dev/null +++ b/solution/integration/smo/non-rt-ric/config/control-panel/nginx.conf @@ -0,0 +1,23 @@ +events{} + +http { + include /etc/nginx/mime.types; + resolver 127.0.0.11; + server { + listen 8080; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + location /a1-policy/ { + set $upstream nonrtric-gateway; + proxy_pass http://$upstream:9090; + } + location /data-producer/{ + set $upstream nonrtric-gateway; + proxy_pass http://$upstream:9090; + } + location / { + try_files $uri $uri/ /index.html; + } + } +} \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/config/nonrtric-gateway/application-nonrtricgateway.yaml b/solution/integration/smo/non-rt-ric/config/nonrtric-gateway/application-nonrtricgateway.yaml new file mode 100644 index 0000000..9132df3 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/config/nonrtric-gateway/application-nonrtricgateway.yaml @@ -0,0 +1,56 @@ +################################################################################ +# Copyright (c) 2021 Nordix Foundation. # +# # +# 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. # +################################################################################ + +server: + port: 9090 +spring: + cloud: + gateway: + httpclient: + ssl: + useInsecureTrustManager: true + wiretap: true + httpserver: + wiretap: true + routes: + - id: A1-Policy + uri: http://policy-agent:8081 + predicates: + - Path=/a1-policy/** + - id: A1-EI + uri: http://ecs:8083 + predicates: + - Path=/ei-producer/** + - id: A1-EI2 + uri: http://ecs:8083 + predicates: + - Path=/data-producer/** +management: + endpoint: + gateway: + enabled: true + endpoints: + web: + exposure: + include: "gateway,loggers,logfile,health,info,metrics,threaddump,heapdump" +logging: + level: + ROOT: ERROR + org.springframework: ERROR + org.springframework.cloud.gateway: INFO + reactor.netty: INFO + file: + name: /var/log/nonrtric-gateway/application.log diff --git a/solution/integration/smo/non-rt-ric/config/pms/application_configuration.json b/solution/integration/smo/non-rt-ric/config/pms/application_configuration.json new file mode 100644 index 0000000..938c68f --- /dev/null +++ b/solution/integration/smo/non-rt-ric/config/pms/application_configuration.json @@ -0,0 +1,39 @@ +{ + "config":{ + "//description":"Application configuration", + "ric":[ + { + "name":"ric1", + "baseUrl":"https://a1-sim-OSC:8185/", + "managedElementIds":[ + "kista_1", + "kista_2" + ] + }, + { + "name":"ric2", + "baseUrl":"https://a1-sim-STD-v2:8185/", + "managedElementIds":[ + "kista_1", + "kista_2" + ] + } + ], + "streams_publishes":{ + "dmaap_publisher":{ + "type":"message_router", + "dmaap_info":{ + "topic_url":"http://onap-dmaap:3904/events/A1-POLICY-AGENT-WRITE" + } + } + }, + "streams_subscribes":{ + "dmaap_subscriber":{ + "type":"message_router", + "dmaap_info":{ + "topic_url":"http://onap-dmaap:3904/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" + } + } + } + } + } \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/config/pms/application_configuration.json.nosdnc b/solution/integration/smo/non-rt-ric/config/pms/application_configuration.json.nosdnc new file mode 100644 index 0000000..938c68f --- /dev/null +++ b/solution/integration/smo/non-rt-ric/config/pms/application_configuration.json.nosdnc @@ -0,0 +1,39 @@ +{ + "config":{ + "//description":"Application configuration", + "ric":[ + { + "name":"ric1", + "baseUrl":"https://a1-sim-OSC:8185/", + "managedElementIds":[ + "kista_1", + "kista_2" + ] + }, + { + "name":"ric2", + "baseUrl":"https://a1-sim-STD-v2:8185/", + "managedElementIds":[ + "kista_1", + "kista_2" + ] + } + ], + "streams_publishes":{ + "dmaap_publisher":{ + "type":"message_router", + "dmaap_info":{ + "topic_url":"http://onap-dmaap:3904/events/A1-POLICY-AGENT-WRITE" + } + } + }, + "streams_subscribes":{ + "dmaap_subscriber":{ + "type":"message_router", + "dmaap_info":{ + "topic_url":"http://onap-dmaap:3904/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" + } + } + } + } + } \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/config/pms/application_configuration.json.sdnc b/solution/integration/smo/non-rt-ric/config/pms/application_configuration.json.sdnc new file mode 100644 index 0000000..d9c7197 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/config/pms/application_configuration.json.sdnc @@ -0,0 +1,48 @@ +{ + "config":{ + "controller": [ + { + "name": "controller1", + "baseUrl": "https://a1controller:8443", + "userName": "admin", + "password": "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" + } + ], + "ric":[ + { + "name":"ric1", + "controller": "controller1", + "baseUrl":"https://a1-sim-OSC:8185/", + "managedElementIds":[ + "kista_1", + "kista_2" + ] + }, + { + "name":"ric2", + "controller": "controller1", + "baseUrl":"https://a1-sim-STD-v2:8185/", + "managedElementIds":[ + "kista_1", + "kista_2" + ] + } + ], + "streams_publishes":{ + "dmaap_publisher":{ + "type":"message_router", + "dmaap_info":{ + "topic_url":"http://onap-dmaap:3904/events/A1-POLICY-AGENT-WRITE" + } + } + }, + "streams_subscribes":{ + "dmaap_subscriber":{ + "type":"message_router", + "dmaap_info":{ + "topic_url":"http://onap-dmaap:3904/events/A1-POLICY-AGENT-READ/users/policy-agent?timeout=15000&limit=100" + } + } + } + } + } diff --git a/solution/integration/smo/non-rt-ric/data/prepareDmaapMsg.sh b/solution/integration/smo/non-rt-ric/data/prepareDmaapMsg.sh new file mode 100755 index 0000000..a100b32 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/prepareDmaapMsg.sh @@ -0,0 +1,155 @@ +#!/bin/bash + +# ============LICENSE_START=============================================== +# Copyright (C) 2020 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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================================================= +# + +# The scripts in data/ will generate some dummy data in the running system. +# It will create: +# one policy type in a1-sim-OSC +# one service in policy agent +# one policy in a1-sim-OSC +# one policy in a1-sim-STD + +# Run command: +# ./prepareDmaapMsg.sh [dmaap-mr port] [a1-sim-OSC port] [a1-sim-STD port] [http/https] + +dmaa_mr_port=${1:-3904} +a1_sim_OSC_port=${2:-30001} +a1_sim_STD_port=${3:-30003} +a1_sim_STD_v2_port=${4:-30005} +httpx=${5:-"http"} + +echo "using dmaap-mr port: "$dmaa_mr_port +echo "using a1-sim-OSC port: "$a1_sim_OSC_port +echo "using a1-sim-STD port: "$a1_sim_STD_port +echo "using a1-sim-STD-v2 port: "$a1_sim_STD_v2_port +echo "using protocol: "$httpx +echo -e "\n" + +echo "dmaap-mr topics:" +curl -skw %{http_code} $httpx://localhost:$dmaa_mr_port/topics/listAll +echo -e "\n" + +echo "dmaap-mr create topic A1-POLICY-AGENT-READ:" +curl -skw %{http_code} -X POST "$httpx://localhost:$dmaa_mr_port/topics/create" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"topicName\": \"A1-POLICY-AGENT-READ\", \"topicDescription\": \"test topic\", \"partitionCount\": 1, \"replicationCount\": 1, \"transactionEnabled\": \"false\"}" +echo -e "\n" + +echo "dmaap-mr create topic A1-POLICY-AGENT-WRITE:" +curl -skw %{http_code} -X POST "$httpx://localhost:$dmaa_mr_port/topics/create" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"topicName\": \"A1-POLICY-AGENT-WRITE\", \"topicDescription\": \"test topic\", \"partitionCount\": 1, \"replicationCount\": 1, \"transactionEnabled\": \"false\"}" +echo -e "\n" + +echo "dmaap-mr topics:" +curl -skw %{http_code} $httpx://localhost:$dmaa_mr_port/topics/listAll +echo -e "\n" + +echo "ric1 version:" +curl -skw %{http_code} $httpx://localhost:$a1_sim_OSC_port/counter/interface +echo -e "\n" + +echo "ric2 version:" +curl -skw %{http_code} $httpx://localhost:$a1_sim_STD_port/counter/interface +echo -e "\n" + +echo "ric3 version:" +curl -skw %{http_code} $httpx://localhost:$a1_sim_STD_v2_port/counter/interface +echo -e "\n" + +echo "create policy type 1 to ric1:" +curl -X PUT -skw %{http_code} $httpx://localhost:$a1_sim_OSC_port/policytype?id=1 -H Content-Type:application/json --data-binary @testdata/OSC/policy_type.json +echo -e "\n" + +echo "create policy type 2 to ric3:" +curl -skw %{http_code} $httpx://localhost:$a1_sim_STD_v2_port/policytype?id=2 -X PUT -H Accept:application/json -H Content-Type:application/json -H X-Requested-With:XMLHttpRequest --data-binary @testdata/v2/policy_type.json +echo -e "\n" + +for i in {1..12}; do + echo "policy types from policy agent:" + curlString="curl -skw %{http_code} $httpx://localhost:8091/policy_types" + res=$($curlString) + echo "$res" + expect="[\"1\",\"2\"]200" + if [ "$res" == "$expect" ]; then + echo -e "\n" + break; + else + sleep $i + fi +done + +## Using PMS v1 interface +echo "create service 1 to policy agent via dmaap_mr:" +curl -k -X POST -sw %{http_code} -H accept:application/json -H Content-Type:application/json "$httpx://localhost:$dmaa_mr_port/events/A1-POLICY-AGENT-READ/" --data-binary @testdata/dmaap/v1/dmaap-msg-service-create.json +echo -e "\n" + +echo "get result from mr of previous request:" +curl -X GET "$httpx://localhost:$dmaa_mr_port/events/A1-POLICY-AGENT-WRITE/users/policy-agent?timeout=15000&limit=100" -H "accept: application/json" -H "Content-Type: application/json" | jq . +echo -e "\n" + +echo "create policies to ric1 & ric2 & ric3 with type1 and service1 via dmaa_mr:" +curl -k -X POST -sw %{http_code} -H accept:application/json -H Content-Type:application/json "$httpx://localhost:$dmaa_mr_port/events/A1-POLICY-AGENT-READ/" --data-binary @testdata/dmaap/v1/dmaap-msg-policy-create.json +echo -e "\n" + +echo "get result from mr of previous request:" +curl -X GET "$httpx://localhost:$dmaa_mr_port/events/A1-POLICY-AGENT-WRITE/users/policy-agent?timeout=15000&limit=100" -H "accept: application/json" -H "Content-Type: application/json" | jq . +echo -e "\n" + +echo "get policy from policy agent via dmaap_mr:" +curl -k -X POST -sw %{http_code} -H accept:application/json -H Content-Type:application/json "$httpx://localhost:$dmaa_mr_port/events/A1-POLICY-AGENT-READ/" --data-binary @testdata/dmaap/v1/dmaap-msg-policy-get.json +echo -e "\n" + +echo "get result from mr of previous request:" +curl -X GET "$httpx://localhost:$dmaa_mr_port/events/A1-POLICY-AGENT-WRITE/users/policy-agent?timeout=15000&limit=100" -H "accept: application/json" -H "Content-Type: application/json" | jq . +echo -e "\n" + +## Using PMS v2 interface +echo "create service 2 to policy agent via dmaap_mr:" +curl -k -X POST -sw %{http_code} -H accept:application/json -H Content-Type:application/json "$httpx://localhost:$dmaa_mr_port/events/A1-POLICY-AGENT-READ/" --data-binary @testdata/dmaap/v2/dmaap-msg-service-create.json +echo -e "\n" + +echo "get result from mr of previous request:" +curl -X GET "$httpx://localhost:$dmaa_mr_port/events/A1-POLICY-AGENT-WRITE/users/policy-agent?timeout=15000&limit=100" -H "accept: application/json" -H "Content-Type: application/json" | jq . +echo -e "\n" + +echo "create policies to ric1 & ric2 & ric3 with type1 and service1 via dmaa_mr:" +curl -k -X POST -sw %{http_code} -H accept:application/json -H Content-Type:application/json "$httpx://localhost:$dmaa_mr_port/events/A1-POLICY-AGENT-READ/" --data-binary @testdata/dmaap/v2/dmaap-msg-policy-create.json +echo -e "\n" + +echo "get result from mr of previous request:" +curl -X GET "$httpx://localhost:$dmaa_mr_port/events/A1-POLICY-AGENT-WRITE/users/policy-agent?timeout=15000&limit=100" -H "accept: application/json" -H "Content-Type: application/json" | jq . +echo -e "\n" + +echo "get policy from policy agent via dmaap_mr:" +curl -k -X POST -sw %{http_code} -H accept:application/json -H Content-Type:application/json "$httpx://localhost:$dmaa_mr_port/events/A1-POLICY-AGENT-READ/" --data-binary @testdata/dmaap/v2/dmaap-msg-policy-get.json +echo -e "\n" + +echo "get result from mr of previous request:" +curl -X GET "$httpx://localhost:$dmaa_mr_port/events/A1-POLICY-AGENT-WRITE/users/policy-agent?timeout=15000&limit=100" -H "accept: application/json" -H "Content-Type: application/json" | jq . +echo -e "\n" + +## Get metric from rics +echo "policy numbers from ric1:" +curl -skw %{http_code} $httpx://localhost:$a1_sim_OSC_port/counter/num_instances +echo -e "\n" + +echo "policy numbers from ric2:" +curl -skw %{http_code} $httpx://localhost:$a1_sim_STD_port/counter/num_instances +echo -e "\n" + +echo "policy numbers from ric3:" +curl -skw %{http_code} $httpx://localhost:$a1_sim_STD_v2_port/counter/num_instances +echo -e "\n" + diff --git a/solution/integration/smo/non-rt-ric/data/prepareEcsData.sh b/solution/integration/smo/non-rt-ric/data/prepareEcsData.sh new file mode 100755 index 0000000..11b0dc8 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/prepareEcsData.sh @@ -0,0 +1,88 @@ +#!/bin/bash + +# ============LICENSE_START=============================================== +# Copyright (C) 2020 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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================================================= +# + +# The scripts in data/ will generate some dummy data in the running system. +# It will create: +# one EiProducer in ECS +# one EiType in ECS +# one EiJob in ECS + +# Run command: +# ./prepareEcsData.sh [ECS port] [http/https] + +ecs_port=${1:-8083} +httpx=${4:-"http"} + +echo "using ecs port: "$ecs_port +echo "using protocol: "$httpx +echo -e "\n" + +echo "ECS status:" +curl -skw " %{http_code}" $httpx://localhost:$ecs_port/status +echo -e "\n" + +# Create EiType +echo "Create EiType:" +curl -X PUT -skw %{http_code} $httpx://localhost:$ecs_port/data-producer/v1/info-types/type1 -H accept:application/json -H Content-Type:application/json --data-binary @testdata/ECS/EiType.json +echo -e "\n" + +# Get EiTypes +echo "Get EiTypes:" +curl -X GET -skw %{http_code} $httpx://localhost:$ecs_port/data-producer/v1/info-types -H Content-Type:application/json | jq +echo -e "\n" + +# Get Individual EiType +echo "Get Individual EiType:" +curl -X GET -skw %{http_code} $httpx://localhost:$ecs_port/data-producer/v1/info-types/type1 -H Content-Type:application/json | jq +echo -e "\n" + +# Create EiProducer +echo "Create EiProducer:" +curl -X PUT -skw %{http_code} $httpx://localhost:$ecs_port/data-producer/v1/info-producers/1 -H Content-Type:application/json --data-binary @testdata/ECS/EiProducer.json +echo -e "\n" + +# Get EiProducers +echo "Get EiProducers:" +curl -X GET -skw %{http_code} $httpx://localhost:$ecs_port/data-producer/v1/info-producers -H Content-Type:application/json | jq +echo -e "\n" + +# Get Individual EiProducer +echo "Get Individual EiProducer:" +curl -X GET -skw %{http_code} $httpx://localhost:$ecs_port/data-producer/v1/info-producers/1 -H Content-Type:application/json | jq +echo -e "\n" + +# Get Individual EiProducer Status +echo "Get Individual EiProducer:" +curl -X GET -skw %{http_code} $httpx://localhost:$ecs_port/data-producer/v1/info-producers/1/status -H Content-Type:application/json | jq +echo -e "\n" + +# Create EiJob +echo "Create EiJob Of A Certain Type type1:" +curl -X PUT -skw %{http_code} $httpx://localhost:$ecs_port/A1-EI/v1/eijobs/job1 -H Content-Type:application/json --data-binary @testdata/ECS/EiJob.json +echo -e "\n" + +# Get EiJobs +echo "Get EiJobs:" +curl -X GET -skw %{http_code} $httpx://localhost:$ecs_port/A1-EI/v1/eijobs -H Content-Type:application/json | jq +echo -e "\n" + +# Get Individual EiJob: +echo "Get Individual EiJob:" +curl -X GET -skw %{http_code} $httpx://localhost:$ecs_port/A1-EI/v1/eijobs/job1 -H Content-Type:application/json | jq +echo -e "\n" \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/preparePmsData.sh b/solution/integration/smo/non-rt-ric/data/preparePmsData.sh new file mode 100755 index 0000000..ea65d12 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/preparePmsData.sh @@ -0,0 +1,157 @@ +#!/bin/bash + +# ============LICENSE_START=============================================== +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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================================================= +# + +# The scripts in data/ will generate some dummy data in the running system. +# It will create: +# one policy type in a1-sim-OSC +# one service in policy agent +# one policy in a1-sim-OSC +# one policy in a1-sim-STD + +# Run command: +# ./preparePmsData.sh [policy-agent port] [a1-sim-OSC port] [a1-sim-STD port] [http/https] + +policy_agent_port=${1:-8091} +a1_sim_OSC_port=${2:-30001} +a1_sim_STD_port=${3:-30005} +httpx=${4:-"http"} +SHELL_FOLDER=$(cd "$(dirname "$0")";pwd) + +echo "using policy_agent port: "$policy_agent_port +echo "using a1-sim-OSC port: "$a1_sim_OSC_port +echo "using a1-sim-STD port: "$a1_sim_STD_port +echo "using protocol: "$httpx +echo -e "\n" + +checkRes (){ + if [ "$res" != "$expect" ]; then + echo "$res is not expected! exit!" + exit 1; + fi +} + +echo "policy agent status:" +curlString="curl -skw %{http_code} $httpx://localhost:$policy_agent_port/status" +res=$($curlString) +echo "$res" +expect="hunky dory200" +checkRes +echo -e "\n" + +echo "ric1 version:" +curlString="curl -skw %{http_code} $httpx://localhost:$a1_sim_OSC_port/counter/interface" +res=$($curlString) +echo "$res" +expect="OSC_2.1.0200" +checkRes +echo -e "\n" + +echo "ric2 version:" +curlString="curl -skw %{http_code} $httpx://localhost:$a1_sim_STD_port/counter/interface" +res=$($curlString) +echo "$res" +expect="STD_2.0.0200" +checkRes +echo -e "\n" + +echo "create policy type 1 to ric1:" +curlString="curl -X PUT -skw %{http_code} $httpx://localhost:$a1_sim_OSC_port/policytype?id=1 -H Content-Type:application/json --data-binary @${SHELL_FOLDER}/testdata/OSC/policy_type.json" +res=$($curlString) +echo "$res" +expect="Policy type 1 is OK.201" +checkRes +echo -e "\n" + +echo "create policy type 2 to ric2:" +curlString="curl -skw %{http_code} $httpx://localhost:$a1_sim_STD_port/policytype?id=2 -X PUT -H Accept:application/json -H Content-Type:application/json -H X-Requested-With:XMLHttpRequest --data-binary @${SHELL_FOLDER}/testdata/v2/policy_type.json" +res=$($curlString) +echo "$res" +expect="Policy type 2 is OK.201" +checkRes +echo -e "\n" + +for i in {1..60}; do + echo "policy types from policy agent:" + curlString="curl -skw %{http_code} $httpx://localhost:$policy_agent_port/a1-policy/v2/policy-types" + res=$($curlString) + echo "$res" + expect="{\"policytype_ids\":[\"1\",\"2\"]}200" + if [ "$res" == "$expect" ]; then + echo -e "\n" + break; + else + sleep $i + fi +done + +echo "create service ric-registration to policy agent:" +curlString="curl -k -X PUT -sw %{http_code} -H accept:application/json -H Content-Type:application/json "$httpx://localhost:$policy_agent_port/a1-policy/v2/services" --data-binary @${SHELL_FOLDER}/testdata/v2/service.json" +res=$($curlString) +echo "$res" +expect="201" +checkRes +echo -e "\n" + +echo "create policy aa8feaa88d944d919ef0e83f2172a5000 to ric1 with type 1 and service controlpanel via policy agent:" +curlString="curl -k -X PUT -sw %{http_code} -H accept:application/json -H Content-Type:application/json "$httpx://localhost:$policy_agent_port/a1-policy/v2/policies" --data-binary @${SHELL_FOLDER}/testdata/v2/policy_osc.json" +res=$($curlString) +echo "$res" +expect="201" +checkRes +echo -e "\n" + +echo "policy numbers from ric1:" +curlString="curl -skw %{http_code} $httpx://localhost:$a1_sim_OSC_port/counter/num_instances" +res=$($curlString) +echo "$res" +expect="1200" +checkRes +echo -e "\n" + +echo "create policy aa8feaa88d944d919ef0e83f2172a5100 to ric2 with type 2 and service controlpanel via policy agent:" +curlString="curl -k -X PUT -sw %{http_code} -H accept:application/json -H Content-Type:application/json "$httpx://localhost:$policy_agent_port/a1-policy/v2/policies" --data-binary @${SHELL_FOLDER}/testdata/v2/policy_std_v2.json" +res=$($curlString) +echo "$res" +expect="201" +checkRes +echo -e "\n" + +echo "policy numbers from ric2:" +curlString="curl -skw %{http_code} $httpx://localhost:$a1_sim_STD_port/counter/num_instances" +res=$($curlString) +echo "$res" +expect="1200" +checkRes +echo -e "\n" + +echo "policy id aa8feaa88d944d919ef0e83f2172a5000 from policy agent:" +curlString="curl -s -o /dev/null -I -w %{http_code} $httpx://localhost:$policy_agent_port/a1-policy/v2/policies/aa8feaa88d944d919ef0e83f2172a5000" +res=$($curlString) +echo "$res" +expect="200" +checkRes +echo -e "\n" + +echo "policy id aa8feaa88d944d919ef0e83f2172a5100 from policy agent:" +curlString="curl -s -o /dev/null -I -w %{http_code} $httpx://localhost:$policy_agent_port/a1-policy/v2/policies/aa8feaa88d944d919ef0e83f2172a5100" +res=$($curlString) +echo "$res" +expect="200" +checkRes +echo -e "\n" diff --git a/solution/integration/smo/non-rt-ric/data/testdata/ECS/EiJob.json b/solution/integration/smo/non-rt-ric/data/testdata/ECS/EiJob.json new file mode 100644 index 0000000..003c70f --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/ECS/EiJob.json @@ -0,0 +1,11 @@ +{ + "eiTypeId": "type1", + "jobResultUri": "https://ricsim_g3_1:8185/datadelivery", + "jobOwner": "ricsim_g3_1", + "jobStatusNotificationUri": "http://producer:80/", + "jobDefinition": { + "jobparam1": "value1_job1", + "jobparam2": "value2_job1", + "jobparam3": "value3_job1" + } +} \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/ECS/EiProducer.json b/solution/integration/smo/non-rt-ric/data/testdata/ECS/EiProducer.json new file mode 100644 index 0000000..85d3e6d --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/ECS/EiProducer.json @@ -0,0 +1,5 @@ +{ + "supported_info_types": ["type1"], + "info_job_callback_url": "https://producer-stub:8093/callbacks/job/prod-a", + "info_producer_supervision_callback_url": "https://producer-stub:8093/callbacks/supervision/prod-a" +} \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/ECS/EiType.json b/solution/integration/smo/non-rt-ric/data/testdata/ECS/EiType.json new file mode 100644 index 0000000..03762e5 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/ECS/EiType.json @@ -0,0 +1,8 @@ +{ + "info_job_data_schema":{ + "$schema":"http://json-schema.org/draft-07/schema#", + "title":"STD_Type1_1.0.0", + "description":"EI-Type 1", + "type":"object" + } + } \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/OSC/policy_type.json b/solution/integration/smo/non-rt-ric/data/testdata/OSC/policy_type.json new file mode 100644 index 0000000..aeea773 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/OSC/policy_type.json @@ -0,0 +1,45 @@ +{ + "name": "pt1", + "description": "pt1 policy type", + "policy_type_id": 1, + "create_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OSC_Type1_1.0.0", + "description": "Type 1 policy type", + "type": "object", + "properties": { + "scope": { + "type": "object", + "properties": { + "ueId": { + "type": "string" + }, + "qosId": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "ueId", + "qosId" + ] + }, + "qosObjectives": { + "type": "object", + "properties": { + "priorityLevel": { + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "priorityLevel" + ] + } + }, + "additionalProperties": false, + "required": [ + "scope", "qosObjectives" + ] + } +} diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-pms-status.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-pms-status.json new file mode 100644 index 0000000..5c7968e --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-pms-status.json @@ -0,0 +1,14 @@ +[ + { + "apiVersion": "1.0", + "operation": "GET", + "correlationId": "1596363451067769100", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-02 10:17:31.067784", + "type": "request", + "url": "/status" + } +] \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-policy-create.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-policy-create.json new file mode 100644 index 0000000..23d7bed --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-policy-create.json @@ -0,0 +1,102 @@ +[ + { + "apiVersion": "1.0", + "operation": "PUT", + "correlationId": "1596304565904621535", + "originatorId": "849e6c6b420", + "payload": { + "scope": { + "ueId": "ue3000", + "qosId": "qos3000" + }, + "qosObjectives": { + "priorityLevel": 3000 + } + }, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:05.905035", + "type": "request", + "url": "/policy?id=0f7bb041e1584b1fa17e87520d70a3000&ric=ric1&service=service1&type=1" + }, + { + "apiVersion": "1.0", + "operation": "PUT", + "correlationId": "1596304566656253556", + "originatorId": "849e6c6b420", + "payload": { + "scope": { + "ueId": "ue3100", + "qosId": "qos3100" + }, + "qosObjectives": { + "priorityLevel": 3100 + } + }, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:06.656949", + "type": "request", + "url": "/policy?id=0f7bb041e1584b1fa17e87520d70a3100&ric=ric1&service=service1&type=1" + }, + { + "apiVersion": "1.0", + "operation": "PUT", + "correlationId": "1596304566656253557", + "originatorId": "849e6c6b420", + "payload": { + "scope": { + "ueId": "ue3100", + "qosId": "qos3100" + }, + "qosObjectives": { + "priorityLevel": 3200 + } + }, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:06.656949", + "type": "request", + "url": "/policy?id=0f7bb041e1584b1fa17e87520d70a3101&ric=ric1&service=service1&type=1" + }, + { + "apiVersion": "1.0", + "operation": "PUT", + "correlationId": "1596304566656253558", + "originatorId": "849e6c6b420", + "payload": { + "scope": { + "ueId": "ue3102", + "qosId": "qos3102" + }, + "qosObjectives": { + "priorityLevel": 3201 + } + }, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:06.656949", + "type": "request", + "url": "/policy?id=0f7bb041e1584b1fa17e87520d70a3102&ric=ric2&service=service1" + }, + { + "apiVersion": "1.0", + "operation": "PUT", + "correlationId": "1596304566656253558", + "originatorId": "849e6c6b420", + "payload": { + "scope": { + "ueId": "ue3103", + "qosId": "qos3103" + }, + "qosObjectives": { + "priorityLevel": 3203 + } + }, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:06.656949", + "type": "request", + "url": "/policy?id=0f7bb041e1584b1fa17e87520d70a3103&ric=ric3&service=service1&type=2" + } +] \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-policy-delete.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-policy-delete.json new file mode 100644 index 0000000..6065af3 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-policy-delete.json @@ -0,0 +1,50 @@ +[ + { + "apiVersion": "1.0", + "operation": "DELETE", + "correlationId": "1596304567816229314", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.816235", + "type": "request", + "url": "/policy?id=0f7bb041e1584b1fa17e87520d70a3000" + }, + { + "apiVersion": "1.0", + "operation": "DELETE", + "correlationId": "1596304567816229314", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.816235", + "type": "request", + "url": "/policy?id=0f7bb041e1584b1fa17e87520d70a3100" + }, + { + "apiVersion": "1.0", + "operation": "DELETE", + "correlationId": "1596304567816229314", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.816235", + "type": "request", + "url": "/policy?id=0f7bb041e1584b1fa17e87520d70a3101" + }, + { + "apiVersion": "1.0", + "operation": "DELETE", + "correlationId": "1596304567816229314", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.816235", + "type": "request", + "url": "/policy?id=0f7bb041e1584b1fa17e87520d70a3102" + } +] \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-policy-get.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-policy-get.json new file mode 100644 index 0000000..abcaa35 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-policy-get.json @@ -0,0 +1,50 @@ +[ + { + "apiVersion": "1.0", + "operation": "GET", + "correlationId": "1596304567017739720", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.017744", + "type": "request", + "url": "/policy?id=0f7bb041e1584b1fa17e87520d70a3000" + }, + { + "apiVersion": "1.0", + "operation": "GET", + "correlationId": "1596304567017739720", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.017744", + "type": "request", + "url": "/policy?id=0f7bb041e1584b1fa17e87520d70a3100" + }, + { + "apiVersion": "1.0", + "operation": "GET", + "correlationId": "1596304567017739720", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.017744", + "type": "request", + "url": "/policy?id=0f7bb041e1584b1fa17e87520d70a3101" + }, + { + "apiVersion": "1.0", + "operation": "GET", + "correlationId": "1596304567017739720", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.017744", + "type": "request", + "url": "/policy?id=0f7bb041e1584b1fa17e87520d70a3102" + } +] \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-policy-schemas-get.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-policy-schemas-get.json new file mode 100644 index 0000000..05a7975 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-policy-schemas-get.json @@ -0,0 +1,13 @@ +[ + { + "type": "request", + "correlationId": "c09ac7d1-de62-0016-2000-e63701125557-201", + "target": "policy-agent", + "timestamp": "2019-05-14T11:44:51.36Z", + "apiVersion": "1.0", + "originatorId": "849e6c6b420", + "requestId": "23343221", + "operation": "GET", + "url": "/policy_schemas?ric=ric1" + } +] diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-rics-get.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-rics-get.json new file mode 100644 index 0000000..59562d3 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-rics-get.json @@ -0,0 +1,14 @@ +[ + { + "apiVersion": "1.0", + "operation": "GET", + "correlationId": "1596363459399504200", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-02 10:17:39.399517", + "type": "request", + "url": "/rics" + } +] \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-service-create.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-service-create.json new file mode 100644 index 0000000..3e3d542 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-service-create.json @@ -0,0 +1,46 @@ +[ + { + "apiVersion": "1.0", + "operation": "PUT", + "correlationId": "1596363458549998500", + "originatorId": "849e6c6b420", + "payload": { + "callbackUrl": "http://callback-receiver:8090/callbacks/1", + "keepAliveIntervalSeconds": "1000", + "serviceName": "serv1" + }, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-02 10:17:38.550324", + "type": "request", + "url": "/service" + }, + { + "apiVersion": "1.0", + "operation": "PUT", + "correlationId": "1596363458549998501", + "originatorId": "849e6c6b421", + "payload": { + "callbackUrl": "http://callback-receiver:8090/callbacks/1", + "keepAliveIntervalSeconds": "1000", + "serviceName": "service1" + }, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-02 10:17:38.550324", + "type": "request", + "url": "/service" + }, + { + "apiVersion": "1.0", + "operation": "PUT", + "correlationId": "1596363459196978900", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-02 10:17:39.197067", + "type": "request", + "url": "/services/keepalive?name=serv1" + } +] \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-services-get.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-services-get.json new file mode 100644 index 0000000..e9c2f8c --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v1/dmaap-msg-services-get.json @@ -0,0 +1,14 @@ +[ + { + "apiVersion": "1.0", + "operation": "GET", + "correlationId": "1596363458896827100", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-02 10:17:38.897367", + "type": "request", + "url": "/services" + } +] \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-pms-status.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-pms-status.json new file mode 100644 index 0000000..439da01 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-pms-status.json @@ -0,0 +1,14 @@ +[ + { + "apiVersion": "1.0", + "operation": "GET", + "correlationId": "1596363451067769100", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-02 10:17:31.067784", + "type": "request", + "url": "/a1-policy/v2/status" + } +] \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-policy-create.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-policy-create.json new file mode 100644 index 0000000..3b42dfe --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-policy-create.json @@ -0,0 +1,114 @@ +[ + { + "apiVersion": "1.0", + "operation": "PUT", + "correlationId": "1596304565904621535", + "originatorId": "849e6c6b420", + "payload": { + "policy_data": { + "scope": { + "ueId": "ue3010", + "qosId": "qos3010" + }, + "qosObjectives": { + "priorityLevel": 3010 + } + }, + "policy_id": "0f7bb041e1584b1fa17e87520d70a3010", + "policytype_id": "1", + "ric_id": "ric1", + "service_id": "service2", + "status_notification_uri": "http://example.com", + "transient": true + }, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:05.905035", + "type": "request", + "url": "/a1-policy/v2/policies/" + }, + { + "apiVersion": "1.0", + "operation": "PUT", + "correlationId": "1596304566656253556", + "originatorId": "849e6c6b420", + "payload": { + "policy_data": { + "scope": { + "ueId": "ue3120", + "qosId": "qos3120" + }, + "qosObjectives": { + "priorityLevel": 3120 + } + }, + "policy_id": "0f7bb041e1584b1fa17e87520d70a3120", + "policytype_id": "1", + "ric_id": "ric1", + "service_id": "service2", + "status_notification_uri": "http://example.com", + "transient": true + }, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:06.656949", + "type": "request", + "url": "/a1-policy/v2/policies/" + }, + { + "apiVersion": "1.0", + "operation": "PUT", + "correlationId": "1596304566656253557", + "originatorId": "849e6c6b420", + "payload": { + "policy_data": { + "scope": { + "ueId": "ue3131", + "qosId": "qos3131" + }, + "qosObjectives": { + "priorityLevel": 3101 + } + }, + "policy_id": "0f7bb041e1584b1fa17e87520d70a3131", + "policytype_id": "1", + "ric_id": "ric1", + "service_id": "service2", + "status_notification_uri": "http://example.com", + "transient": true + }, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:06.656949", + "type": "request", + "url": "/a1-policy/v2/policies/" + }, + { + "apiVersion": "1.0", + "operation": "PUT", + "correlationId": "1596304566656253758", + "originatorId": "849e6c6b422", + "payload": { + "policy_data": { + "scope": { + "ueId": "ue3153", + "qosId": "qos3153" + }, + "qosObjectives": { + "priorityLevel": 3103 + } + }, + "policy_id": "0f7bb041e1584b1fa17e87520d70a3153", + "policytype_id": "2", + "ric_id": "ric2", + "service_id": "service2", + "status_notification_uri": "http://example.com", + "transient": true + }, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:06.656949", + "type": "request", + "url": "/a1-policy/v2/policies/" + } +] \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-policy-delete.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-policy-delete.json new file mode 100644 index 0000000..1a126fd --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-policy-delete.json @@ -0,0 +1,50 @@ +[ + { + "apiVersion": "1.0", + "operation": "DELETE", + "correlationId": "1596304567816229314", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.816235", + "type": "request", + "url": "/a1-policy/v2/policies/0f7bb041e1584b1fa17e87520d70a3000" + }, + { + "apiVersion": "1.0", + "operation": "DELETE", + "correlationId": "1596304567816229314", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.816235", + "type": "request", + "url": "/a1-policy/v2/policies/0f7bb041e1584b1fa17e87520d70a3100" + }, + { + "apiVersion": "1.0", + "operation": "DELETE", + "correlationId": "1596304567816229314", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.816235", + "type": "request", + "url": "/a1-policy/v2/policies/0f7bb041e1584b1fa17e87520d70a3101" + }, + { + "apiVersion": "1.0", + "operation": "DELETE", + "correlationId": "1596304567816229314", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.816235", + "type": "request", + "url": "/a1-policy/v2/policies/0f7bb041e1584b1fa17e87520d70a3102" + } +] \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-policy-get.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-policy-get.json new file mode 100644 index 0000000..a45e06b --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-policy-get.json @@ -0,0 +1,50 @@ +[ + { + "apiVersion": "1.0", + "operation": "GET", + "correlationId": "1596304567017739720", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.017744", + "type": "request", + "url": "/a1-policy/v2/policies/0f7bb041e1584b1fa17e87520d70a3000" + }, + { + "apiVersion": "1.0", + "operation": "GET", + "correlationId": "1596304567017739720", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.017744", + "type": "request", + "url": "/a1-policy/v2/policies/0f7bb041e1584b1fa17e87520d70a3100" + }, + { + "apiVersion": "1.0", + "operation": "GET", + "correlationId": "1596304567017739720", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.017744", + "type": "request", + "url": "/a1-policy/v2/policies/0f7bb041e1584b1fa17e87520d70a3101" + }, + { + "apiVersion": "1.0", + "operation": "GET", + "correlationId": "1596304567017739720", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-01 17:56:07.017744", + "type": "request", + "url": "/a1-policy/v2/policies/0f7bb041e1584b1fa17e87520d70a3102" + } +] \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-policy-schemas-get.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-policy-schemas-get.json new file mode 100644 index 0000000..b1b2b55 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-policy-schemas-get.json @@ -0,0 +1,13 @@ +[ + { + "type": "request", + "correlationId": "c09ac7d1-de62-0016-2000-e63701125557-201", + "target": "policy-agent", + "timestamp": "2019-05-14T11:44:51.36Z", + "apiVersion": "1.0", + "originatorId": "849e6c6b420", + "requestId": "23343221", + "operation": "GET", + "url": "/a1-policy/v2/policy-types/1" + } +] diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-rics-get.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-rics-get.json new file mode 100644 index 0000000..9c047c0 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-rics-get.json @@ -0,0 +1,14 @@ +[ + { + "apiVersion": "1.0", + "operation": "GET", + "correlationId": "1596363459399504200", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-02 10:17:39.399517", + "type": "request", + "url": "/a1-policy/v2/rics" + } +] \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-service-create.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-service-create.json new file mode 100644 index 0000000..1cd9c25 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-service-create.json @@ -0,0 +1,46 @@ +[ + { + "apiVersion": "1.0", + "operation": "PUT", + "correlationId": "1596363458549998500", + "originatorId": "849e6c6b420", + "payload": { + "callback_url": "http://callback-receiver:8090/callbacks/1", + "keep_alive_interval_seconds": "1000", + "service_id": "serv2" + }, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-02 10:17:38.550324", + "type": "request", + "url": "/a1-policy/v2/services" + }, + { + "apiVersion": "1.0", + "operation": "PUT", + "correlationId": "1596363458549998501", + "originatorId": "849e6c6b421", + "payload": { + "callback_url": "http://callback-receiver:8090/callbacks/1", + "keep_alive_interval_seconds": "1000", + "service_id": "service2" + }, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-02 10:17:38.550324", + "type": "request", + "url": "/a1-policy/v2/services" + }, + { + "apiVersion": "1.0", + "operation": "PUT", + "correlationId": "1596363459196978900", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-02 10:17:39.197067", + "type": "request", + "url": "/a1-policy/v2/services/serv2/keepalive" + } +] \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-services-get.json b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-services-get.json new file mode 100644 index 0000000..7d2d153 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/dmaap/v2/dmaap-msg-services-get.json @@ -0,0 +1,14 @@ +[ + { + "apiVersion": "1.0", + "operation": "GET", + "correlationId": "1596363458896827100", + "originatorId": "849e6c6b420", + "payload": {}, + "requestId": "23343221", + "target": "policy-agent", + "timestamp": "2020-08-02 10:17:38.897367", + "type": "request", + "url": "a1-policy/v2/services" + } +] \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/policy.json b/solution/integration/smo/non-rt-ric/data/testdata/policy.json new file mode 100644 index 0000000..ac1b538 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/policy.json @@ -0,0 +1,9 @@ +{ + "scope": { + "ueId": "ue3100", + "qosId": "qos3100" + }, + "qosObjectives": { + "priorityLevel": 3100 + } +} diff --git a/solution/integration/smo/non-rt-ric/data/testdata/service.json b/solution/integration/smo/non-rt-ric/data/testdata/service.json new file mode 100644 index 0000000..7bb6651 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/service.json @@ -0,0 +1,5 @@ +{ + "callbackUrl": "https://callback-receiver:8091/callbacks/1", + "keepAliveIntervalSeconds": "3600", + "serviceName": "service1" +} diff --git a/solution/integration/smo/non-rt-ric/data/testdata/v2/policy_osc.json b/solution/integration/smo/non-rt-ric/data/testdata/v2/policy_osc.json new file mode 100644 index 0000000..902f911 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/v2/policy_osc.json @@ -0,0 +1,16 @@ +{ + "ric_id": "ric1", + "policy_id": "aa8feaa88d944d919ef0e83f2172a5100", + "service_id": "controlpanel", + "policytype_id": "1", + "status_notification_uri": "http://callback-receiver:8090/callbacks/test", + "policy_data": { + "scope": { + "ueId": "ue5100", + "qosId": "qos5100" + }, + "qosObjectives": { + "priorityLevel": 5100 + } + } +} \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/v2/policy_std_v2.json b/solution/integration/smo/non-rt-ric/data/testdata/v2/policy_std_v2.json new file mode 100644 index 0000000..dcb7e38 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/v2/policy_std_v2.json @@ -0,0 +1,16 @@ +{ + "ric_id": "ric2", + "policy_id": "aa8feaa88d944d919ef0e83f2172a5000", + "service_id": "controlpanel", + "policytype_id": "2", + "status_notification_uri": "http://callback-receiver:8090/callbacks/test", + "policy_data": { + "scope": { + "ueId": "ue5000", + "qosId": "qos5000" + }, + "qosObjectives": { + "priorityLevel": 5000 + } + } +} \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/v2/policy_type.json b/solution/integration/smo/non-rt-ric/data/testdata/v2/policy_type.json new file mode 100644 index 0000000..931498c --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/v2/policy_type.json @@ -0,0 +1,56 @@ +{ + "policySchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "STD_QOS_0_2_0", + "description": "STD QOS policy type", + "type": "object", + "properties": { + "scope": { + "type": "object", + "properties": { + "ueId": { + "type": "string" + }, + "qosId": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "ueId", + "qosId" + ] + }, + "qosObjectives": { + "type": "object", + "properties": { + "priorityLevel": { + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "priorityLevel" + ] + } + } + }, + "statusSchema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "STD_QOS_0.2.0", + "description": "STD QOS policy type status", + "type": "object", + "properties": { + "enforceStatus": { + "type": "string" + }, + "enforceReason": { + "type": "string" + }, + "additionalProperties": false, + "required": [ + "enforceStatus" + ] + } + } + } \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/data/testdata/v2/service.json b/solution/integration/smo/non-rt-ric/data/testdata/v2/service.json new file mode 100644 index 0000000..d984cba --- /dev/null +++ b/solution/integration/smo/non-rt-ric/data/testdata/v2/service.json @@ -0,0 +1,5 @@ +{ + "callback_url": "http://callback-receiver:8090/callbacks/ric-registration", + "keep_alive_interval_seconds": "0", + "service_id": "ric-registration" +} \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/docker-compose.yml b/solution/integration/smo/non-rt-ric/docker-compose.yml new file mode 100644 index 0000000..b8c0c3d --- /dev/null +++ b/solution/integration/smo/non-rt-ric/docker-compose.yml @@ -0,0 +1,215 @@ +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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================================================= +# +version: '3' + +networks: + nonrtric: + driver: bridge + oam: + external: true + smo: + external: true + +services: + policy-agent: + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent:2.2.0 + container_name: policy-agent + networks: + - default + - oam + - smo + ports: + - 8091:8081 + - 8433:8433 + volumes: + - ./config/pms/application_configuration.json:/opt/app/policy-agent/data/application_configuration.json:ro + # For using own certs instead of the default ones (built into the container), + # place them in config/ directory, update the application-policyagent.yaml file, and uncomment the following lines + # - ./config/pms/keystore-policyagent.jks:/opt/app/policy-agent/etc/cert/keystore.jks:ro + # - ./config/pms/truststore-policyagent.jks:/opt/app/policy-agent/etc/cert/truststore.jks:ro + # - ./config/pms/application-policyagent.yaml:/opt/app/policy-agent/config/application.yaml:ro + + a1-sim-OSC: + image: nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator:2.1.0 + container_name: a1-sim-OSC + networks: + - default + - oam + - smo + ports: + - 30001:8085 + - 30002:8185 + environment: + - A1_VERSION=OSC_2.1.0 + - REMOTE_HOSTS_LOGGING=1 + - ALLOW_HTTP=true + + a1-sim-STD: + image: nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator:2.1.0 + container_name: a1-sim-STD + networks: + - default + - oam + - smo + ports: + - 30003:8085 + - 30004:8185 + environment: + - A1_VERSION=STD_1.1.3 + - REMOTE_HOSTS_LOGGING=1 + - ALLOW_HTTP=true + + a1-sim-STD-v2: + image: nexus3.o-ran-sc.org:10004/o-ran-sc/a1-simulator:2.1.0 + container_name: a1-sim-STD-v2 + networks: + - default + - oam + - smo + ports: + - 30005:8085 + - 30006:8185 + environment: + - A1_VERSION=STD_2.0.0 + - REMOTE_HOSTS_LOGGING=1 + - ALLOW_HTTP=true + + r-app: + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-r-app-catalogue:1.1.0 + container_name: r-app + networks: + - default + ports: + - 8680:8680 + - 8633:8633 + + policy-control-panel: + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel:2.2.0 + container_name: policy-control-panel + networks: + - default + ports: + - 8182:8080 + - 8082:8082 + volumes: + - ./config/control-panel/nginx.conf:/etc/nginx/nginx.conf:ro + + nonrtric-gateway: + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-gateway:0.0.1 + container_name: nonrtric-gateway + networks: + - default + ports: + - 9090:9090 + volumes: + - ./config/nonrtric-gateway/application-nonrtricgateway.yaml:/opt/app/nonrtric-gateway/config/application.yaml:ro + + ecs: + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-enrichment-coordinator-service:1.1.0 + container_name: ecs + networks: + - default + ports: + - 8083:8083 + - 8434:8434 + + producer: + image: eexit/mirror-http-server + container_name: producer + networks: + - default + ports: + - 8088:80 + + message-generator: + image: quay.io/yanhuanwang/message-generator + container_name: message-generator + networks: + - default + - smo + - oam + environment: + - MR-HOST=http://onap-dmaap + - MR-PORT=3904 + + oru-app: + image: quay.io/yanhuanwang/oru-app + container_name: oru-app + networks: + - default + - oam + - smo + environment: + - MR-HOST=http://onap-dmaap + - MR-PORT=3904 + - SDNR-HOST=http://sdnr + - SDNR-PORT=8181 + - VERBOSE=on + + db: + image: mysql/mysql-server:5.6 + container_name: sdncdb + networks: + - default + ports: + - "3306" + environment: + - MYSQL_ROOT_PASSWORD=itsASecret + - MYSQL_ROOT_HOST=% + - MYSQL_USER=sdnctl + - MYSQL_PASSWORD=gamma + - MYSQL_DATABASE=sdnctl + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" + + a1controller: + image: nexus3.onap.org:10002/onap/sdnc-image:2.1.2 + depends_on : + - db + container_name: a1controller + networks: + - default + entrypoint: ["/opt/onap/sdnc/bin/startODL.sh"] + ports: + - 8282:8181 + - 8444:8443 + links: + - db:dbhost + - db:sdnctldb01 + - db:sdnctldb02 + environment: + - MYSQL_ROOT_PASSWORD=itsASecret + - MYSQL_USER=sdnctl + - MYSQL_PASSWORD=gamma + - MYSQL_DATABASE=sdnctl + - SDNC_CONFIG_DIR=/opt/onap/sdnc/data/properties + - SDNC_BIN=/opt/onap/sdnc/bin + - ODL_CERT_DIR=/tmp + - ODL_ADMIN_USERNAME=admin + - ODL_ADMIN_PASSWORD=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + - ODL_USER=admin + - ODL_PASSWORD=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + - SDNC_DB_INIT=true + - A1_TRUSTSTORE_PASSWORD=a1adapter + - AAI_TRUSTSTORE_PASSWORD=changeit + logging: + driver: "json-file" + options: + max-size: "30m" + max-file: "5" \ No newline at end of file diff --git a/solution/integration/smo/non-rt-ric/test/health_check.sh b/solution/integration/smo/non-rt-ric/test/health_check.sh new file mode 100755 index 0000000..8ccd627 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/test/health_check.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +############################################################################### +# Copyright 2017 Huawei Technologies Co., Ltd. +# +# 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. +# +# Modifications copyright (c) 2021 Nordix Foundation +# +############################################################################### + +unset http_proxy https_proxy +SHELL_FOLDER=$(cd "$(dirname "$0")";pwd) +docker stop $(docker ps -aq) +docker system prune -f +docker network create oam +docker network create smo + +cd ${SHELL_FOLDER}/../config/pms/ +cp application_configuration.json.nosdnc application_configuration.json + +cd ${SHELL_FOLDER}/../ + +# start NONRTRIC containers with docker compose and configuration from docker-compose.yml +docker-compose up -d + +checkStatus(){ + for i in {1..60}; do + res=$($1) + echo "$res" + expect=$2 + if [ "$res" == "$expect" ]; then + echo -e "$3 is alive!\n" + break; + else + sleep $i + fi + done +} +# Healthcheck docker containers + +# check SIM1 status +echo "check SIM1 status:" +checkStatus "curl -skw %{http_code} http://localhost:30001/" "OK200" "SIM1" + +# check SIM2 status +echo "check SIM2 status:" +checkStatus "curl -skw %{http_code} http://localhost:30003/" "OK200" "SIM2" + +# check SIM3 status +echo "check SIM3 status:" +checkStatus "curl -skw %{http_code} http://localhost:30005/" "OK200" "SIM3" + +# check PMS status +echo "check PMS status:" +checkStatus "curl -skw %{http_code} http://localhost:8091/status" "hunky dory200" "PMS" + +# check ECS status +echo "check ECS status:" +checkStatus "curl -skw %{http_code} http://localhost:8083/status" '{"status":"hunky dory","no_of_producers":0,"no_of_types":0,"no_of_jobs":0}200' "ECS" + +echo "NONRTRIC health check passed." diff --git a/solution/integration/smo/non-rt-ric/test/pms_a1sim.sh b/solution/integration/smo/non-rt-ric/test/pms_a1sim.sh new file mode 100755 index 0000000..db61592 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/test/pms_a1sim.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +# ============LICENSE_START=============================================== +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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================================================= + +unset http_proxy https_proxy +SHELL_FOLDER=$(cd "$(dirname "$0")";pwd) +docker stop $(docker ps -aq) +docker system prune -f +docker network create oam +docker network create smo + +cd ${SHELL_FOLDER}/../config/pms/ +cp application_configuration.json.nosdnc application_configuration.json + +cd ${SHELL_FOLDER}/../ +docker-compose up -d + +checkStatus(){ + for i in {1..60}; do + res=$($1) + echo "$res" + expect=$2 + if [ "$res" == "$expect" ]; then + echo -e "$3 is alive!\n" + break; + else + sleep $i + fi + done +} +# Healthcheck docker containers + +# check SIM1 status +echo "check SIM1 status:" +checkStatus "curl -skw %{http_code} http://localhost:30001/" "OK200" "SIM1" + +# check SIM2 status +echo "check SIM2 status:" +checkStatus "curl -skw %{http_code} http://localhost:30003/" "OK200" "SIM2" + +# check SIM3 status +echo "check SIM3 status:" +checkStatus "curl -skw %{http_code} http://localhost:30005/" "OK200" "SIM3" + +# check PMS status +echo "check PMS status:" +checkStatus "curl -skw %{http_code} http://localhost:8091/status" "hunky dory200" "PMS" + +cd ${SHELL_FOLDER}/../data +./preparePmsData.sh +./prepareEcsData.sh + + diff --git a/solution/integration/smo/non-rt-ric/test/pms_a1sim_sdnc.sh b/solution/integration/smo/non-rt-ric/test/pms_a1sim_sdnc.sh new file mode 100755 index 0000000..c3c4923 --- /dev/null +++ b/solution/integration/smo/non-rt-ric/test/pms_a1sim_sdnc.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +# ============LICENSE_START=============================================== +# Copyright (C) 2021 Nordix Foundation. All rights reserved. +# ======================================================================== +# 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================================================= + +unset http_proxy https_proxy +SHELL_FOLDER=$(cd "$(dirname "$0")";pwd) +docker stop $(docker ps -aq) +docker system prune -f +docker network create oam +docker network create smo + +cd ${SHELL_FOLDER}/../config/pms/ +cp application_configuration.json.sdnc application_configuration.json + +cd ${SHELL_FOLDER}/../ +docker-compose -f docker-compose.yml up -d + +checkStatus(){ + for i in {1..60}; do + res=$($1) + echo "$res" + expect=$2 + if [ "$res" == "$expect" ]; then + echo -e "$3 is alive!\n" + break; + else + sleep $i + fi + done +} +# Healthcheck docker containers + +# check SIM1 status +echo "check SIM1 status:" +checkStatus "curl -skw %{http_code} http://localhost:30001/" "OK200" "SIM1" + +# check SIM2 status +echo "check SIM2 status:" +checkStatus "curl -skw %{http_code} http://localhost:30003/" "OK200" "SIM2" + +# check SIM3 status +echo "check SIM3 status:" +checkStatus "curl -skw %{http_code} http://localhost:30005/" "OK200" "SIM3" + +# check PMS status +echo "check PMS status:" +checkStatus "curl -skw %{http_code} http://localhost:8091/status" "hunky dory200" "PMS" + +# check SDNC status +echo "check SDNC status:" +checkStatus "curl -s -o /dev/null -I -w %{http_code} http://localhost:8282/apidoc/explorer/" "200" "SDNC" + +cd ${SHELL_FOLDER}/../data +./preparePmsData.sh +./prepareEcsData.sh