aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrishnaa96 <krishna.moorthy6@wipro.com>2020-05-01 13:34:50 +0530
committerkrishnaa96 <krishna.moorthy6@wipro.com>2020-05-01 13:36:38 +0530
commit070488fcb919b2cdffca8a3739b0f9abbb9414f4 (patch)
treecbc23ec9149d8409084fba1847e7d4bc35887d56
parent375d7bd29cdc687e11ae27183a20653e76bfba3c (diff)
Add NSSI and slice profile in shared NSI response
Issue-ID: OPTFRA-749 Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com> Change-Id: Ie41f07881dad20e54bc13e5c1d7a6be094972a35
-rw-r--r--apps/slice_selection/models/api/nsi_selection_response.py9
-rw-r--r--apps/slice_selection/optimizers/conductor/response_processor.py13
-rw-r--r--test/apps/slice_selection/shared_solution_nsi_response.json66
3 files changed, 71 insertions, 17 deletions
diff --git a/apps/slice_selection/models/api/nsi_selection_response.py b/apps/slice_selection/models/api/nsi_selection_response.py
index 9547200..a927efa 100644
--- a/apps/slice_selection/models/api/nsi_selection_response.py
+++ b/apps/slice_selection/models/api/nsi_selection_response.py
@@ -22,12 +22,21 @@ from schematics.types.compound import ModelType, ListType, DictType
# TODO: update osdf.models
+class NSSI(OSDFModel):
+ NSSIId = StringType(required=True)
+ NSSIName = StringType(required=True)
+ UUID = StringType(required=True)
+ invariantUUID = StringType(required=True)
+ sliceProfile = ListType(DictType(BaseType))
+
+
class SharedNSISolution(OSDFModel):
invariantUUID = StringType(required=True)
UUID = StringType(required=True)
NSIName = StringType(required=True)
NSIId = StringType(required=True)
matchLevel = StringType(required=True)
+ NSSIs = ListType(ModelType(NSSI))
class NSSTInfo(OSDFModel):
diff --git a/apps/slice_selection/optimizers/conductor/response_processor.py b/apps/slice_selection/optimizers/conductor/response_processor.py
index a841cb5..c175c1a 100644
--- a/apps/slice_selection/optimizers/conductor/response_processor.py
+++ b/apps/slice_selection/optimizers/conductor/response_processor.py
@@ -54,6 +54,19 @@ def conductor_response_processor(overall_recommendations, nst_info_map, request_
shared_nsi_solution["NSIName"] = candidate.get('nsi_name')
shared_nsi_solution["UUID"] = candidate.get('nsi_model_version_id')
shared_nsi_solution["invariantUUID"] = candidate.get('nsi_model_invariant_id')
+
+ nssi_info_list = get_nssi_solutions(recommendation)
+ nssis = list()
+ for nssi_info in nssi_info_list:
+ nssi = dict()
+ nssi["NSSIId"] = nssi_info.get("NSSISolution").get("NSSIId")
+ nssi["NSSIName"] = nssi_info.get("NSSISolution").get("NSSIName")
+ nssi["UUID"] = ""
+ nssi["invariantUUID"] = ""
+ nssi["sliceProfile"] = [nssi_info.get("sliceProfile")]
+ nssis.append(nssi)
+
+ shared_nsi_solution["NSSIs"] = nssis
shared_nsi_solutions.append(shared_nsi_solution)
else:
nssi_solutions = get_nssi_solutions(recommendation)
diff --git a/test/apps/slice_selection/shared_solution_nsi_response.json b/test/apps/slice_selection/shared_solution_nsi_response.json
index 5c94914..2c74196 100644
--- a/test/apps/slice_selection/shared_solution_nsi_response.json
+++ b/test/apps/slice_selection/shared_solution_nsi_response.json
@@ -1,19 +1,51 @@
{
- "requestId":"d290f1ee-6c54-4b01-90e6-d701748f0851",
- "transactionId":"d290f1ee-6c54-4b01-90e6-d701748f0851",
- "requestStatus":"completed",
- "statusMessage":"",
- "solutions":{
- "sharedNSISolutions":[
- {
- "NSIName":"nsi_test_0212",
- "NSIId":"7ecdfb7a-bc38-4abd-9cb3-6677d71e892f",
- "UUID":"c3d8a690-f138-4554-89af-9349aeb9b19a",
- "invariantUUID":"590b9fcf-6927-495e-a898-a1418dd4820c"
- }
- ],
- "newNSISolutions":[
-
- ]
- }
+ "requestId": "d290f1ee-6c54-4b01-90e6-d701748f0851",
+ "requestStatus": "completed",
+ "solutions": {
+ "newNSISolutions": [],
+ "sharedNSISolutions": [
+ {
+ "NSIId": "7ecdfb7a-bc38-4abd-9cb3-6677d71e892f",
+ "NSIName": "nsi_test_0212",
+ "NSSIs": [
+ {
+ "NSSIId": "1a636c4d-5e76-427e-bfd6-241a947224b0",
+ "NSSIName": "nssi_test_0211",
+ "UUID": "",
+ "invariantUUID": "",
+ "sliceProfile": [
+ {
+ "coverage_area_ta_list": "[{\"province\":\"??\",\"city\":\"???\",\"county\":\"???\",\"street\":\"?????\"}]",
+ "exp_data_rate_dl": 100,
+ "exp_data_rate_ul": 100,
+ "latency": 20,
+ "resource_sharing_level": "0",
+ "ue_mobility_level": "stationary"
+ }
+ ]
+ },
+ {
+ "NSSIId": "490c68b0-639c-11ea-bc55-0242ac130003",
+ "NSSIName": "nssi_test_ran_0211",
+ "UUID": "",
+ "invariantUUID": "",
+ "sliceProfile": [
+ {
+ "coverage_area_ta_list": "[{\"province\":\"??\",\"city\":\"???\",\"county\":\"???\",\"street\":\"?????\"}]",
+ "exp_data_rate_dl": 100,
+ "exp_data_rate_ul": 100,
+ "latency": 15,
+ "resource_sharing_level": "0",
+ "ue_mobility_level": "stationary"
+ }
+ ]
+ }
+ ],
+ "UUID": "c3d8a690-f138-4554-89af-9349aeb9b19a",
+ "invariantUUID": "590b9fcf-6927-495e-a898-a1418dd4820c"
+ }
+ ]
+ },
+ "statusMessage": "",
+ "transactionId": "d290f1ee-6c54-4b01-90e6-d701748f0851"
}