X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2dms%2Fapi%2Fdms_route.py;fp=o2dms%2Fapi%2Fdms_route.py;h=032ebe9fd524acf79809268cc07e83ed6d2fab09;hb=513d34988f76825846a2379078eb4aedcaed9f27;hp=c92bdc13f2ffc16170a81885e34960a4607dcdb4;hpb=1a9dcb5b8f598ee348f23eafecc2d92ef09c8122;p=pti%2Fo2.git diff --git a/o2dms/api/dms_route.py b/o2dms/api/dms_route.py index c92bdc1..032ebe9 100644 --- a/o2dms/api/dms_route.py +++ b/o2dms/api/dms_route.py @@ -13,9 +13,9 @@ # limitations under the License. # from flask import jsonify -from os.path import exists -from flask import send_file -from flask_restx import Resource, reqparse +# from os.path import exists +# from flask import send_file +from flask_restx import Resource from o2dms.api.dms_dto import DmsDTO from o2dms.api import dms_lcm_view @@ -33,8 +33,8 @@ def configure_api_route(): # ---------- DeploymentManagers ---------- # @api_dms_lcm_v1.route("/") @api_dms_lcm_v1.param('deploymentManagerID', 'ID of the deployment manager') -@api_dms_lcm_v1.param('profile', 'DMS profile', - location='args') +# @api_dms_lcm_v1.param('profile', 'DMS profile: value supports "sol0018"', +# _in='query', default='sol0018') @api_dms_lcm_v1.response(404, 'Deployment manager not found') class DmsGetRouter(Resource): @@ -48,31 +48,33 @@ class DmsGetRouter(Resource): )) bus = MessageBus.get_instance() - parser = reqparse.RequestParser() - parser.add_argument('profile', location='args') - args = parser.parse_args() + # parser = reqparse.RequestParser() + # parser.add_argument('profile', location='args') + # args = parser.parse_args() + # result = dms_lcm_view.deployment_manager_one( + # deploymentManagerID, bus.uow, args.profile) result = dms_lcm_view.deployment_manager_one( - deploymentManagerID, bus.uow, args.profile) + deploymentManagerID, bus.uow) if result is not None: return result api_dms_lcm_v1.abort(404, "Deployment manager {} doesn't exist".format( deploymentManagerID)) -@api_dms_lcm_v1.route("//download/") -@api_dms_lcm_v1.param('deploymentManagerID', - 'ID of the deployment manager') -@api_dms_lcm_v1.param('filename', - 'profile filename') -@api_dms_lcm_v1.response(404, 'profile not found') -class DeploymentManagerGetFileRouter(Resource): - def get(self, deploymentManagerID, filename): - path = "/tmp/kubeconfig_" + filename +# @api_dms_lcm_v1.route("//download/") +# @api_dms_lcm_v1.param('deploymentManagerID', +# 'ID of the deployment manager') +# @api_dms_lcm_v1.param('filename', +# 'profile filename') +# @api_dms_lcm_v1.response(404, 'profile not found') +# class DeploymentManagerGetFileRouter(Resource): +# def get(self, deploymentManagerID, filename): +# path = "/tmp/kubeconfig_" + filename - if exists(path): - return send_file(path, as_attachment=True) - api_dms_lcm_v1.abort( - 404, - "Deployment manager {}'s Kube config file doesn't exist". - format(deploymentManagerID)) +# if exists(path): +# return send_file(path, as_attachment=True) +# api_dms_lcm_v1.abort( +# 404, +# "Deployment manager {}'s Kube config file doesn't exist". +# format(deploymentManagerID))