Exemplo n.º 1
0
def authenticate():
    if 'username' not in request.args:
        raise exception.ParameterMissing(name="username")
    if 'password' not in request.args:
        raise exception.ParameterMissing(name="password")

    token, expires = auth.get_token(request.args['username'],
                                    request.args['password'])
    response = make_response('', 201)
    response.set_cookie('X-Auth-Username', request.args['username'], expires=expires)
    response.set_cookie('X-Auth-Token', token, expires=expires)
    return response
Exemplo n.º 2
0
def get_power_state():
    if 'bladeId' not in request.args:
        raise exception.ParameterMissing(name="bladeId")
    return service.get_power_state(request.args['bladeId'])
Exemplo n.º 3
0
def set_blade_attention_led_off():
    if 'bladeId' not in request.args:
        raise exception.ParameterMissing(name="bladeId")
    return service.set_blade_attention_led_off(request.args['bladeId'])
Exemplo n.º 4
0
def set_blade_oil_pump_on():
    if 'bladeId' not in request.args:
        raise exception.ParameterMissing(name="bladeId")
    return service.set_blade_oil_pump_on(request.args['bladeId'])
Exemplo n.º 5
0
def start_blade_serial_session():
    if 'bladeId' not in request.args:
        raise exception.ParameterMissing(name="bladeId")
    return service.start_blade_serial_session(request.args['bladeId'])