summaryrefslogtreecommitdiffstats
path: root/osdfapp.py
diff options
context:
space:
mode:
authorkrishnaa96 <krishna.moorthy6@wipro.com>2020-03-23 13:11:07 +0530
committerkrishnaa96 <krishna.moorthy6@wipro.com>2020-03-23 13:16:31 +0530
commitfcb37e97e37137d3111924e993e75fdb83c2a0a0 (patch)
treeb907cf4f4fb01b8961747f50caf9b9937e0b54fe /osdfapp.py
parentf0f912e2e8cb23952099c3df83167181a50ab2f8 (diff)
Add functionality to support NSI selection
Issue-ID: OPTFRA-677 Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com> Change-Id: Ibc51e15fce4692a445df400053060d3a6977b4ce
Diffstat (limited to 'osdfapp.py')
-rwxr-xr-xosdfapp.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/osdfapp.py b/osdfapp.py
index c0a554e..fdc2c1d 100755
--- a/osdfapp.py
+++ b/osdfapp.py
@@ -34,6 +34,8 @@ from apps.pci.optimizers.pci_opt_processor import process_pci_optimation
from apps.placement.models.api.placementRequest import PlacementAPI
from apps.placement.optimizers.conductor.remote_opt_processor import process_placement_opt
from apps.route.optimizers.simple_route_opt import RouteOpt
+from apps.slice_selection.models.api.nsi_selection_request import NSISelectionAPI
+from apps.slice_selection.optimizers.conductor.remote_opt_processor import process_nsi_selection_opt
from osdf.adapters.policy.interface import get_policies
from osdf.adapters.policy.interface import upload_policy_models
from osdf.config.base import osdf_config
@@ -137,5 +139,15 @@ def do_pci_optimization():
request_status="accepted", status_message="")
+@app.route("/api/oof/selection/nsi/v1", methods=["POST"])
+def do_nsi_selection():
+ request_json = request.get_json()
+ req_id = request_json['requestInfo']['requestId']
+ g.request_id = req_id
+ audit_log.info(MH.received_request(request.url, request.remote_addr, json.dumps(request_json)))
+ NSISelectionAPI(request_json).validate()
+ return process_nsi_selection_opt(request_json, osdf_config)
+
+
if __name__ == "__main__":
run_app()