-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added support for the edge switchover
version bump
- Loading branch information
Showing
5 changed files
with
87 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ python_distribution( | |
sdist=True, | ||
provides=setup_py( | ||
name="era_5g_client", | ||
version="0.11.0", | ||
version="1.0.0", | ||
description="A client for 5G-ERA Network Applications", | ||
author="Michal Kapinus", | ||
author_email="[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
python_tests() | ||
|
||
python_sources( | ||
name="tests0", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import uuid | ||
from typing import Tuple | ||
|
||
from flask import Flask, Response, jsonify | ||
|
||
app = Flask(__name__) | ||
|
||
|
||
url = "http://localhost:5800" | ||
counter = 1 | ||
|
||
|
||
@app.route("/Login", methods=["POST"]) | ||
def login() -> Tuple[Response, int]: | ||
# Generate a random token | ||
token = str(uuid.uuid4()) | ||
return jsonify({"token": token}), 200 | ||
|
||
|
||
@app.route("/Task/Plan", methods=["POST"]) | ||
def create_task_plan() -> Response: | ||
global counter | ||
counter = 1 | ||
action_plan_id = str(uuid.uuid4()) | ||
response = {"ActionPlanId": action_plan_id} | ||
return jsonify(response) | ||
|
||
|
||
@app.route("/orchestrate/orchestrate/plan/<string:action_plan_id>", methods=["GET"]) | ||
def get_orchestrated_plan(action_plan_id: str) -> Response: | ||
global counter | ||
url_local = url | ||
counter += 1 | ||
if counter >= 10: | ||
url_local = "http://localhost:5801" | ||
response = {"actionSequence": [{"Services": [{"serviceStatus": "Active", "serviceUrl": url_local}]}]} | ||
return jsonify(response) | ||
|
||
|
||
@app.route("/orchestrate/orchestrate/plan/<string:action_plan_id>", methods=["DELETE"]) | ||
def delete_orchestrated_plan(action_plan_id: str) -> Response: | ||
global counter | ||
counter = 1 | ||
return jsonify({}) | ||
|
||
|
||
if __name__ == "__main__": | ||
app.run(debug=True) |