diff options
author | krishnaa96 <krishna.moorthy6@wipro.com> | 2020-03-23 13:11:07 +0530 |
---|---|---|
committer | krishnaa96 <krishna.moorthy6@wipro.com> | 2020-03-23 13:16:31 +0530 |
commit | fcb37e97e37137d3111924e993e75fdb83c2a0a0 (patch) | |
tree | b907cf4f4fb01b8961747f50caf9b9937e0b54fe /osdfapp.py | |
parent | f0f912e2e8cb23952099c3df83167181a50ab2f8 (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-x | osdfapp.py | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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() |