How to use the asu.app 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/upgrade-check", methods=["POST"])
@app.route("/api/upgrade-check/", methods=["GET"])
def api_upgrade_check(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 uc.process_request(request_json)
github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
@app.route("/api/image/")
def api_image(image_hash):
    return mime_json(database.get_image_info(image_hash))
github aparcar / attendedsysupgrade-server / asu / views.py View on Github external
@app.cli.command()
def resetdb():
    """Reset database"""
    database.reset_db()