diff options
author | 2021-01-05 03:33:28 -0800 | |
---|---|---|
committer | 2021-02-05 05:09:37 -0800 | |
commit | 0736c9f21b579973214d1a65ac218b9da7d11086 (patch) | |
tree | 4e052b883ab5c188a86d43bed33b6579b2a3a4c0 /scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms | |
parent | fedb1804c8a90e05e6818fee9f59671cdf732ce7 (diff) |
Add CSIT for slice-analysis-ms
Issue-ID: DCAEGEN2-2560
Signed-off-by: Sumithra <sumithra.s69@wipro.com>
Change-Id: Ib776f759ba10e1d95d68ac4bc9da576b6063a59a
Diffstat (limited to 'scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms')
12 files changed, 1138 insertions, 0 deletions
diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/Dockerfile b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/Dockerfile new file mode 100644 index 00000000..52d54a57 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/Dockerfile @@ -0,0 +1,15 @@ +FROM python:alpine3.7 + +ADD configdb-sim.py / + +ADD ./sim-data / + +RUN pip install Flask --trusted-host pypi.org --trusted-host files.pythonhosted.org + +RUN pip install requests --trusted-host pypi.org --trusted-host files.pythonhosted.org + +EXPOSE 5000 + +CMD ["flask", "run", "--host", "0.0.0.0"] + +CMD [ "python", "./configdb-sim.py" ] diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/configdb-sim.py b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/configdb-sim.py new file mode 100644 index 00000000..bcda08d5 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/configdb-sim.py @@ -0,0 +1,115 @@ +import flask +import json +from flask import Flask, render_template +from flask import request +from flask import jsonify +import requests +import threading +import time + +app = flask.Flask(__name__) +app.config["DEBUG"] = True + + +def get_du_list_for_nssai(snssai): + if str(snssai) == '001-00110': + with open('du_list_001_00110.json') as du_list: + data = json.load(du_list) + else: + with open('du_list_001_010000.json') as du_list: + data = json.load(du_list) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + + +def get_du_cell_list_for_nssai(snssai): + if str(snssai) == '001-00110': + with open('du_cell_list_001_00110.json') as du_cell_list: + data = json.load(du_cell_list) + else: + with open('du_cell_list_001_010000.json') as du_cell_list: + data = json.load(du_cell_list) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + + +def get_slice_config_for_nssai(snssai): + if str(snssai) == '001-00110': + with open('slice_config_001_00110.json') as slice_config: + data = json.load(slice_config) + else: + with open('slice_config_001_010000.json') as slice_config: + data = json.load(slice_config) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + + +def get_profile_config_for_nssai(snssai): + if str(snssai) == '001-00110': + with open('profile_config_001_00110.json') as profile_config: + data = json.load(profile_config) + else: + with open('profile_config_001_010000.json') as profile_config: + data = json.load(profile_config) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + + +def get_subscriber_details_for_nssai(snssai): + if str(snssai) == '001-00110': + with open('subscriber-details_001_00110.json') as subscriber_details: + data = json.load(subscriber_details) + else: + with open('subscriber-details_001_010000.json') as subscriber_details: + data = json.load(subscriber_details) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + + +@app.route("/api/sdnc-config-db/v4/du-list/<snssai>", methods=["GET"]) +def get_du_list(snssai): + data, status = get_du_list_for_nssai(snssai) + if not status: + return jsonify(data) + return data, 503 + + +@app.route("/api/sdnc-config-db/v4/du-cell-list/<snssai>", methods=["GET"]) +def get_du_cell_list(snssai): + data, status = get_du_cell_list_for_nssai(snssai) + if not status: + return jsonify(data) + return data, 503 + + +@app.route("/api/sdnc-config-db/v4/slice-config/<snssai>", methods=["GET"]) +def get_slice_config(snssai): + data, status = get_slice_config_for_nssai(snssai) + if not status: + return jsonify(data) + return data, 503 + + +@app.route("/api/sdnc-config-db/v4/profile-config/<snssai>", methods=["GET"]) +def get_profile_config(snssai): + data, status = get_profile_config_for_nssai(snssai) + if not status: + return jsonify(data) + return data, 503 + + +@app.route("/api/sdnc-config-db/v4/subscriber-details/<snssai>", + methods=["GET"]) +def get_subscriber_details(snssai): + data, status = get_subscriber_details_for_nssai(snssai) + if not status: + return jsonify(data) + return data, 503 + + +app.run(host='0.0.0.0') diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_cell_list_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_cell_list_001_00110.json new file mode 100644 index 00000000..f01f0b98 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_cell_list_001_00110.json @@ -0,0 +1,111 @@ +{ + +"11":[ + +{ + +"cellLocalId":103593999, + +"operationalState":"ENABLED", + +"administrativeState":"UNLOCKED", + +"cellState":"ACTIVE", + +"pLMNInfoList":[ + +{ + +"pLMNId":"310-410", + +"sNSSAI":{ + +"sNSSAI":"001-00110", + +"status":"ACTIVE", + +"globalSubscriberId":null, + +"subscriptionServiceType":null, + +"configData":{ + +"dLThptPerSlice":20, + +"uLThptPerSlice":15, + +"maxNumberOfConns":null, + +"lastUpdatedTS":"2020-10-13T07:02:28.000+0000" + +} + +} + +} + +], + +"nRPCI":12, + +"nRTAC":310, + +"resourceType":"PRB" + +}, + +{ + +"cellLocalId":103593989, + +"operationalState":"ENABLED", + +"administrativeState":"UNLOCKED", + +"cellState":"ACTIVE", + +"pLMNInfoList":[ + +{ + +"pLMNId":"310-410", + +"sNSSAI":{ + +"sNSSAI":"001-00110", + +"status":"ACTIVE", + +"globalSubscriberId":null, + +"subscriptionServiceType":null, + +"configData":{ + +"dLThptPerSlice":20, + +"uLThptPerSlice":15, + +"maxNumberOfConns":null, + +"lastUpdatedTS":"2020-10-13T12:03:56.000+0000" + +} + +} + +} + +], + +"nRPCI":12, + +"nRTAC":310, + +"resourceType":"PRB" + +} + +] + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_cell_list_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_cell_list_001_010000.json new file mode 100644 index 00000000..54b2b7c5 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_cell_list_001_010000.json @@ -0,0 +1,323 @@ +{ + + "22":[ + + { + + "cellLocalId":112951562, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":112951561, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":112951568, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + } + + ], + + "11":[ + + { + + "cellLocalId":95697174, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":95697175, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":95697155, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + } + + ] + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_list_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_list_001_00110.json new file mode 100644 index 00000000..a4c6f2ff --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_list_001_00110.json @@ -0,0 +1,129 @@ +[ + +{ + +"gNBDUId":1, + +"gNBId":98763, + +"gNBIdLength":5, + +"gNBDUName":"gnduserver1", + +"pLMNId":"310-410", + +"nFType":"DU", + +"cellDUList":[ + +{ + +"cellLocalId":103593989, + +"operationalState":"ENABLED", + +"administrativeState":"UNLOCKED", + +"cellState":"ACTIVE", + +"pLMNInfoList":[ + +{ + +"pLMNId":"310-410", + +"sNSSAI":{ + +"sNSSAI":"001-00110", + +"status":"ACTIVE", + +"globalSubscriberId":null, + +"subscriptionServiceType":null, + +"configData":{ + +"dLThptPerSlice":20, + +"uLThptPerSlice":15, + +"maxNumberOfConns":null, + +"lastUpdatedTS":"2020-10-13T12:03:56.000+0000" + +} + +} + +} + +], + +"nRPCI":12, + +"nRTAC":310, + +"resourceType":"PRB" + +}, + +{ + +"cellLocalId":103593999, + +"operationalState":"ENABLED", + +"administrativeState":"UNLOCKED", + +"cellState":"ACTIVE", + +"pLMNInfoList":[ + +{ + +"pLMNId":"310-410", + +"sNSSAI":{ + +"sNSSAI":"001-00110", + +"status":"ACTIVE", + +"globalSubscriberId":null, + +"subscriptionServiceType":null, + +"configData":{ + +"dLThptPerSlice":20, + +"uLThptPerSlice":15, + +"maxNumberOfConns":null, + +"lastUpdatedTS":"2020-10-13T07:02:28.000+0000" + +} + +} + +} + +], + +"nRPCI":12, + +"nRTAC":310, + +"resourceType":"PRB" + +} + +], + +"nearRTRICId":null + +} + +] diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_list_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_list_001_010000.json new file mode 100644 index 00000000..82d7fb1a --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/du_list_001_010000.json @@ -0,0 +1,359 @@ +[ + + { + + "gNBDUId":2, + + "gNBId":98763, + + "gNBIdLength":5, + + "gNBDUName":"gnduserver2", + + "pLMNId":"310-410", + + "nFType":"DU", + + "cellDUList":[ + + { + + "cellLocalId":95697155, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":95697174, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":95697175, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + } + + ], + + "nearRTRICId":null + + }, + + { + + "gNBDUId":4, + + "gNBId":98763, + + "gNBIdLength":5, + + "gNBDUName":"gnduserver4", + + "pLMNId":"310-410", + + "nFType":"DU", + + "cellDUList":[ + + { + + "cellLocalId":112951561, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":112951562, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + }, + + { + + "cellLocalId":112951568, + + "operationalState":"ENABLED", + + "administrativeState":"UNLOCKED", + + "cellState":"ACTIVE", + + "pLMNInfoList":[ + + { + + "pLMNId":"310-410", + + "sNSSAI":{ + + "sNSSAI":"001-010000", + + "status":"ACTIVE", + + "globalSubscriberId":null, + + "subscriptionServiceType":null, + + "configData":{ + + "dLThptPerSlice":9, + + "uLThptPerSlice":10, + + "maxNumberOfConns":null, + + "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" + + } + + } + + } + + ], + + "nRPCI":12, + + "nRTAC":310, + + "resourceType":"PRB" + + } + + ], + + "nearRTRICId":null + + } + +] diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/profile_config_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/profile_config_001_00110.json new file mode 100644 index 00000000..533095fc --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/profile_config_001_00110.json @@ -0,0 +1,9 @@ +{ + +"maxNumberOfConns":3000, + +"dLThptPerSlice":50, + +"uLThptPerSlice":40 + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/profile_config_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/profile_config_001_010000.json new file mode 100644 index 00000000..422a6fa3 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/profile_config_001_010000.json @@ -0,0 +1,9 @@ +{ + + "maxNumberOfConns":3000, + + "dLThptPerSlice":54, + + "uLThptPerSlice":60 + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/slice_config_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/slice_config_001_00110.json new file mode 100644 index 00000000..013318a2 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/slice_config_001_00110.json @@ -0,0 +1,15 @@ +{ + +"11":{ + +"dLThptPerSlice":20, + +"uLThptPerSlice":15, + +"maxNumberOfConns":null, + +"lastUpdatedTS":"2020-10-13T12:01:34.000+0000" + +} + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/slice_config_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/slice_config_001_010000.json new file mode 100644 index 00000000..7d326c20 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/slice_config_001_010000.json @@ -0,0 +1,27 @@ +{ + + "22":{ + + "dLThptPerSlice":27, + + "uLThptPerSlice":30, + + "maxNumberOfConns":3000, + + "lastUpdatedTS":"2020-11-03T07:40:45.000+0000" + + }, + + "11":{ + + "dLThptPerSlice":27, + + "uLThptPerSlice":30, + + "maxNumberOfConns":3000, + + "lastUpdatedTS":"2020-11-03T07:40:28.000+0000" + + } + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/subscriber-details_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/subscriber-details_001_00110.json new file mode 100644 index 00000000..5149513e --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/subscriber-details_001_00110.json @@ -0,0 +1,13 @@ +{ + +"subscriptionServiceType":"Premium", + +"sliceProfileId":"878f32c0-3699-4dbd-95a3-1f01d6c763fd", + +"ranNFNSSIId":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82", + +"globalSubscriberId":"Customer-001", + +"sNSSAI":"001-00110" + +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/subscriber-details_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/subscriber-details_001_010000.json new file mode 100644 index 00000000..e7026672 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/subscriber-details_001_010000.json @@ -0,0 +1,13 @@ +{ + + "subscriptionServiceType":"Premium", + + "sliceProfileId":"878f32c0-3699-4dbd-95a3-1f01d6c763fd", + + "ranNFNSSIId":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82", + + "globalSubscriberId":"Customer-001", + + "sNSSAI":"001-010000" + +} |