summaryrefslogtreecommitdiffstats
path: root/osdfapp.py
diff options
context:
space:
mode:
authorseshukm <seshu.kumar.m@huawei.com>2020-03-05 18:56:32 +0530
committerseshukm <seshu.kumar.m@huawei.com>2020-03-05 18:56:32 +0530
commit5c8e0e4e54f8cfa3c1ec034ccb5b6f5c14eb0b50 (patch)
tree1799ee5f3b3463aa9a88b4b60540f5c3dc935e89 /osdfapp.py
parent2e2d7f666ad84d6fe18c86ad7718fd89f2c9448e (diff)
take-1 for the NST selection function
Issue-ID: OPTFRA-675 Signed-off-by: seshukm <seshu.kumar.m@huawei.com> Change-Id: Id48f33344c516f2711e24bce9f07adbd835eded0
Diffstat (limited to 'osdfapp.py')
-rwxr-xr-xosdfapp.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/osdfapp.py b/osdfapp.py
index 71106fd..bd9f081 100755
--- a/osdfapp.py
+++ b/osdfapp.py
@@ -26,7 +26,9 @@ from threading import Thread # for scaling up, may need celery with RabbitMQ or
from flask import request, g
from osdf.apps.baseapp import app, run_app
+from apps.nst.models.api.nstSelectionRequest import NSTSelectionAPI
from apps.pci.models.api.pciOptimizationRequest import PCIOptimizationAPI
+from apps.nst.optimizers.nst_select_processor import process_nst_selection
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
@@ -98,6 +100,13 @@ def do_route_calc():
audit_log.info("Calculate Route request received!")
return RouteOpt().getRoute(request_json)
+@app.route("/api/oof/v1/selection/nst", methods=["POST"])
+def do_nst_selection():
+ request_json = request.get_json()
+ req_id = request_json['requestInfo']['requestId']
+ NSTSelectionAPI(request_json).validate()
+ response = process_nst_selection(request_json, osdf_config)
+ return response
@app.route("/api/oof/v1/pci", methods=["POST"])
@app.route("/api/oof/pci/v1", methods=["POST"])