summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpawel.denst <pawel.denst@external.t-mobile.pl>2023-03-17 15:16:39 +0000
committerpawel.denst <pawel.denst@external.t-mobile.pl>2023-03-21 14:39:22 +0000
commited19aa09d4cda22f42ee3deeb010b1a4a5735dba (patch)
treee4f26a57c7e7b759baaed55c2b18c5d7c6142947
parent870ff702088b89549bc21631eb48443fff0bcd71 (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
-rw-r--r--mock-msb-k8s/app/app.py38
-rw-r--r--mock-msb-k8s/requirements.txt4
-rw-r--r--mock-sdnc/app.py2
-rw-r--r--mock-sdnc/requirements.txt2
-rw-r--r--mock-so/app.py2
-rw-r--r--mock-so/requirements.txt2
-rw-r--r--mock-ves/requirements.txt2
7 files changed, 25 insertions, 27 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
diff --git a/mock-sdnc/app.py b/mock-sdnc/app.py
index f5899e1..9df8069 100644
--- a/mock-sdnc/app.py
+++ b/mock-sdnc/app.py
@@ -32,4 +32,4 @@ api.add_resource(
if __name__ == "__main__":
- app.run(host="0.0.0.0", debug=True)
+ app.run(host="0.0.0.0", debug=True, port=5002)
diff --git a/mock-sdnc/requirements.txt b/mock-sdnc/requirements.txt
index 8c695e4..9ddac2c 100644
--- a/mock-sdnc/requirements.txt
+++ b/mock-sdnc/requirements.txt
@@ -1 +1 @@
-Flask-RESTful==0.3.8
+Flask-RESTful==0.3.9
diff --git a/mock-so/app.py b/mock-so/app.py
index b1d6db2..cd31bed 100644
--- a/mock-so/app.py
+++ b/mock-so/app.py
@@ -123,4 +123,4 @@ api.add_resource(
if __name__ == "__main__":
- app.run(host="0.0.0.0", debug=True)
+ app.run(host="0.0.0.0", debug=True, port=5001)
diff --git a/mock-so/requirements.txt b/mock-so/requirements.txt
index f733aba..7ef7e3f 100644
--- a/mock-so/requirements.txt
+++ b/mock-so/requirements.txt
@@ -1,2 +1,2 @@
-Flask-RESTful==0.3.8
+Flask-RESTful==0.3.9
requests==2.23.0 \ No newline at end of file
diff --git a/mock-ves/requirements.txt b/mock-ves/requirements.txt
index 07da031..9c2c5a0 100644
--- a/mock-ves/requirements.txt
+++ b/mock-ves/requirements.txt
@@ -1,2 +1,2 @@
-Flask-RESTful==0.3.8
+Flask-RESTful==0.3.9
requests[socks]==2.24.0 \ No newline at end of file