summaryrefslogtreecommitdiffstats
path: root/osdfapp.py
diff options
context:
space:
mode:
authorVikas Varma <vikas.varma@att.com>2020-03-05 20:35:20 +0000
committerGerrit Code Review <gerrit@onap.org>2020-03-05 20:35:20 +0000
commitc2b97eaebfcf1f39e1428cdc7b5a3539334087a0 (patch)
tree7ab4fead21aa21cff08e467b85c7dce67c8076d4 /osdfapp.py
parentb9cbf0028fd8db0d7ab9e845acc41b9f3ecb245f (diff)
parent4779a053f4a64028879711ef8108a554d682549a (diff)
Merge "changes in OSDF and optimizer for CCVPN get link requirement."
Diffstat (limited to 'osdfapp.py')
-rwxr-xr-xosdfapp.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/osdfapp.py b/osdfapp.py
index 71106fd..775beaf 100755
--- a/osdfapp.py
+++ b/osdfapp.py
@@ -21,6 +21,11 @@ OSDF Manager Main Flask Application
"""
import json
+import ssl
+import sys
+import time
+import traceback
+from optparse import OptionParser
from threading import Thread # for scaling up, may need celery with RabbitMQ or redis
from flask import request, g
@@ -89,14 +94,15 @@ def placement_rest_api():
version_info=api_version_info, request_status="accepted", status_message="")
-@app.route("/api/oof/v1/route", methods=["POST"])
+@app.route("/api/oof/route/v1", methods=["POST"])
def do_route_calc():
"""
Perform the basic route calculations and returnn the vpn-bindings
"""
request_json = request.get_json()
audit_log.info("Calculate Route request received!")
- return RouteOpt().getRoute(request_json)
+ response = RouteOpt().getRoute(request_json)
+ return response
@app.route("/api/oof/v1/pci", methods=["POST"])
@@ -104,7 +110,13 @@ def do_route_calc():
@auth_basic.login_required
def do_pci_optimization():
request_json = request.get_json()
+ audit_log.info('request json obtained==>')
+ audit_log.info(request_json)
+
req_id = request_json['requestInfo']['requestId']
+ audit_log.info('requestID obtained==>')
+ audit_log.info(req_id)
+
g.request_id = req_id
audit_log.info(MH.received_request(request.url, request.remote_addr, json.dumps(request_json)))
PCIOptimizationAPI(request_json).validate()
@@ -114,6 +126,7 @@ def do_pci_optimization():
t = Thread(target=process_pci_optimation, args=(request_json, osdf_config, None))
t.start()
audit_log.info(MH.accepted_valid_request(req_id, request))
+ audit_log.info('reached upto return')
return req_accept(request_id=req_id,
transaction_id=request_json['requestInfo']['transactionId'],
request_status="accepted", status_message="")