diff options
author | pawel.denst <pawel.denst@external.t-mobile.pl> | 2023-03-17 15:16:39 +0000 |
---|---|---|
committer | pawel.denst <pawel.denst@external.t-mobile.pl> | 2023-03-21 14:39:22 +0000 |
commit | ed19aa09d4cda22f42ee3deeb010b1a4a5735dba (patch) | |
tree | e4f26a57c7e7b759baaed55c2b18c5d7c6142947 /mock-msb-k8s | |
parent | 870ff702088b89549bc21631eb48443fff0bcd71 (diff) |
Fix ONAP SDK integration tests for k8s plugin
Changed Flask version and corrected endpoints for mock in msb-k8s
Issue-ID: INT-2212
Signed-off-by: pawel.denst <pawel.denst@external.t-mobile.pl>
Change-Id: I3a05dfb0b9aebb7914d1719d253ac259c45c213f
Diffstat (limited to 'mock-msb-k8s')
-rw-r--r-- | mock-msb-k8s/app/app.py | 38 | ||||
-rw-r--r-- | mock-msb-k8s/requirements.txt | 4 |
2 files changed, 20 insertions, 22 deletions
diff --git a/mock-msb-k8s/app/app.py b/mock-msb-k8s/app/app.py index 5da64d7..3e9cec9 100644 --- a/mock-msb-k8s/app/app.py +++ b/mock-msb-k8s/app/app.py @@ -76,7 +76,7 @@ INSTANCE_EXAMPLE = { } -@app.route('/api/multicloud-k8s/v1/v1/connectivity-info/<string:region_id>', methods=['GET', 'DELETE']) +@app.route('/v1/connectivity-info/<string:region_id>', methods=['GET', 'DELETE']) def connectivity_info_get_delete(region_id): if request.method == 'GET': for conninfo in CONNECTIVITY_INFOS: @@ -94,7 +94,7 @@ def connectivity_info_get_delete(region_id): return '', http.HTTPStatus.METHOD_NOT_ALLOWED -@app.route('/api/multicloud-k8s/v1/v1/connectivity-info', methods=['POST']) +@app.route('/v1/connectivity-info', methods=['POST']) def connectivity_info_create(): if request.method == 'POST': kubeconfig = request.files['file'] @@ -108,7 +108,7 @@ def connectivity_info_create(): return '', http.HTTPStatus.METHOD_NOT_ALLOWED -@app.route('/api/multicloud-k8s/v1/v1/rb/definition', methods=['POST']) +@app.route('/v1/rb/definition', methods=['POST']) def definition_create(): if request.method == 'POST': data = json.loads(request.data) @@ -123,7 +123,7 @@ def definition_create(): return '', http.HTTPStatus.METHOD_NOT_ALLOWED -@app.route('/api/multicloud-k8s/v1/v1/rb/definition/<string:rb_name>/<string:rb_version>/content', methods=['POST']) +@app.route('/v1/rb/definition/<string:rb_name>/<string:rb_version>/content', methods=['POST']) def definition_upload_artifact(rb_name, rb_version): if request.method == 'POST': data = request.data @@ -131,7 +131,7 @@ def definition_upload_artifact(rb_name, rb_version): return '', http.HTTPStatus.METHOD_NOT_ALLOWED -@app.route('/api/multicloud-k8s/v1/v1/rb/definition/<string:rb_name>/<string:rb_version>', methods=['GET', 'DELETE']) +@app.route('/v1/rb/definition/<string:rb_name>/<string:rb_version>', methods=['GET', 'DELETE']) def definition_get_delete(rb_name, rb_version): if request.method == 'GET': for rb in DEFINITIONS: @@ -149,14 +149,14 @@ def definition_get_delete(rb_name, rb_version): return '', http.HTTPStatus.METHOD_NOT_ALLOWED -@app.route('/api/multicloud-k8s/v1/v1/rb/definition', methods=['GET']) +@app.route('/v1/rb/definition', methods=['GET']) def definition_get_all(): if request.method == 'GET': return json.dumps(DEFINITIONS), http.HTTPStatus.OK return '', http.HTTPStatus.METHOD_NOT_ALLOWED -@app.route('/api/multicloud-k8s/v1/v1/rb/definition/<string:rb_name>/<string:rb_version>/profile', methods=['POST']) +@app.route('/v1/rb/definition/<string:rb_name>/<string:rb_version>/profile', methods=['POST']) def profile_create(**kwargs): if request.method == 'POST': data = json.loads(request.data) @@ -172,9 +172,7 @@ def profile_create(**kwargs): return '', http.HTTPStatus.METHOD_NOT_ALLOWED -@app.route( - '/api/multicloud-k8s/v1/v1/rb/definition/<string:rb_name>/<string:rb_version>/profile/<string:profile_name>/content' - , methods=['POST']) +@app.route('/v1/rb/definition/<string:rb_name>/<string:rb_version>/profile/<string:profile_name>/content', methods=['POST']) def profile_upload_artifact(rb_name, rb_version, profile_name): if request.method == 'POST': data = request.data @@ -182,7 +180,7 @@ def profile_upload_artifact(rb_name, rb_version, profile_name): return '', http.HTTPStatus.METHOD_NOT_ALLOWED -@app.route('/api/multicloud-k8s/v1/v1/rb/definition/<string:rb_name>/<string:rb_version>/profile/<string:profile_name>', +@app.route('/v1/rb/definition/<string:rb_name>/<string:rb_version>/profile/<string:profile_name>', methods=['GET', 'DELETE']) def profile_get_delete(rb_name, rb_version, profile_name): if request.method == 'GET': @@ -203,7 +201,7 @@ def profile_get_delete(rb_name, rb_version, profile_name): return '', http.HTTPStatus.METHOD_NOT_ALLOWED -@app.route('/api/multicloud-k8s/v1/v1/rb/definition/<string:rb_name>/<string:rb_version>/profile', methods=['GET']) +@app.route('/v1/rb/definition/<string:rb_name>/<string:rb_version>/profile', methods=['GET']) def profile_get_all(rb_name, rb_version): if request.method == 'GET': profiles = [] @@ -213,7 +211,7 @@ def profile_get_all(rb_name, rb_version): return json.dumps(PROFILES), http.HTTPStatus.OK return '', http.HTTPStatus.METHOD_NOT_ALLOWED -@app.route('/api/multicloud-k8s/v1/v1/instance', methods=['POST']) +@app.route('/v1/instance', methods=['POST']) def instance_create(): if request.method == 'POST': data = json.loads(request.data) @@ -224,7 +222,7 @@ def instance_create(): return instance_details, http.HTTPStatus.OK return '', http.HTTPStatus.METHOD_NOT_ALLOWED -@app.route('/api/multicloud-k8s/v1/v1/instance/<string:instance_id>', methods=['GET', 'DELETE']) +@app.route('/v1/instance/<string:instance_id>', methods=['GET', 'DELETE']) def instance_get_delete(instance_id): if request.method == 'GET': for instance in INSTANCES: @@ -242,14 +240,14 @@ def instance_get_delete(instance_id): return '', http.HTTPStatus.METHOD_NOT_ALLOWED -@app.route('/api/multicloud-k8s/v1/v1/instance', methods=['GET']) +@app.route('/v1/instance', methods=['GET']) def instance_get_all(): if request.method == 'GET': return json.dumps(INSTANCES), http.HTTPStatus.OK return '', http.HTTPStatus.METHOD_NOT_ALLOWED -@app.route('/api/multicloud-k8s/v1/v1/rb/definition/<string:rb_name>/<string:rb_version>/config-template', +@app.route('/v1/rb/definition/<string:rb_name>/<string:rb_version>/config-template', methods=["POST"]) def configuration_template_create(rb_name, rb_version): if request.method == "POST": @@ -260,19 +258,19 @@ def configuration_template_create(rb_name, rb_version): return '', http.HTTPStatus.METHOD_NOT_ALLOWED -@app.route('/api/multicloud-k8s/v1/v1/rb/definition/<string:rb_name>/<string:rb_version>/config-template/<string:name>', +@app.route('/v1/rb/definition/<string:rb_name>/<string:rb_version>/config-template/<string:template_name>', methods=["GET"]) -def configuration_template_get(rb_name, rb_version, name): +def configuration_template_get(rb_name, rb_version, template_name): if request.method == "GET": for template in CONFIGURATIONS_TEMPLATES: - if template['template-name'] == name: + if template['template-name'] == template_name: return json.dumps(template), http.HTTPStatus.OK else: return '', http.HTTPStatus.NOT_FOUND return '', http.HTTPStatus.METHOD_NOT_ALLOWED -@app.route('/api/multicloud-k8s/v1/v1/rb/definition/<string:rb_name>/<string:rb_version>/config-template', +@app.route('/v1/rb/definition/<string:rb_name>/<string:rb_version>/config-template', methods=["GET"]) def configuration_template_get_all(rb_name, rb_version): if request.method == 'GET': diff --git a/mock-msb-k8s/requirements.txt b/mock-msb-k8s/requirements.txt index 07e3f1f..bb3dbed 100644 --- a/mock-msb-k8s/requirements.txt +++ b/mock-msb-k8s/requirements.txt @@ -1,2 +1,2 @@ -Flask==1.1.2 -Flask-RESTful==0.3.8 +Flask>=2.2.2 +Flask-RESTful==0.3.9
\ No newline at end of file |