Beispiel #1
0
def get_flag_list():
    """
    Get the list of platforms
    """
    data = current_app.system.get_flags()
    payload = Helper.get_list("flags.html", request, data)
    return payload, status.OK
Beispiel #2
0
def create(platform_id, manufacturer, model, serial_number):
    return Helper.create(request, current_app.system.create_sensor, {
        "platform_id": platform_id,
        "manufacturer": manufacturer,
        "model": model,
        "serial_number": serial_number
    })
Beispiel #3
0
def get_platform_list():
    """
    Get the list of platforms
    """
    current_app.logger.debug("get_platform_list()")
    data = current_app.system.get_platforms()
    payload = Helper.get_list("platforms.html", request, data)
    return payload, status.OK
Beispiel #4
0
def create(platform_id, manufacturer, model, serial_number, phenomena):
    return Helper.create(request, current_app.system.create_parameter, {
        "platform_id": platform_id,
        "manufacturer": manufacturer,
        "model": model,
        "serial_number": serial_number,
        "phenomena": phenomena
    })
Beispiel #5
0
def get_platform(platform_id):
    """
    Get a specific platform
    """
    current_app.logger.debug("get(%s)" % platform_id)
    data = current_app.system.get_platform(platform_id)
    if Helper.want_json(request):
        payload = flask.jsonify(data)
    else:
        payload = render_template("platform.html", platform_id=platform_id, data=data)
    current_app.logger.debug("payload: " + str(payload))
    return payload, status.OK
Beispiel #6
0
def create(term):
    return Helper.create(request, current_app.system.create_flag,
                         {"term": term})
Beispiel #7
0
def put_info(platform_id):
    data = current_app.system.get_platform(platform_id)
    update_function = current_app.system.update_platform
    return Helper.put_info(data, request, update_function)
Beispiel #8
0
def get_info(platform_id):
    data = current_app.system.get_platform(platform_id)
    return Helper.info_redirect(data)
Beispiel #9
0
def create(platform_id):
    return Helper.create(request, current_app.system.create_platform, {"platform_id": platform_id})
Beispiel #10
0
def get_list_platform_manufacturer_model(platform_id, manufacturer, model):
    data = current_app.system.get_sensors(platform_id, manufacturer, model)
    payload = Helper.get_list("sensors.html", request, data)
    return payload, status.OK
Beispiel #11
0
def get_list_platform(platform_id):
    data = current_app.system.get_sensors(platform_id)
    payload = Helper.get_list("sensors.html", request, data)
    return payload, status.OK
Beispiel #12
0
def put_info(platform_id, manufacturer, model, serial_number):
    data = current_app.system.get_sensor(platform_id, manufacturer, model, serial_number)
    update_function = current_app.system.update_sensor
    return Helper.put_info(data, request, update_function)
Beispiel #13
0
def get_info(platform_id, manufacturer, model, serial_number):
    data = current_app.system.get_sensor(platform_id, manufacturer, model, serial_number)
    return Helper.info_redirect(data)
Beispiel #14
0
def get_list_platform_manufacturer_model_serial_number(platform_id, manufacturer, model, serial_number):
    data = current_app.system.get_parameters(platform_id, manufacturer, model, serial_number)
    payload = Helper.get_list("parameters.html", request, data)
    return payload, status.OK
Beispiel #15
0
def get_list():
    data = current_app.system.get_parameters()
    payload = Helper.get_list("parameters.html", request, data)
    return payload, status.OK
Beispiel #16
0
def create(term):
    return Helper.create(request, current_app.system.create_phenomena,
                         {"term": term})