From: shikha0203 Date: Tue, 10 Feb 2026 13:57:44 +0000 (+0000) Subject: Merge postman collections for docker/k8 using environment variables X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=00f2824fb0a70fcf42fd9c9da8bf5216333153cb;p=cps.git Merge postman collections for docker/k8 using environment variables - Moved dmi-stub-2 requests from kubernetes folder to CPS-NCMP/Inventory/Southbound (dmi) - Added Liveness & Readiness folder with health checks for CPS and DMI-Stub services - Updated all DMI URLs to use environment variables ({{DMI_HOST}}:{{DMI_PORT}}) - Renamed environments: "CPS Environment Docker" and "CPS Environment k8s-linux-minikube" - Added DMI_HOST_2 and DMI_PORT_2 variables for dmi-stub-2 support - Updated README with Kubernetes setup instructions for Linux/Windows Issue-ID: CPS-3058 Change-Id: I9045c72873eaaca316138d5303945d8441ded1b2 Signed-off-by: shikha0203 --- diff --git a/postman-collections/CPS.postman_collection.json b/postman-collections/CPS.postman_collection.json index 721dedf092..434457e0bc 100644 --- a/postman-collections/CPS.postman_collection.json +++ b/postman-collections/CPS.postman_collection.json @@ -7,6 +7,154 @@ "_exporter_id": "26733783" }, "item": [ + { + "name": "Liveness & Readiness", + "item": [ + { + "name": "CPS", + "item": [ + { + "name": "CPS Liveness Check", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/actuator/health/liveness", + "protocol": "http", + "host": [ + "{{CPS_HOST}}" + ], + "port": "{{CPS_PORT}}", + "path": [ + "actuator", + "health", + "liveness" + ] + }, + "description": "Check if CPS service is alive" + }, + "response": [] + }, + { + "name": "CPS Readiness Check", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/actuator/health/readiness", + "protocol": "http", + "host": [ + "{{CPS_HOST}}" + ], + "port": "{{CPS_PORT}}", + "path": [ + "actuator", + "health", + "readiness" + ] + }, + "description": "Check if CPS service is ready to accept traffic" + }, + "response": [] + } + ] + }, + { + "name": "DMI-Stub", + "item": [ + { + "name": "DMI-Stub-1 Liveness Check", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{DMI_HOST_1}}:{{DMI_PORT_1}}/actuator/health/liveness", + "protocol": "http", + "host": [ + "{{DMI_HOST_1}}" + ], + "port": "{{DMI_PORT_1}}", + "path": [ + "actuator", + "health", + "liveness" + ] + }, + "description": "Check if DMI-Stub-1 service is alive" + }, + "response": [] + }, + { + "name": "DMI-Stub-1 Readiness Check", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{DMI_HOST_1}}:{{DMI_PORT_1}}/actuator/health/readiness", + "protocol": "http", + "host": [ + "{{DMI_HOST_1}}" + ], + "port": "{{DMI_PORT_1}}", + "path": [ + "actuator", + "health", + "readiness" + ] + }, + "description": "Check if DMI-Stub-1 service is ready to accept traffic" + }, + "response": [] + }, + { + "name": "DMI-Stub-2 Liveness Check", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{DMI_HOST_2}}:{{DMI_PORT_2}}/actuator/health/liveness", + "protocol": "http", + "host": [ + "{{DMI_HOST_2}}" + ], + "port": "{{DMI_PORT_2}}", + "path": [ + "actuator", + "health", + "liveness" + ] + }, + "description": "Check if DMI-Stub-2 service is alive" + }, + "response": [] + }, + { + "name": "DMI-Stub-2 Readiness Check", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{DMI_HOST_2}}:{{DMI_PORT_2}}/actuator/health/readiness", + "protocol": "http", + "host": [ + "{{DMI_HOST_2}}" + ], + "port": "{{DMI_PORT_2}}", + "path": [ + "actuator", + "health", + "readiness" + ] + }, + "description": "Check if DMI-Stub-2 service is ready to accept traffic" + }, + "response": [] + } + ] + } + ], + "description": "Health check endpoints for CPS and DMI-Stub services. Use environment variables to switch between docker and k8s deployments." + }, { "name": "CPS-Core", "item": [ @@ -802,7 +950,7 @@ "name": "Southbound (dmi)", "item": [ { - "name": "CM handle registration (discovery)", + "name": "CM handle registration for dmi-stub-1", "event": [ { "listen": "prerequest", @@ -821,7 +969,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"dmiPlugin\": \"http://ncmp-dmi-plugin-demo-and-csit-stub:8092\",\r\n \"createdCmHandles\": [\r\n {\r\n \"cmHandle\": \"cm-handle-1\",\r\n \"alternateId\": \"/Subnetwork=Europe/ManagedElement=X1\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"publicCmHandleProperties\": {\r\n \"id\": \"123\",\r\n \"userLabel\": \"test\"\r\n },\r\n \"moduleSetTag\": \"my-module-set-tag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n },\r\n {\r\n \"cmHandle\": \"cm-handle-2\",\r\n \"alternateId\": \"/Subnetwork=Europe/ManagedElement=X2\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"publicCmHandleProperties\": {\r\n \"id\": \"456\",\r\n \"userLabel\": \"test2\"\r\n },\r\n \"moduleSetTag\": \"my-module-set-tag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n },\r\n {\r\n \"cmHandle\": \"cm-handle-3-never-ready\",\r\n \"alternateId\": \"/Subnetwork=Europe/ManagedElement=X3\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"moduleSetTag\": \"errorTag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n }\r\n ]\r\n}", + "raw": "{\r\n \"dmiPlugin\": \"http://{{DMI_HOST_1}}:{{DMI_PORT_1}}\",\r\n \"createdCmHandles\": [\r\n {\r\n \"cmHandle\": \"cm-handle-1\",\r\n \"alternateId\": \"/Subnetwork=Europe/ManagedElement=X1\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"publicCmHandleProperties\": {\r\n \"color\": \"red\" },\r\n \"moduleSetTag\": \"my-module-set-tag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n },\r\n {\r\n \"cmHandle\": \"cm-handle-2\",\r\n \"alternateId\": \"/Subnetwork=Europe/ManagedElement=X2\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"publicCmHandleProperties\": {\r\n \"color\": \"purple\" },\r\n \"moduleSetTag\": \"my-module-set-tag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n },\r\n {\r\n \"cmHandle\": \"cm-handle-3-never-ready\",\r\n \"alternateId\": \"/Subnetwork=Europe/ManagedElement=X3\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"moduleSetTag\": \"errorTag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" @@ -846,7 +994,7 @@ "response": [] }, { - "name": "Get registered CM handle references", + "name": "Get registered CM handles for dmi-stub-1", "protocolProfileBehavior": { "disableBodyPruning": true }, @@ -884,7 +1032,7 @@ "query": [ { "key": "dmi-plugin-identifier", - "value": "http://ncmp-dmi-plugin-demo-and-csit-stub:8092" + "value": "http://{{DMI_HOST_1}}:{{DMI_PORT_1}}" }, { "key": "outputAlternateId", @@ -898,13 +1046,13 @@ "response": [] }, { - "name": "CM handle de-registration", + "name": "CM handle de-registration for dmi-stub-1", "request": { "method": "POST", "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"dmiPlugin\": \"http://ncmp-dmi-plugin-demo-and-csit-stub:8092\",\r\n \"removedCmHandles\": [ \"cm-handle-1\", \"cm-handle-2\", \"cm-handle-3-never-ready\"]\r\n}", + "raw": "{\r\n \"dmiPlugin\": \"http://{{DMI_HOST_1}}:{{DMI_PORT_1}}\",\r\n \"removedCmHandles\": [ \"cm-handle-1\", \"cm-handle-2\", \"cm-handle-3-never-ready\"]\r\n}", "options": { "raw": { "language": "json" @@ -935,7 +1083,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"cmHandleQueryParameters\": [\r\n {\r\n \"conditionName\": \"hasAllProperties\",\r\n \"conditionParameters\": [\r\n {\r\n \"id\": \"123\"\r\n }\r\n ]\r\n }\r\n ]\r\n}", + "raw": "{\r\n \"cmHandleQueryParameters\": [\r\n {\r\n \"conditionName\": \"hasAllProperties\",\r\n \"conditionParameters\": [\r\n {\r\n \"color\": \"red\"\r\n }\r\n ]\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" @@ -974,7 +1122,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"cmHandleQueryParameters\": [\r\n {\r\n \"conditionName\": \"hasAllProperties\",\r\n \"conditionParameters\": [\r\n {\r\n \"id\": \"123\"\r\n }\r\n ]\r\n }\r\n ]\r\n}", + "raw": "{\r\n \"cmHandleQueryParameters\": [\r\n {\r\n \"conditionName\": \"hasAllProperties\",\r\n \"conditionParameters\": [\r\n {\r\n \"color\": \"green\"\r\n }\r\n ]\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" @@ -1052,7 +1200,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"cmHandleQueryParameters\": [\r\n {\r\n \"conditionName\": \"cmHandleWithDmiPlugin\",\r\n \"conditionParameters\": [\r\n {\r\n \"dmiPluginName\": \"http://ncmp-dmi-plugin-demo-and-csit-stub:8092\"\r\n }\r\n ]\r\n }\r\n ]\r\n}", + "raw": "{\r\n \"cmHandleQueryParameters\": [\r\n {\r\n \"conditionName\": \"cmHandleWithDmiPlugin\",\r\n \"conditionParameters\": [\r\n {\r\n \"dmiPluginName\": \"http://{{DMI_HOST}}:{{DMI_PORT}}\"\r\n }\r\n ]\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" @@ -1087,6 +1235,157 @@ } }, "response": [] + }, + { + "name": "CM handle registration for dmi-stub-2", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"dmiPlugin\": \"http://{{DMI_HOST_2}}:{{DMI_PORT_2}}\",\r\n \"createdCmHandles\": [\r\n {\r\n \"cmHandle\": \"cm-handle-3\",\r\n \"alternateId\": \"Subnetwork=Europe,ManagedElement=X3\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"publicCmHandleProperties\": {\r\n \"color\": \"red\" },\r\n \"moduleSetTag\": \"my-module-set-tag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n },\r\n {\r\n \"cmHandle\": \"cm-handle-4\",\r\n \"alternateId\": \"Subnetwork=Europe,ManagedElement=X4\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"publicCmHandleProperties\": {\r\n \"color\": \"green\" },\r\n \"moduleSetTag\": \"my-module-set-tag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n }\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch", + "protocol": "http", + "host": [ + "{{CPS_HOST}}" + ], + "port": "{{CPS_PORT}}", + "path": [ + "ncmpInventory", + "v1", + "ch" + ] + }, + "description": "DMI notifies NCMP of new CM handles" + }, + "response": [] + }, + { + "name": "Get registered CM handles for dmi-stub-2", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Basic Y3BzdXNlcjpjcHNyMGNrcyE=", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch/cmHandles?dmi-plugin-identifier=http://{{DMI_HOST_2}}:{{DMI_PORT_2}}", + "protocol": "http", + "host": [ + "{{CPS_HOST}}" + ], + "port": "{{CPS_PORT}}", + "path": [ + "ncmpInventory", + "v1", + "ch", + "cmHandles" + ], + "query": [ + { + "key": "dmi-plugin-identifier", + "value": "http://{{DMI_HOST_2}}:{{DMI_PORT_2}}" + }, + { + "key": "outputAlternateId", + "value": "true", + "description": "Returns alternate ids rather then cm handle ids", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "CM handle de-registration for dmi-stub-2", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"dmiPlugin\": \"http://{{DMI_HOST_2}}:{{DMI_PORT_2}}\",\r\n \"removedCmHandles\": [\r\n \"cm-handle-3\",\r\n \"cm-handle-4\"\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch", + "protocol": "http", + "host": [ + "{{CPS_HOST}}" + ], + "port": "{{CPS_PORT}}", + "path": [ + "ncmpInventory", + "v1", + "ch" + ] + }, + "description": "DMI notifies NCMP of new CM handles" + }, + "response": [] } ] }, @@ -2714,344 +3013,6 @@ } ], "description": "NCMP-DMI-Stub endpoints as defined by Rest OpenApi Specification [here](https://docs.onap.org/projects/onap-cps-ncmp-dmi-plugin/en/latest/design.html#offered-apis)\n\n**To utilise NCMP-DMI-Stub begin the docker containers with:**\n\n`docker-compose --profile dmi-stub --profile monitoring up -d`" - }, - { - "name": "CPS-NCMP-K8s", - "item": [ - { - "name": "CM handle registration for dmi-stub-1", - "event": [ - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript", - "packages": {}, - "requests": {} - } - }, - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript", - "packages": {}, - "requests": {} - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n \"dmiPlugin\": \"http://{{DMI_HOST}}:{{DMI_PORT}}\",\r\n \"createdCmHandles\": [\r\n {\r\n \"cmHandle\": \"cm-handle-1\",\r\n \"alternateId\": \"Subnetwork=Europe,ManagedElement=X1\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"publicCmHandleProperties\": {\r\n \"id\": \"123\",\r\n \"userLabel\": \"test\"\r\n },\r\n \"moduleSetTag\": \"my-module-set-tag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n },\r\n {\r\n \"cmHandle\": \"cm-handle-2\",\r\n \"alternateId\": \"Subnetwork=Europe,ManagedElement=X2\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"publicCmHandleProperties\": {\r\n \"id\": \"456\",\r\n \"userLabel\": \"test\"\r\n },\r\n \"moduleSetTag\": \"my-module-set-tag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n }\r\n ]\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch", - "protocol": "http", - "host": [ - "{{CPS_HOST}}" - ], - "port": "{{CPS_PORT}}", - "path": [ - "ncmpInventory", - "v1", - "ch" - ] - }, - "description": "DMI notifies NCMP of new CM handles" - }, - "response": [] - }, - { - "name": "CM handle registration for dmi-stub-2", - "event": [ - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript", - "packages": {}, - "requests": {} - } - }, - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript", - "packages": {}, - "requests": {} - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n \"dmiPlugin\": \"http://{{DMI_HOST_2}}:{{DMI_PORT_2}}\",\r\n \"createdCmHandles\": [\r\n {\r\n \"cmHandle\": \"cm-handle-3\",\r\n \"alternateId\": \"Subnetwork=Europe,ManagedElement=X3\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"publicCmHandleProperties\": {\r\n \"id\": \"123\",\r\n \"userLabel\": \"test\"\r\n },\r\n \"moduleSetTag\": \"my-module-set-tag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n },\r\n {\r\n \"cmHandle\": \"cm-handle-4\",\r\n \"alternateId\": \"Subnetwork=Europe,ManagedElement=X4\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"publicCmHandleProperties\": {\r\n \"id\": \"456\",\r\n \"userLabel\": \"test\"\r\n },\r\n \"moduleSetTag\": \"my-module-set-tag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n }\r\n ]\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch", - "protocol": "http", - "host": [ - "{{CPS_HOST}}" - ], - "port": "{{CPS_PORT}}", - "path": [ - "ncmpInventory", - "v1", - "ch" - ] - }, - "description": "DMI notifies NCMP of new CM handles" - }, - "response": [] - }, - { - "name": "Get All CM handles for dmi-stub-1", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Basic Y3BzdXNlcjpjcHNyMGNrcyE=", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch/cmHandles?dmi-plugin-identifier=http://{{DMI_HOST}}:{{DMI_PORT}}", - "protocol": "http", - "host": [ - "{{CPS_HOST}}" - ], - "port": "{{CPS_PORT}}", - "path": [ - "ncmpInventory", - "v1", - "ch", - "cmHandles" - ], - "query": [ - { - "key": "dmi-plugin-identifier", - "value": "http://{{DMI_HOST}}:{{DMI_PORT}}" - }, - { - "key": "outputAlternateId", - "value": "true", - "description": "Returns alternate ids rather then cm handle ids", - "disabled": true - } - ] - } - }, - "response": [] - }, - { - "name": "Get All CM handles for dmi-stub-2", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [ - { - "key": "Authorization", - "value": "Basic Y3BzdXNlcjpjcHNyMGNrcyE=", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch/cmHandles?dmi-plugin-identifier=http://{{DMI_HOST_2}}:{{DMI_PORT_2}}", - "protocol": "http", - "host": [ - "{{CPS_HOST}}" - ], - "port": "{{CPS_PORT}}", - "path": [ - "ncmpInventory", - "v1", - "ch", - "cmHandles" - ], - "query": [ - { - "key": "dmi-plugin-identifier", - "value": "http://{{DMI_HOST_2}}:{{DMI_PORT_2}}" - }, - { - "key": "outputAlternateId", - "value": "true", - "description": "Returns alternate ids rather then cm handle ids", - "disabled": true - } - ] - } - }, - "response": [] - }, - { - "name": "Get resource data", - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/cm-handle-2/data/ds/ncmp-datastore:passthrough-running?resourceIdentifier=my-data-producer-identifier", - "protocol": "http", - "host": [ - "{{CPS_HOST}}" - ], - "port": "{{CPS_PORT}}", - "path": [ - "ncmp", - "v1", - "ch", - "cm-handle-2", - "data", - "ds", - "ncmp-datastore:passthrough-running" - ], - "query": [ - { - "key": "resourceIdentifier", - "value": "my-data-producer-identifier" - } - ] - } - }, - "response": [] - }, - { - "name": "CM handle de-registration for dmi-stub-1", - "event": [ - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript", - "packages": {}, - "requests": {} - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n \"dmiPlugin\": \"http://{{DMI_HOST}}:{{DMI_PORT}}\",\r\n \"removedCmHandles\": [\r\n \"cm-handle-1\",\r\n \"cm-handle-2\"\r\n ]\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch", - "protocol": "http", - "host": [ - "{{CPS_HOST}}" - ], - "port": "{{CPS_PORT}}", - "path": [ - "ncmpInventory", - "v1", - "ch" - ] - }, - "description": "DMI notifies NCMP of new CM handles" - }, - "response": [] - }, - { - "name": "CM handle de-registration for dmi-stub-2", - "event": [ - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript", - "packages": {}, - "requests": {} - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n \"dmiPlugin\": \"http://{{DMI_HOST_2}}:{{DMI_PORT_2}}\",\r\n \"removedCmHandles\": [\r\n \"cm-handle-3\",\r\n \"cm-handle-4\"\r\n ]\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch", - "protocol": "http", - "host": [ - "{{CPS_HOST}}" - ], - "port": "{{CPS_PORT}}", - "path": [ - "ncmpInventory", - "v1", - "ch" - ] - }, - "description": "DMI notifies NCMP of new CM handles" - }, - "response": [] - } - ] } ], "event": [ diff --git a/postman-collections/CPS Environment.postman_environment.json b/postman-collections/Env_docker.json similarity index 64% rename from postman-collections/CPS Environment.postman_environment.json rename to postman-collections/Env_docker.json index 7ee9c6779e..780cd29081 100644 --- a/postman-collections/CPS Environment.postman_environment.json +++ b/postman-collections/Env_docker.json @@ -1,6 +1,6 @@ { "id": "fd705c16-c17e-434d-ad2e-ba040a7ed062", - "name": "CPS Environment", + "name": "CPS Environment Docker", "values": [ { "key": "CPS_HOST", @@ -15,16 +15,28 @@ "enabled": true }, { - "key": "DMI_HOST", + "key": "DMI_HOST_1", "value": "ncmp-dmi-plugin-demo-and-csit-stub", "type": "default", "enabled": true }, { - "key": "DMI_PORT", + "key": "DMI_PORT_1", "value": "8092", "type": "default", "enabled": true + }, + { + "key": "DMI_HOST_2", + "value": "ncmp-dmi-plugin-demo-and-csit-stub-2", + "type": "default", + "enabled": true + }, + { + "key": "DMI_PORT_2", + "value": "8093", + "type": "default", + "enabled": true } ], "_postman_variable_scope": "environment", diff --git a/postman-collections/CPS Environment k8s.postman_environment.json b/postman-collections/Env_k8s.json similarity index 73% rename from postman-collections/CPS Environment k8s.postman_environment.json rename to postman-collections/Env_k8s.json index 1525cb0c3e..5e77e34c9e 100644 --- a/postman-collections/CPS Environment k8s.postman_environment.json +++ b/postman-collections/Env_k8s.json @@ -1,10 +1,10 @@ { "id": "a0df880f-ad98-482a-8725-ee4577cf224e", - "name": "CPS Environment k8s", + "name": "CPS Environment k8s-linux-minikube", "values": [ { "key": "CPS_HOST", - "value": "localhost", + "value": "192.168.49.2", "type": "default", "enabled": true }, @@ -15,26 +15,26 @@ "enabled": true }, { - "key": "DMI_HOST", - "value": "cps-ncmp-dmi-stub-1-service", + "key": "DMI_HOST_1", + "value": "192.168.49.2", "type": "default", "enabled": true }, { - "key": "DMI_PORT", - "value": "8092", + "key": "DMI_PORT_1", + "value": "30092", "type": "default", "enabled": true }, { "key": "DMI_HOST_2", - "value": "cps-ncmp-dmi-stub-2-service", + "value": "192.168.49.2", "type": "default", "enabled": true }, { "key": "DMI_PORT_2", - "value": "8093", + "value": "30094", "type": "default", "enabled": true } diff --git a/postman-collections/README.md b/postman-collections/README.md index d4a1c63adf..f31b7be84b 100644 --- a/postman-collections/README.md +++ b/postman-collections/README.md @@ -19,13 +19,63 @@ --> # Importing and running the CPS postman collections + ## Importing the CPS collections To import the CPS collections and environment: 1. Create a "Workspace" (or if you have one already you can use that) 2. Click "Import" (or click "File" then "Import") 3. Drag and drop the "postman-collection" folder into the import pop-up 4. The collections and environment should now be imported -5. Set the current environment to "CPS Environment" (usually at the top right. Default is "No Environment") This will provide the necessary variables such as "CPS_HOST" and "CPS_PORT" to allow the requests to be run +5. Set the current environment based on your deployment: + - For **Docker**: Select "CPS Environment Docker" (CPS_PORT=8883) + - For **Kubernetes**: Select "CPS Environment k8s-linux-minikube" (CPS_PORT=30080) + +## Switching Between Docker and Kubernetes +The collection now supports both docker-compose and k8s deployments using environment variables: +- Simply change the active environment in Postman (top right dropdown) +- All requests will automatically use the correct ports and hosts +- No need for separate folders or duplicate tests + +### Kubernetes Environment Setup +For Kubernetes deployments, you need to configure the correct host and ports based on your local setup: + +**Linux (minikube):** +```bash +# Get minikube IP and NodePorts +minikube service list + +# Update environment variables with: +# CPS_HOST = (e.g., 192.168.49.2) +# CPS_PORT = (e.g., 30080) +# DMI_HOST = +# DMI_PORT = (e.g., 30092) +# DMI_HOST_2 = +# DMI_PORT_2 = (e.g., 30094) +``` + +**Windows (Docker Desktop / minikube):** +```powershell +# For Docker Desktop Kubernetes: +# CPS_HOST = localhost +# Ports = NodePort values from: kubectl get svc + +# For minikube: +minikube service list +# Use the URLs shown (host:port) +``` + +**Verify your services:** +```bash +kubectl get svc | grep -E "cps|dmi" +# Note the NodePort values (e.g., 8080:30080/TCP) +# Use the second port (30080) in your environment +``` + +## Environment Variables +Both environments support: +- `CPS_HOST` and `CPS_PORT` - CPS service endpoint +- `DMI_HOST` and `DMI_PORT` - DMI-Stub-1 endpoint +- `DMI_HOST_2` and `DMI_PORT_2` - DMI-Stub-2 endpoint ## Using collections in Postman A how-to guide is provided in the CPS collection. To access this guide click on the parent CPS folder icon at the top of the collection and follow the provided instructions. @@ -33,5 +83,13 @@ A how-to guide is provided in the CPS collection. To access this guide click on ## Running the collections To run the requests in the collections in CPS-CORE simply select the request and click send. "Create Schema Set" in "CPS-CORE" requires a file to send the request. Example files are provided: "bookstore.yang" and "bookstore-types.yang" (these files must be zipped before adding them to the request) +## Liveness & Readiness Checks +The collection includes health check endpoints for all services: +- **CPS**: Liveness and Readiness checks +- **DMI-Stub-1**: Liveness and Readiness checks +- **DMI-Stub-2**: Liveness and Readiness checks + +These checks work with both docker and k8s deployments by using environment variables. + ## Notes When exporting postman collections tabs are used for spacing, so replacing all the tabs is necessary