aboutsummaryrefslogtreecommitdiffstats
path: root/osdfapp.py
diff options
context:
space:
mode:
authorVikas Varma <vikas.varma@att.com>2020-03-25 13:49:53 +0000
committerGerrit Code Review <gerrit@onap.org>2020-03-25 13:49:53 +0000
commit0c9d9098ba21f79fe4e721b38e1e7c311c958964 (patch)
tree86251e73b14af3018deb70072bfa337ccac00c93 /osdfapp.py
parentbb5346f671007485776b1f71ed1e1b337e787603 (diff)
parentfcb37e97e37137d3111924e993e75fdb83c2a0a0 (diff)
Merge "Add functionality to support NSI selection"
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()