Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
kreynoldsf5 committed May 1, 2024
1 parent 3de8c84 commit 4a9f0b0
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 20 deletions.
31 changes: 20 additions & 11 deletions labapp/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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'])
Expand All @@ -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')
Expand All @@ -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')
Expand All @@ -152,7 +148,7 @@ def path():
title="MCN Practical: HTTP Routing",
content=html,
ns=ns,
udf=app.config['UDF']

)

@app.route('/manipulation')
Expand All @@ -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')
Expand Down Expand Up @@ -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__':
Expand Down
35 changes: 27 additions & 8 deletions labapp/app/markdown/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ The lab environment contains three distributed sites meshed using the F5 Distrib

<ul class="list-group">
<li class="list-group-item">
<img src="/static/mcnp-aws.png" width="auto" height="30px"> &nbsp; &nbsp;
<img src="/static/mcnp-aws.png" width="auto" height="30px"> &nbsp;&nbsp;
<strong>student-awsnet</strong> in Amazon Web Services
</li>
<li class="list-group-item">
<img src="/static/mcnp-azure.png" width="auto" height="30px"> &nbsp; &nbsp;
<img src="/static/mcnp-azure.png" width="auto" height="30px"> &nbsp;&nbsp;&nbsp;
<strong>student-azurenet</strong> in Microsoft Azure
</li>
<li class="list-group-item">
<img src="/static/mcnp-udf.png" width="auto" height="30px"> &nbsp; &nbsp;&nbsp;
<img src="/static/mcnp-udf.png" width="auto" height="30px"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<strong>Lab CE</strong> in UDF
</li>
</ul>
Expand All @@ -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**.

<div style="height:25px"></div>

## **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.

<div href="/" class="d-flex align-items-center pb-3 mb-3 link-dark text-decoration-none border-bottom"></div>

Expand Down
2 changes: 1 addition & 1 deletion labapp/app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
</div>
</li>
</ul>
{% if udf %}
{% if config['UDF'] %}
<script>
function fetchAndUpdateStatus() {
fetch('/_ce_status')
Expand Down

0 comments on commit 4a9f0b0

Please sign in to comment.