summaryrefslogtreecommitdiffstats
path: root/apps/slice_selection
diff options
context:
space:
mode:
authorkrishnaa96 <krishna.moorthy6@wipro.com>2020-04-28 12:49:39 +0530
committerkrishnaa96 <krishna.moorthy6@wipro.com>2020-04-28 12:50:50 +0530
commite87411e6df60a0ead2f90c6975b5cea8ba1db20d (patch)
tree9fcc347572a3f25aa7a4252eb765cf72469955e9 /apps/slice_selection
parentd4a0085a8f75c62912d19613459ad1bc3dce3e73 (diff)
Add nsi info in the nsi selection response
Issue-ID: OPTFRA-746 Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com> Change-Id: I799c9575b781d858b47e6695050f7f79308fdd43
Diffstat (limited to 'apps/slice_selection')
-rw-r--r--apps/slice_selection/optimizers/conductor/response_processor.py13
1 files changed, 9 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..a841cb5 100644
--- a/apps/slice_selection/optimizers/conductor/response_processor.py
+++ b/apps/slice_selection/optimizers/conductor/response_processor.py
@@ -43,12 +43,17 @@ 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')
shared_nsi_solutions.append(shared_nsi_solution)
else:
nssi_solutions = get_nssi_solutions(recommendation)