How to use the asu.app.route function in asu

To help you get started, we’ve selected a few asu examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
@app.route("/api/v1/stats/images_latest")
def api_stats_images_latest():
    return mime_json(database.get_images_latest())
github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
@app.route("/api/manifest/")
def api_manifest(manifest_hash):
    return mime_json(database.get_manifest_info(manifest_hash))
github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
@app.route("/api/v1/stats/popular_packages")
def api_stats_popular_packages():
    return mime_json(database.get_popular_packages())
github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
@app.route("/api/v1/stats/popular_targets")
def api_stats_popular_targets():
    return mime_json(database.get_popular_targets())
github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
@app.route("/api/v1/supported")
def api_supported():
    return mime_json(database.get_supported_targets_json())
github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
@app.route("/api/distributions")
def api_distributions():
    return mime_json(config.get_all())
github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
@app.route("/api/upgrade-request", methods=["POST"])
@app.route("/api/upgrade-request/", methods=["GET"])
def api_upgrade_request(request_hash=None):
    if request.method == "POST":
        try:
            request_json = json.loads(request.get_data().decode("utf-8"))
        except json.JSONDecodeError:
            return "[]", HTTPStatus.BAD_REQUEST
    else:
        if not request_hash:
            return "[]", HTTPStatus.BAD_REQUEST
        request_json = {"request_hash": request_hash}

    return br.process_request(request_json, sysupgrade_requested=1)
github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
@app.route("/api/versions")
def api_versions():
    return mime_json(database.api_get_versions())