From 30f931f999a839a549d6c3bda6e182c8e3ec0b2f Mon Sep 17 00:00:00 2001 From: ecaiyanlinux Date: Tue, 10 Nov 2020 22:45:48 +0100 Subject: [PATCH] Update scripts for docker-compose files support PMS_v2.0 Issue-ID: NONRTRIC-421 Signed-off-by: ecaiyanlinux Change-Id: I610a94bde69b7dedbfb3a096d691a54c51574141 --- .gitignore | 1 + docker-compose/a1-sim/docker-compose.yaml | 13 +++++ docker-compose/control-panel/docker-compose.yaml | 2 +- docker-compose/data/preparePmsData.sh | 52 ++++++++++++-------- docker-compose/data/testdata/v2/policy_osc.json | 16 +++++++ docker-compose/data/testdata/v2/policy_std_v2.json | 16 +++++++ docker-compose/data/testdata/v2/policy_type.json | 56 ++++++++++++++++++++++ docker-compose/data/testdata/v2/service.json | 5 ++ .../application_configuration.controller.json | 28 +++++++---- .../application_configuration.nocontroller.json | 21 +++++--- docker-compose/sdnc/docker-compose.yml | 2 +- 11 files changed, 172 insertions(+), 40 deletions(-) create mode 100644 docker-compose/data/testdata/v2/policy_osc.json create mode 100644 docker-compose/data/testdata/v2/policy_std_v2.json create mode 100644 docker-compose/data/testdata/v2/policy_type.json create mode 100644 docker-compose/data/testdata/v2/service.json diff --git a/.gitignore b/.gitignore index 02f4f986..df309a12 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ target/ infer-out/ .vscode +.factorypath diff --git a/docker-compose/a1-sim/docker-compose.yaml b/docker-compose/a1-sim/docker-compose.yaml index 25bcf747..ddd9c181 100644 --- a/docker-compose/a1-sim/docker-compose.yaml +++ b/docker-compose/a1-sim/docker-compose.yaml @@ -46,3 +46,16 @@ services: - 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 + ports: + - 30005:8085 + - 30006:8185 + environment: + - A1_VERSION=STD_2.0.0 + - REMOTE_HOSTS_LOGGING=1 + - ALLOW_HTTP=true diff --git a/docker-compose/control-panel/docker-compose.yaml b/docker-compose/control-panel/docker-compose.yaml index bc56c3db..3cace195 100644 --- a/docker-compose/control-panel/docker-compose.yaml +++ b/docker-compose/control-panel/docker-compose.yaml @@ -22,7 +22,7 @@ networks: services: policy-control-panel: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel:2.2.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-controlpanel:2.1.1 container_name: policy-control-panel networks: - default diff --git a/docker-compose/data/preparePmsData.sh b/docker-compose/data/preparePmsData.sh index 94afc6e9..6b19a4e3 100755 --- a/docker-compose/data/preparePmsData.sh +++ b/docker-compose/data/preparePmsData.sh @@ -25,41 +25,51 @@ # one policy in a1-sim-STD # Run command: -# ./preparePmsData.sh [policy-agent port] [a1-sim-OSC port] [a1-sim-STD port] [http/https] +# ./preparePmsData.sh [policy-agent port] [a1-sim-OSC port] [a1-sim-STD port] [a1-sim-STD-v2 port] [http/https] policy_agent_port=${1:-8081} a1_sim_OSC_port=${2:-30001} a1_sim_STD_port=${3:-30003} -httpx=${4:-"http"} +a1_sim_STD_v2_port=${4:-30005} +httpx=${5:-"http"} 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 a1-sim-STD-v2 port: "$a1_sim_STD_v2_port echo "using protocol: "$httpx echo -e "\n" echo "policy agent status:" -curl -skw " %{http_code}" $httpx://localhost:$policy_agent_port/status +curl -skw %{http_code} $httpx://localhost:$policy_agent_port/status echo -e "\n" echo "ric1 version:" -curl -skw " %{http_code}" $httpx://localhost:$a1_sim_OSC_port/counter/interface +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 +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 +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:$policy_agent_port/policy_types" + curlString="curl -skw %{http_code} $httpx://localhost:$policy_agent_port/a1-policy/v2/policy-types" res=$($curlString) echo "$res" - expect="[\"\",\"1\"]200" + expect="{\"policytype_ids\":[\"\",\"1\",\"2\"]}200" if [ "$res" == "$expect" ]; then echo -e "\n" break; @@ -68,30 +78,30 @@ for i in {1..12}; do fi done -echo "create service 1 to policy agent:" -curl -k -X PUT -sw " %{http_code}" -H accept:application/json -H Content-Type:application/json "$httpx://localhost:$policy_agent_port/service" --data-binary @testdata/service.json +echo "create service ric-registration to policy agent:" +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 @testdata/v2/service.json echo -e "\n" -echo "create policy 2000 to ric1 with type1 and service1 via policy agent:" -curl -k -X PUT -sw " %{http_code}" -H accept:application/json -H Content-Type:application/json "$httpx://localhost:$policy_agent_port/policy?id=2000&ric=ric1&service=service1&type=1" --data-binary @testdata/policy.json +echo "create policy aa8feaa88d944d919ef0e83f2172a5000 to ric1 with type 1 and service controlpanel via policy agent:" +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 @testdata/v2/policy_osc.json echo -e "\n" echo "policy numbers from ric1:" -curl -skw " %{http_code}" $httpx://localhost:$a1_sim_OSC_port/counter/num_instances +curl -skw %{http_code} $httpx://localhost:$a1_sim_OSC_port/counter/num_instances echo -e "\n" -echo "create policy 2100 to ric2 with service1 via policy agent, no type:" -curl -k -X PUT -sw " %{http_code}" -H accept:application/json -H Content-Type:application/json "$httpx://localhost:$policy_agent_port/policy?id=2100&ric=ric2&service=service1" --data-binary @testdata/policy.json +echo "create policy aa8feaa88d944d919ef0e83f2172a5100 to ric2 with type 2 and service controlpanel via policy agent:" +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 @testdata/v2/policy_std_v2.json echo -e "\n" -echo "policy numbers from ric2:" -curl -skw " %{http_code}" $httpx://localhost:$a1_sim_STD_port/counter/num_instances +echo "policy numbers from ric3:" +curl -skw %{http_code} $httpx://localhost:$a1_sim_STD_v2_port/counter/num_instances echo -e "\n" -echo "policy id 2000 from policy agent:" -curl -k -X GET -sw " %{http_code}" $httpx://localhost:$policy_agent_port/policy?id=2000 +echo "policy id aa8feaa88d944d919ef0e83f2172a5000 from policy agent:" +curl -k -X GET -sw %{http_code} $httpx://localhost:$policy_agent_port/a1-policy/v2/policies/aa8feaa88d944d919ef0e83f2172a5000 echo -e "\n" -echo "policy id 2100 from policy agent:" -curl -k -X GET -sw " %{http_code}" $httpx://localhost:$policy_agent_port/policy?id=2100 +echo "policy id aa8feaa88d944d919ef0e83f2172a5100 from policy agent:" +curl -k -X GET -sw %{http_code} $httpx://localhost:$policy_agent_port/a1-policy/v2/policies/aa8feaa88d944d919ef0e83f2172a5100 echo -e "\n" \ No newline at end of file diff --git a/docker-compose/data/testdata/v2/policy_osc.json b/docker-compose/data/testdata/v2/policy_osc.json new file mode 100644 index 00000000..902f9111 --- /dev/null +++ b/docker-compose/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/docker-compose/data/testdata/v2/policy_std_v2.json b/docker-compose/data/testdata/v2/policy_std_v2.json new file mode 100644 index 00000000..12f8c854 --- /dev/null +++ b/docker-compose/data/testdata/v2/policy_std_v2.json @@ -0,0 +1,16 @@ +{ + "ric_id": "ric3", + "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/docker-compose/data/testdata/v2/policy_type.json b/docker-compose/data/testdata/v2/policy_type.json new file mode 100644 index 00000000..931498c4 --- /dev/null +++ b/docker-compose/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/docker-compose/data/testdata/v2/service.json b/docker-compose/data/testdata/v2/service.json new file mode 100644 index 00000000..d984cbab --- /dev/null +++ b/docker-compose/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/docker-compose/policy-service/config/application_configuration.controller.json b/docker-compose/policy-service/config/application_configuration.controller.json index ae9ba770..cf97ed98 100644 --- a/docker-compose/policy-service/config/application_configuration.controller.json +++ b/docker-compose/policy-service/config/application_configuration.controller.json @@ -1,13 +1,12 @@ { "config":{ - "//description":"Application configuration", - "controller": [ - { - "name": "controller1", - "baseUrl": "", - "userName": "", - "password": "" - } + "controller": [ + { + "name": "controller1", + "baseUrl": "https://a1-controller:8443", + "userName": "admin", + "password": "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U" + } ], "ric":[ { @@ -20,8 +19,17 @@ ] }, { - "name":"ric2", - "baseUrl":"https://a1-sim-STD:8185/", + "name":"ric2", + "baseUrl":"https://a1-sim-STD:8185/", + "controller": "controller1", + "managedElementIds":[ + "kista_1", + "kista_2" + ] + }, + { + "name":"ric3", + "baseUrl":"https://a1-sim-STD-v2:8185/", "controller": "controller1", "managedElementIds":[ "kista_1", diff --git a/docker-compose/policy-service/config/application_configuration.nocontroller.json b/docker-compose/policy-service/config/application_configuration.nocontroller.json index 09257038..299b81b2 100644 --- a/docker-compose/policy-service/config/application_configuration.nocontroller.json +++ b/docker-compose/policy-service/config/application_configuration.nocontroller.json @@ -1,6 +1,5 @@ { "config":{ - "//description":"Application configuration", "ric":[ { "name":"ric1", @@ -11,12 +10,20 @@ ] }, { - "name":"ric2", - "baseUrl":"https://a1-sim-STD:8185/", - "managedElementIds":[ - "kista_1", - "kista_2" - ] + "name":"ric2", + "baseUrl":"https://a1-sim-STD:8185/", + "managedElementIds":[ + "kista_1", + "kista_2" + ] + }, + { + "name":"ric3", + "baseUrl":"https://a1-sim-STD-v2:8185/", + "managedElementIds":[ + "kista_1", + "kista_2" + ] } ], "streams_publishes":{ diff --git a/docker-compose/sdnc/docker-compose.yml b/docker-compose/sdnc/docker-compose.yml index fc5b0132..9c63b7d2 100644 --- a/docker-compose/sdnc/docker-compose.yml +++ b/docker-compose/sdnc/docker-compose.yml @@ -38,7 +38,7 @@ services: max-file: "5" a1-controller: - image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-a1-controller:2.1.0 + image: nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-a1-controller:2.0.1 depends_on : - db container_name: a1-controller -- 2.16.6