From 4a9f0b01c1d257b95c001957d6ee7aade2bd8b6e Mon Sep 17 00:00:00 2001 From: Kevin Reynolds Date: Wed, 1 May 2024 00:46:39 -0400 Subject: [PATCH] test --- labapp/app/app.py | 31 ++++++++++++++++++----------- labapp/app/markdown/overview.md | 35 +++++++++++++++++++++++++-------- labapp/app/templates/base.html | 2 +- 3 files changed, 48 insertions(+), 20 deletions(-) diff --git a/labapp/app/app.py b/labapp/app/app.py index 095d642..b26e6e0 100644 --- a/labapp/app/app.py +++ b/labapp/app/app.py @@ -84,8 +84,7 @@ def index(): html = render_md("markdown/welcome.md") return render_template('standard.html', title="MCN Practical: Overview", - content=html, - udf=app.config['UDF'] + content=html ) @app.route('/overview') @@ -94,8 +93,7 @@ def arch(): html = render_md("markdown/overview.md") return render_template('standard.html', title="MCN Practical: Architecture", - content=html, - udf=app.config['UDF'] + content=html ) @app.route('/setup', methods=['GET', 'POST']) @@ -120,8 +118,7 @@ def setup(): html = render_md("markdown/setup.md") return render_template('setup.html', title="MCN Practical: Setup", - content=html, - udf=app.config['UDF'] + content=html ) @app.route('/_ce_status') @@ -139,8 +136,7 @@ def lb(): return render_template('exercise_standard.html', title="MCN Practical: LB", content=html, - ns=ns, - udf=app.config['UDF'] + ns=ns ) @app.route('/route') @@ -152,7 +148,7 @@ def path(): title="MCN Practical: HTTP Routing", content=html, ns=ns, - udf=app.config['UDF'] + ) @app.route('/manipulation') @@ -163,8 +159,7 @@ def header(): return render_template('exercise_standard.html', title="MCN Practical: Manipulation", content=html, - ns=ns, - udf=app.config['UDF'] + ns=ns ) @app.route('/_lb1') @@ -232,6 +227,20 @@ def route2(): return jsonify(status='success', data=data) except (LabException, requests.RequestException, ValueError) as e: return jsonify(status='fail', error=str(e)) + +@app.route('/_manip1') +def manip1(): + """First Manip Test""" + try: + ns = eph_ns() + if not ns: + raise LabException("Ephemeral NS not set") + base_url = app.config['base_url'] + url = f"https://{ns}.{base_url}/" + r_data = cloudapp_fetch(url, 5, 'info[path]', '/') + return jsonify(status='success', data=r_data) + except (LabException, requests.RequestException, ValueError) as e: + return jsonify(status='fail', error=str(e)) if __name__ == '__main__': diff --git a/labapp/app/markdown/overview.md b/labapp/app/markdown/overview.md index 400f1ce..9467dc7 100644 --- a/labapp/app/markdown/overview.md +++ b/labapp/app/markdown/overview.md @@ -18,15 +18,15 @@ The lab environment contains three distributed sites meshed using the F5 Distrib @@ -41,18 +41,37 @@ An instance of the [cloud app](https://github.com/f5devcentral/f5xc-lab-mcn-prac The [cloud app](https://github.com/f5devcentral/f5xc-lab-mcn-practical/tree/main/cloudapp) is a simple application that echoes back an HTTP request. Remember while working through the lab, unless otherwise noted, the tests are displaying the headers and info **from the request received by the app**. +
## **Lab Exercises** -To complete the lab exercises, you will interact with a load balancer advertised from the Customer Edge in your UDF site in this [lab app](https://github.com/f5devcentral/f5xc-lab-mcn-practical/tree/main/labapp). +To complete the lab exercises, you will interact with a load balancer advertised from the Customer Edge in your UDF site from the [lab app](https://github.com/f5devcentral/f5xc-lab-mcn-practical/tree/main/labapp). + +Test button + + -Curl on the UDF Runner +```http +GET https://eph-ns.mcn-lab.f5demos.com/ HTTP/1.1 +Host: eph-ns.mcn-lab.f5demos.com -criteria with symbols +{ + "env": "Azure", + "info": { + "method": "GET", + "path": "/", + "url": "https://eph-ns.mcn-lab.f5demos.com" + }, + "request_headers": { + "Host": "https://eph-ns.mcn-lab.f5demos.com", + "User-Agent": "curl/8.4.0", + "X-Request-Id": "9cff4a3d-29e1-458e-b62e-3192e8398e14" + } +} +``` -code block -test +``curl`` and ``jq`` are provided on the UDF "Runner" instance. diff --git a/labapp/app/templates/base.html b/labapp/app/templates/base.html index 6055962..712e3a0 100644 --- a/labapp/app/templates/base.html +++ b/labapp/app/templates/base.html @@ -155,7 +155,7 @@ - {% if udf %} + {% if config['UDF'] %}