aboutsummaryrefslogtreecommitdiffstats
path: root/apps/slice_selection/optimizers/conductor/response_processor.py
diff options
context:
space:
mode:
Diffstat (limited to 'apps/slice_selection/optimizers/conductor/response_processor.py')
-rw-r--r--apps/slice_selection/optimizers/conductor/response_processor.py26
1 files changed, 22 insertions, 4 deletions
diff --git a/apps/slice_selection/optimizers/conductor/response_processor.py b/apps/slice_selection/optimizers/conductor/response_processor.py
index 5b7be01..c175c1a 100644
--- a/apps/slice_selection/optimizers/conductor/response_processor.py
+++ b/apps/slice_selection/optimizers/conductor/response_processor.py
@@ -43,12 +43,30 @@ def conductor_response_processor(overall_recommendations, nst_info_map, request_
for nst_name, recommendations in overall_recommendations.items():
for recommendation in recommendations:
- nsi_set = set(values['candidate']['nsi_name'] for key, values in recommendation.items())
+ nsi_set = set(values['candidate']['nsi_id'] for key, values in recommendation.items())
if len(nsi_set) == 1:
- nsi = nsi_set.pop()
- debug_log.debug("The NSSIs in the solution belongs to the same NSI {}".format(nsi))
+ nsi_id = nsi_set.pop()
+ candidate = list(recommendation.values())[0]['candidate']
+ debug_log.debug("The NSSIs in the solution belongs to the same NSI {}"
+ .format(nsi_id))
shared_nsi_solution = dict()
- shared_nsi_solution["NSIName"] = nsi
+ shared_nsi_solution["NSIId"] = nsi_id
+ 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)