Commit 4e4fbccf authored by dominik.rimpf's avatar dominik.rimpf 🐿
Browse files

ADD: basic ap-list middleware

parent 7aa1af41
MIT License
Copyright (c) 2021 scc-net
Copyright (c) 2021 KIT | Steinbuch Centre for Computing - Abteilung Netze
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
from flask import Blueprint
import requests
from net_suite import app, ModMetaData
# we are assuming, that at the time of loading the app is initializes and the config is loaded
bb_name = 'apliste'
apliste = Blueprint(bb_name, __name__)
version = requests.get(app.config.get('APLISTE_SERVER_URL') + '/version',
cert=(app.config.get('APLISTE_CERT'), app.config.get('APLISTE_KEY'))).json()
METADATA = ModMetaData(name=bb_name, mod_path=__name__, gitlab_url='https://git.scc.kit.edu/scc-net-wlan/ap-liste',
printable_name='AP-Liste', version=version,
contact_email='wlan@scc.kit.edu')
from . import views
import requests
from net_suite import app
from flask import jsonify
from . import apliste
@apliste.route("/json", methods=["GET"])
def get_data():
data = requests.get(app.config.get('APLISTE_SERVER_URL') + '/json',
cert=(app.config.get('APLISTE_CERT'), app.config.get('APLISTE_KEY'))).json()
return jsonify(data)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment