Update scripts for docker-compose files 45/5545/4
authorecaiyanlinux <martin.c.yan@est.tech>
Tue, 10 Nov 2020 21:45:48 +0000 (22:45 +0100)
committerecaiyanlinux <martin.c.yan@est.tech>
Tue, 2 Feb 2021 12:16:24 +0000 (13:16 +0100)
support PMS_v2.0

Issue-ID: NONRTRIC-421
Signed-off-by: ecaiyanlinux <martin.c.yan@est.tech>
Change-Id: I610a94bde69b7dedbfb3a096d691a54c51574141

.gitignore
docker-compose/a1-sim/docker-compose.yaml
docker-compose/control-panel/docker-compose.yaml
docker-compose/data/preparePmsData.sh
docker-compose/data/testdata/v2/policy_osc.json [new file with mode: 0644]
docker-compose/data/testdata/v2/policy_std_v2.json [new file with mode: 0644]
docker-compose/data/testdata/v2/policy_type.json [new file with mode: 0644]
docker-compose/data/testdata/v2/service.json [new file with mode: 0644]
docker-compose/policy-service/config/application_configuration.controller.json
docker-compose/policy-service/config/application_configuration.nocontroller.json
docker-compose/sdnc/docker-compose.yml

index 02f4f98..df309a1 100644 (file)
@@ -17,3 +17,4 @@ target/
 infer-out/
 
 .vscode
+.factorypath
index 25bcf74..ddd9c18 100644 (file)
@@ -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
index bc56c3d..3cace19 100644 (file)
@@ -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
index 94afc6e..6b19a4e 100755 (executable)
 # 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 (file)
index 0000000..902f911
--- /dev/null
@@ -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 (file)
index 0000000..12f8c85
--- /dev/null
@@ -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 (file)
index 0000000..931498c
--- /dev/null
@@ -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 (file)
index 0000000..d984cba
--- /dev/null
@@ -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
index ae9ba77..cf97ed9 100644 (file)
@@ -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":[
           {
              ]
           },
           {
-             "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",
index 0925703..299b81b 100644 (file)
@@ -1,6 +1,5 @@
 {
     "config":{
-       "//description":"Application configuration",
        "ric":[
           {
              "name":"ric1",
              ]
           },
           {
-             "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":{
index fc5b013..9c63b7d 100644 (file)
@@ -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