diff options
author | Chayal, Avteet (ac229e) <ac229e@att.com> | 2018-09-19 00:35:17 +0000 |
---|---|---|
committer | Chayal, Avteet (ac229e) <ac229e@att.com> | 2018-09-19 20:10:36 +0000 |
commit | d7eb44a65b37000d5d30245e6ac26bd68827804d (patch) | |
tree | ef0e6a3c092ca2518e671b56276bb9b6512fd2a0 /osdfapp.py | |
parent | b84ac0be84c53d3a93b44b9a6ffc2d262e9b213a (diff) |
CVS changes for osdf placment api
Implemented ONAP Common Versioning Strategy
Issue-ID: OPTFRA-285
Change-Id: I31df699afddbeb8962b2ca0fa501eff45f70ed5d
Signed-off-by: Chayal, Avteet (ac229e) <ac229e@att.com>
Diffstat (limited to 'osdfapp.py')
-rwxr-xr-x | osdfapp.py | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -49,6 +49,7 @@ from osdf.models.api.pciOptimizationRequest import PCIOptimizationAPI from osdf.operation.responses import osdf_response_for_request_accept as req_accept from osdf.optimizers.routeopt.simple_route_opt import RouteOpt from osdf.optimizers.pciopt.pci_opt_processor import process_pci_optimation +from osdf.utils import api_data_utils ERROR_TEMPLATE = osdf.ERROR_TEMPLATE @@ -107,6 +108,16 @@ def do_osdf_health_check(): @app.route("/api/oof/v1/placement", methods=["POST"]) @auth_basic.login_required def do_placement_opt(): + return placement_rest_api() + + +@app.route("/api/oof/placement/v1", methods=["POST"]) +@auth_basic.login_required +def do_placement_opt_common_versioning(): + return placement_rest_api() + + +def placement_rest_api(): """Perform placement optimization after validating the request and fetching policies Make a call to the call-back URL with the output of the placement request. Note: Call to Conductor for placement optimization may have redirects, so account for them @@ -115,6 +126,7 @@ def do_placement_opt(): 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))) + api_version_info = api_data_utils.retrieve_version_info(request, req_id) PlacementAPI(request_json).validate() policies = get_policies(request_json, "placement") audit_log.info(MH.new_worker_thread(req_id, "[for placement]")) @@ -123,7 +135,7 @@ def do_placement_opt(): audit_log.info(MH.accepted_valid_request(req_id, request)) return req_accept(request_id=req_id, transaction_id=request_json['requestInfo']['transactionId'], - request_status="accepted", status_message="") + version_info=api_version_info, request_status="accepted", status_message="") @app.route("/api/oof/v1/route", methods=["POST"]) |