Expose endpoint to accept bulk request 17/134017/1
authorleventecsanyi <levente.csanyi@est.tech>
Wed, 5 Apr 2023 10:57:14 +0000 (12:57 +0200)
committerleventecsanyi <levente.csanyi@est.tech>
Wed, 5 Apr 2023 10:57:35 +0000 (12:57 +0200)
 - added wiremock mapping for testing/demo

Issue-ID: CPS-1555
Change-Id: I82af6c43e80a346efcd84aae8945572aa37a6875
Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
dmi-plugin-stub/files/batchResponse.json [new file with mode: 0644]
dmi-plugin-stub/files/moduleResourcesResponse.json [moved from dmi-plugin-perf-stub/files/moduleResourcesResponse.json with 100% similarity]
dmi-plugin-stub/files/moduleResponse.json [moved from dmi-plugin-perf-stub/files/moduleResponse.json with 100% similarity]
dmi-plugin-stub/mappings/batchCmHandles.json [new file with mode: 0644]
dmi-plugin-stub/mappings/module.json [moved from dmi-plugin-perf-stub/mappings/module.json with 100% similarity]
dmi-plugin-stub/mappings/moduleResources.json [moved from dmi-plugin-perf-stub/mappings/moduleResources.json with 100% similarity]
dmi-plugin-stub/start.sh [moved from dmi-plugin-perf-stub/start.sh with 100% similarity]
docker-compose/docker-compose.yml

diff --git a/dmi-plugin-stub/files/batchResponse.json b/dmi-plugin-stub/files/batchResponse.json
new file mode 100644 (file)
index 0000000..b0615df
--- /dev/null
@@ -0,0 +1,40 @@
+{
+  "eventId": "4cb32729-85e3-44d1-aa6e-c923b9b059a5",
+  "eventCorrelationId": "68f15800-8ed4-4bae-9e53-27a9e03e1911",
+  "eventTime": "2023-03-28T14:29:23.876+0000",
+  "eventType": "org.onap.cps.ncmp.event.model.BulkResponseEvent",
+  "eventSchema": "urn:cps:org.onap.cps.ncmp.event.model.BulkResponseEvent",
+  "eventSchemaVersion": "v1",
+  "event": {
+    "payload": [
+      {
+        "cmHandle": "CmHandle5",
+        "additionalProperties": [
+          {
+            "Shape": "cube",
+            "Size": "small",
+            "Color": "yellow"
+          }
+        ],
+        "state": {
+          "cmHandleState": "READY",
+          "lastUpdateTime": "2023-04-03T20:03:19.832+0000"
+        }
+      },
+      {
+        "cmHandle": "CmHandle6",
+        "additionalProperties": [
+          {
+            "Shape": "cube",
+            "Size": "small",
+            "Color": "yellow"
+          }
+        ],
+        "state": {
+          "cmHandleState": "READY",
+          "lastUpdateTime": "2023-04-02T20:01:19.832+0000"
+        }
+      }
+    ]
+  }
+}
\ No newline at end of file
diff --git a/dmi-plugin-stub/mappings/batchCmHandles.json b/dmi-plugin-stub/mappings/batchCmHandles.json
new file mode 100644 (file)
index 0000000..2018516
--- /dev/null
@@ -0,0 +1,13 @@
+{
+  "request": {
+    "method": "POST",
+    "urlPattern": "/dmi/v1/ch/batch/data/ds/.*"
+  },
+  "response": {
+    "status": 200,
+    "bodyFileName": "batchResponse.json",
+    "headers": {
+      "Content-Type": "application/json"
+    }
+  }
+}
index 5c78587..720761d 100644 (file)
@@ -112,8 +112,8 @@ services:
     ports:
       - ${DMI_PORT:-8783}:8080
     volumes:
-      - ../dmi-plugin-perf-stub/mappings:/home/wiremock/mappings
-      - ../dmi-plugin-perf-stub/files:/home/wiremock/__files
+      - ../dmi-plugin-stub/mappings:/home/wiremock/mappings
+      - ../dmi-plugin-stub/files:/home/wiremock/__files
     restart: unless-stopped
     profiles:
       - dmi-stub