Ejemplo n.º 1
0
def _route_servers_id_action(dummy_tenant_id, server_id):
    """
    Route:  /v1.1/<dummy_tenant_id>/servers/<server_id>/action
    Method: POST
    """
    utils.show_request(bottle.request)

    body = json.load(bottle.request.body)

    # nova console-log
    if 'os-getConsoleOutput' in body:
        return api_response.servers_console_log(SERVERS.console_log(server_id))

    # nova start
    elif 'os-start' in body:
        SERVERS.start(server_id)
        return

    # nova stop
    elif 'os-stop' in body:
        SERVERS.stop(server_id)
        return

    # nova reboot
    elif 'reboot' in body:
        hard = body['reboot']['type'].lower() == 'hard'
        SERVERS.reboot(server_id, hard)
        return

    raise exception.BadRequest(reason='Unsupported request')
Ejemplo n.º 2
0
def _route_images_id(image_id):
    """
    Route:  /v1/images/<image_id>
    Method: GET, HEAD, DELETE, PUT
    """
    utils.show_request(bottle.request)

    # glance image-list
    if image_id == 'detail' and bottle.request.method == 'GET':
        return {'images': IMAGES.list()}

    # glance image-show <image_id>
    if image_id != 'detail' and bottle.request.method == 'HEAD':
        image = IMAGES.show(image_id)
        _add_header(image)
        return

    # glance image-delete <image_id>
    if image_id != 'detail' and bottle.request.method == 'DELETE':
        IMAGES.delete(image_id)
        return

    # glance image-update <image_id>
    if image_id != 'detail' and bottle.request.method == 'PUT':
        image_md = _from_headers(bottle.request.headers)
        return {'image': IMAGES.update(image_id, image_md)}

    bottle.abort(400, 'Unable to handle request')
Ejemplo n.º 3
0
def _route_images_id(image_id):
    """
    Route:  /v1/images/<image_id>
    Method: GET, HEAD, DELETE, PUT
    """
    utils.show_request(bottle.request)

    # glance image-list
    if image_id == 'detail' and bottle.request.method == 'GET':
        return api_response.images_list(IMAGES.list())

    # glance image-show <image_id>
    if image_id != 'detail' and bottle.request.method == 'HEAD':
        image = IMAGES.show(image_id)
        _add_header(image)
        return

    # glance image-delete <image_id>
    if image_id != 'detail' and bottle.request.method == 'DELETE':
        IMAGES.delete(image_id)
        return

    # glance image-update <image_id>
    if image_id != 'detail' and bottle.request.method == 'PUT':
        image_md = _from_headers(bottle.request.headers)
        return api_response.images_update(IMAGES.update(image_id, image_md))

    raise exception.BadRequest(reason='Unsupported request')
Ejemplo n.º 4
0
Archivo: api.py Proyecto: tpot/dwarf
def _route_images_id(image_id):
    """
    Route:  /v1/images/<image_id>
    Method: GET, HEAD, DELETE, PUT
    """
    utils.show_request(bottle.request)

    # glance image-list
    if image_id == 'detail' and bottle.request.method == 'GET':
        return {'images': IMAGES.list()}

    # glance image-show <image_id>
    if image_id != 'detail' and bottle.request.method == 'HEAD':
        image = IMAGES.show(image_id)
        _add_header(image)
        return

    # glance image-delete <image_id>
    if image_id != 'detail' and bottle.request.method == 'DELETE':
        IMAGES.delete(image_id)
        return

    # glance image-update <image_id>
    if image_id != 'detail' and bottle.request.method == 'PUT':
        image_md = _from_headers(bottle.request.headers)
        return {'image': IMAGES.update(image_id, image_md)}

    bottle.abort(400, 'Unable to handle request')
Ejemplo n.º 5
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_servers_id_action(server_id):
    """
    Route:  /compute/v2.0/servers/<server_id>/action
    Method: POST
    """
    utils.show_request(bottle.request)

    body = json.load(bottle.request.body)

    # nova console-log
    if 'os-getConsoleOutput' in body:
        return api_response.show_console_log(SERVERS.console_log(server_id))

    # nova start
    elif 'os-start' in body:
        SERVERS.start(server_id)
        return

    # nova stop
    elif 'os-stop' in body:
        SERVERS.stop(server_id)
        return

    # nova reboot
    elif 'reboot' in body:
        hard = body['reboot']['type'].lower() == 'hard'
        SERVERS.reboot(server_id, hard)
        return

    raise exception.BadRequest(reason='Unsupported request')
Ejemplo n.º 6
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_version():
    """
    Route:  /identity/v2.0
    Method: GET
    """
    utils.show_request(bottle.request)

    return api_response.show_version_v2d0()
Ejemplo n.º 7
0
def _route_schemas_image():
    """
    Route:  /image/v2/schemas/image
    Method: GET
    """
    utils.show_request(bottle.request)

    return api_response.show_image_schema()
Ejemplo n.º 8
0
def _route_schemas_metadefs(_metadef):
    """
    Route:  /image/v2/schemas/metadefs/<_metadef>
    Method: GET
    """
    utils.show_request(bottle.request)

    return api_response.list_metadefs()
Ejemplo n.º 9
0
def _route_version():
    """
    Routes: /v1.1
    Method: GET
    """
    utils.show_request(bottle.request)

    return {"version": API_VERSIONS[0]}
Ejemplo n.º 10
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_schemas_image():
    """
    Route:  /image/v2/schemas/image
    Method: GET
    """
    utils.show_request(bottle.request)

    return api_response.show_image_schema()
Ejemplo n.º 11
0
def _route_version():
    """
    Route:  /v2.0
    Method: GET
    """
    utils.show_request(bottle.request)

    return VERSION_RESPONSE
Ejemplo n.º 12
0
Archivo: api.py Proyecto: tpot/dwarf
def _route_os_keypairs_name(dummy_tenant_id, keypair_name):
    """
    Route:  /v1.1/<dummy_tenant_id>/os-keypairs/<keypair_name>
    Method: DELETE
    """
    utils.show_request(bottle.request)

    KEYPAIRS.delete(keypair_name)
Ejemplo n.º 13
0
def _route_version():
    """
    Route:  /v2.0
    Method: GET
    """
    utils.show_request(bottle.request)

    return {"version": VERSION_V2_0}
Ejemplo n.º 14
0
Archivo: api.py Proyecto: tpot/dwarf
def _route_images(dummy_tenant_id):
    """
    Route:  /v1.1/<dummy_tenant_id>/images
    Method: GET
    """
    utils.show_request(bottle.request)

    return {'images': IMAGES.list(detail=False)}
Ejemplo n.º 15
0
def _route_images(dummy_tenant_id):
    """
    Route:  /v1.1/<dummy_tenant_id>/images
    Method: GET
    """
    utils.show_request(bottle.request)

    return api_response.images_list(IMAGES.list(), details=False)
Ejemplo n.º 16
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_version():
    """
    Routes: /compute/v2.0
    Method: GET
    """
    utils.show_request(bottle.request)

    return api_response.show_version_v2d0()
Ejemplo n.º 17
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_schemas_metadefs(_metadef):
    """
    Route:  /image/v2/schemas/metadefs/<_metadef>
    Method: GET
    """
    utils.show_request(bottle.request)

    return api_response.list_metadefs()
Ejemplo n.º 18
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_versions():
    """
    Routes: /compute
    Method: GET
    """
    utils.show_request(bottle.request)

    bottle.response.status = 300
    return api_response.list_versions()
Ejemplo n.º 19
0
def _route_versions():
    """
    Route:  /image, /image/versions
    Method: GET
    """
    utils.show_request(bottle.request)

    bottle.response.status = 300
    return api_response.list_versions()
Ejemplo n.º 20
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_versions():
    """
    Routes: /compute
    Method: GET
    """
    utils.show_request(bottle.request)

    bottle.response.status = 300
    return api_response.list_versions()
Ejemplo n.º 21
0
def _route_versions():
    """
    Route:  /
    Method: GET
    """
    utils.show_request(bottle.request)

    bottle.response.status = 300
    return {"versions": VERSIONS}
Ejemplo n.º 22
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_versions():
    """
    Route:  /image, /image/versions
    Method: GET
    """
    utils.show_request(bottle.request)

    bottle.response.status = 300
    return api_response.list_versions()
Ejemplo n.º 23
0
def _route_tokens():
    """
    Route:  /identity/v2.0/tokens
    Method: POST
    """
    utils.show_request(bottle.request)

    body = json.load(bottle.request.body)
    if 'auth' in body:
        return api_response.authenticate()
Ejemplo n.º 24
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_tokens():
    """
    Route:  /identity/v2.0/tokens
    Method: POST
    """
    utils.show_request(bottle.request)

    body = json.load(bottle.request.body)
    if 'auth' in body:
        return api_response.authenticate()
Ejemplo n.º 25
0
Archivo: api.py Proyecto: tpot/dwarf
def _route_tokens():
    """
    Route:  /v2.0/tokens
    Method: POST
    """
    utils.show_request(bottle.request)

    body = json.load(bottle.request.body)
    if 'auth' in body:
        return TOKENS_RESPONSE
Ejemplo n.º 26
0
def _route_tokens():
    """
    Route:  /v2.0/tokens
    Method: POST
    """
    utils.show_request(bottle.request)

    body = json.load(bottle.request.body)
    if 'auth' in body:
        return {"access": ACCESS}
Ejemplo n.º 27
0
def _route_tokens():
    """
    Route:  /v2.0/tokens
    Method: POST
    """
    utils.show_request(bottle.request)

    body = json.load(bottle.request.body)
    if 'auth' in body:
        return TOKENS_RESPONSE
Ejemplo n.º 28
0
def _route_images_id_file(image_id):
    """
    Route:  /image/v2/images/<image_id>/file
    Method: PUT
    """
    utils.show_request(bottle.request)

    # glance image-upload
    bottle.response.status = 204
    image_fh = bottle.request.body
    IMAGES.upload(image_id, image_fh)
    return
Ejemplo n.º 29
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_images_id_file(image_id):
    """
    Route:  /image/v2/images/<image_id>/file
    Method: PUT
    """
    utils.show_request(bottle.request)

    # glance image-upload
    bottle.response.status = 204
    image_fh = bottle.request.body
    IMAGES.upload(image_id, image_fh)
    return
Ejemplo n.º 30
0
Archivo: api.py Proyecto: tpot/dwarf
def _route_images_id(dummy_tenant_id, image_id):
    """
    Route:  /v1.1/<dummy_tenant_id>/images/<image_id>
    Method: GET
    """
    utils.show_request(bottle.request)

    # nova image-list
    if image_id == 'detail':
        return {'images': IMAGES.list()}

    # nova image-show <image_id>
    return {'image': IMAGES.show(image_id)}
Ejemplo n.º 31
0
def _route_images_id(dummy_tenant_id, image_id):
    """
    Route:  /v1.1/<dummy_tenant_id>/images/<image_id>
    Method: GET
    """
    utils.show_request(bottle.request)

    # nova image-list
    if image_id == 'detail':
        return api_response.images_list(IMAGES.list())

    # nova image-show <image_id>
    return api_response.images_show(IMAGES.show(image_id))
Ejemplo n.º 32
0
def _route_images():
    """
    Route:  /v1/images
    Method: POST
    """
    utils.show_request(bottle.request)

    # Parse the HTTP header
    image_md = _from_headers(bottle.request.headers)

    # glance image-create
    image_fh = _request_body(bottle.request)
    return api_response.images_create(IMAGES.create(image_fh, image_md))
Ejemplo n.º 33
0
Archivo: api.py Proyecto: tpot/dwarf
def _route_images():
    """
    Route:  /v1/images
    Method: GET
    """
    utils.show_request(bottle.request)

    # Parse the HTTP header
    image_md = _from_headers(bottle.request.headers)

    # glance image-create
    image_fh = _request_body(bottle.request)
    return {'image': IMAGES.create(image_fh, image_md)}
Ejemplo n.º 34
0
def _route_servers(dummy_tenant_id):
    """
    Route:  /v1.1/<dummy_tenant_id>/servers
    Method: GET, POST
    """
    utils.show_request(bottle.request)

    # nova boot
    if bottle.request.method == 'POST':
        body = json.load(bottle.request.body)
        return api_response.servers_boot(SERVERS.boot(body['server']))

    # nova list (no details)
    return api_response.servers_list(SERVERS.list(), details=False)
Ejemplo n.º 35
0
def _route_os_keypairs_name(dummy_tenant_id, keypair_name):
    """
    Route:  /v1.1/<dummy_tenant_id>/os-keypairs/<keypair_name>
    Method: DELETE, GET
    """
    utils.show_request(bottle.request)

    # nova keypair-delete
    if bottle.request.method == 'DELETE':
        KEYPAIRS.delete(keypair_name)
        return

    # nova keypair-show
    return api_response.keypairs_show(KEYPAIRS.show(keypair_name))
Ejemplo n.º 36
0
def _route_os_keypairs(dummy_tenant_id):
    """
    Route:  /v1.1/<dummy_tenant_id>/os-keypairs
    Method: GET, POST
    """
    utils.show_request(bottle.request)

    # nova keypair-add
    if bottle.request.method == 'POST':
        body = json.load(bottle.request.body)
        return api_response.keypairs_add(KEYPAIRS.add(body['keypair']))

    # nova keypair-list
    return api_response.keypairs_list(KEYPAIRS.list())
Ejemplo n.º 37
0
Archivo: api.py Proyecto: tpot/dwarf
def _route_os_keypairs(dummy_tenant_id):
    """
    Route:  /v1.1/<dummy_tenant_id>/os-keypairs
    Method: GET, POST
    """
    utils.show_request(bottle.request)

    # nova keypair-add
    if bottle.request.method == 'POST':
        body = json.load(bottle.request.body)
        return {'keypair': KEYPAIRS.add(body['keypair'])}

    # nova keypair-list
    return {'keypairs': KEYPAIRS.list()}
Ejemplo n.º 38
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_os_keypairs():
    """
    Route:  /compute/v2.0/os-keypairs
    Method: GET, POST
    """
    utils.show_request(bottle.request)

    # nova keypair-add
    if bottle.request.method == 'POST':
        body = json.load(bottle.request.body)
        return api_response.create_keypair(KEYPAIRS.create(body['keypair']))

    # nova keypair-list
    return api_response.list_keypairs(KEYPAIRS.list())
Ejemplo n.º 39
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_os_keypairs_name(keypair_name):
    """
    Route:  /compute/v2.0/os-keypairs/<keypair_name>
    Method: DELETE, GET
    """
    utils.show_request(bottle.request)

    # nova keypair-delete
    if bottle.request.method == 'DELETE':
        KEYPAIRS.delete(keypair_name)
        return

    # nova keypair-show
    return api_response.show_keypair(KEYPAIRS.show(keypair_name))
Ejemplo n.º 40
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_servers():
    """
    Route:  /compute/v2.0/servers
    Method: GET, POST
    """
    utils.show_request(bottle.request)

    # nova boot
    if bottle.request.method == 'POST':
        body = json.load(bottle.request.body)
        return api_response.create_server(SERVERS.create(body['server']))

    # nova list (no details)
    return api_response.list_servers(SERVERS.list(), details=False)
Ejemplo n.º 41
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_flavors():
    """
    Route:  /compute/v2.0/flavors
    Method: GET, POST
    """
    utils.show_request(bottle.request)

    # nova flavor-create
    if bottle.request.method == 'POST':
        body = json.load(bottle.request.body)
        return api_response.create_flavor(FLAVORS.create(body['flavor']))

    # nova flavor-list (no details)
    return api_response.list_flavors(FLAVORS.list(), details=False)
Ejemplo n.º 42
0
Archivo: api.py Proyecto: tpot/dwarf
def _route_flavors(dummy_tenant_id):
    """
    Route:  /v1.1/<dummy_tenant_id>/flavors
    Method: GET, POST
    """
    utils.show_request(bottle.request)

    # nova flavor-create
    if bottle.request.method == 'POST':
        body = json.load(bottle.request.body)
        return {'flavor': FLAVORS.create(body['flavor'])}

    # nova flavor-list (no details)
    return {'flavors': FLAVORS.list(detail=False)}
Ejemplo n.º 43
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_os_keypairs():
    """
    Route:  /compute/v2.0/os-keypairs
    Method: GET, POST
    """
    utils.show_request(bottle.request)

    # nova keypair-add
    if bottle.request.method == 'POST':
        body = json.load(bottle.request.body)
        return api_response.create_keypair(KEYPAIRS.create(body['keypair']))

    # nova keypair-list
    return api_response.list_keypairs(KEYPAIRS.list())
Ejemplo n.º 44
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_os_keypairs_name(keypair_name):
    """
    Route:  /compute/v2.0/os-keypairs/<keypair_name>
    Method: DELETE, GET
    """
    utils.show_request(bottle.request)

    # nova keypair-delete
    if bottle.request.method == 'DELETE':
        KEYPAIRS.delete(keypair_name)
        return

    # nova keypair-show
    return api_response.show_keypair(KEYPAIRS.show(keypair_name))
Ejemplo n.º 45
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_flavors():
    """
    Route:  /compute/v2.0/flavors
    Method: GET, POST
    """
    utils.show_request(bottle.request)

    # nova flavor-create
    if bottle.request.method == 'POST':
        body = json.load(bottle.request.body)
        return api_response.create_flavor(FLAVORS.create(body['flavor']))

    # nova flavor-list (no details)
    return api_response.list_flavors(FLAVORS.list(), details=False)
Ejemplo n.º 46
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_servers():
    """
    Route:  /compute/v2.0/servers
    Method: GET, POST
    """
    utils.show_request(bottle.request)

    # nova boot
    if bottle.request.method == 'POST':
        body = json.load(bottle.request.body)
        return api_response.create_server(SERVERS.create(body['server']))

    # nova list (no details)
    return api_response.list_servers(SERVERS.list(), details=False)
Ejemplo n.º 47
0
Archivo: api.py Proyecto: tpot/dwarf
def _route_servers(dummy_tenant_id):
    """
    Route:  /v1.1/<dummy_tenant_id>/servers
    Method: GET, POST
    """
    utils.show_request(bottle.request)

    # nova boot
    if bottle.request.method == 'POST':
        body = json.load(bottle.request.body)
        return {'server': SERVERS.boot(body['server'])}

    # nova list (no details)
    return {'servers': SERVERS.list(detail=False)}
Ejemplo n.º 48
0
def _route_flavors(dummy_tenant_id):
    """
    Route:  /v1.1/<dummy_tenant_id>/flavors
    Method: GET, POST
    """
    utils.show_request(bottle.request)

    # nova flavor-create
    if bottle.request.method == 'POST':
        body = json.load(bottle.request.body)
        return api_response.flavors_create(FLAVORS.create(body['flavor']))

    # nova flavor-list (no details)
    return api_response.flavors_list(FLAVORS.list(), details=False)
Ejemplo n.º 49
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_flavors_id(flavor_id):
    """
    Route:  /compute/v2.0/flavors/<flavor_id>
    Method: GET, DELETE
    """
    utils.show_request(bottle.request)

    # nova flavor-delete <flavor_id>
    if bottle.request.method == 'DELETE':
        FLAVORS.delete(flavor_id)
        return

    # nova flavor-list
    if flavor_id == 'detail':
        return api_response.list_flavors(FLAVORS.list(), details=True)

    # nova flavor-show <flavor_id>
    return api_response.show_flavor(FLAVORS.show(flavor_id))
Ejemplo n.º 50
0
Archivo: api.py Proyecto: dtroyer/dwarf
def _route_servers_id(server_id):
    """
    Route:  /compute/v2.0/servers/<server_id>
    Method: GET, DELETE
    """
    utils.show_request(bottle.request)

    # nova delete <server_id>
    if bottle.request.method == 'DELETE':
        SERVERS.delete(server_id)
        return

    # nova list
    if server_id == 'detail':
        return api_response.list_servers(SERVERS.list(), details=True)

    # nova show <server_id>
    return api_response.show_server(SERVERS.show(server_id))
Ejemplo n.º 51
0
Archivo: api.py Proyecto: tpot/dwarf
def _route_flavors_id(dummy_tenant_id, flavor_id):
    """
    Route:  /v1.1/<dummy_tenant_id>/flavors/<flavor_id>
    Method: GET, DELETE
    """
    utils.show_request(bottle.request)

    # nova flavor-delete <flavor_id>
    if bottle.request.method == 'DELETE':
        FLAVORS.delete(flavor_id)
        return

    # nova flavor-list
    if flavor_id == 'detail':
        return {'flavors': FLAVORS.list()}

    # nova flavor-show <flavor_id>
    return {'flavor': FLAVORS.show(flavor_id)}
Ejemplo n.º 52
0
Archivo: api.py Proyecto: tpot/dwarf
def _route_servers_id(dummy_tenant_id, server_id):
    """
    Route:  /v1.1/<dummy_tenant_id>/servers/<server_id>
    Method: GET, DELETE
    """
    utils.show_request(bottle.request)

    # nova delete <server_id>
    if bottle.request.method == 'DELETE':
        SERVERS.delete(server_id)
        return

    # nova list
    if server_id == 'detail':
        return {'servers': SERVERS.list()}

    # nova show <server_id>
    return {'server': SERVERS.show(server_id)}
Ejemplo n.º 53
0
def _route_flavors_id(dummy_tenant_id, flavor_id):
    """
    Route:  /v1.1/<dummy_tenant_id>/flavors/<flavor_id>
    Method: GET, DELETE
    """
    utils.show_request(bottle.request)

    # nova flavor-delete <flavor_id>
    if bottle.request.method == 'DELETE':
        FLAVORS.delete(flavor_id)
        return

    # nova flavor-list
    if flavor_id == 'detail':
        return api_response.flavors_list(FLAVORS.list())

    # nova flavor-show <flavor_id>
    return api_response.flavors_show(FLAVORS.show(flavor_id))
Ejemplo n.º 54
0
def _route_images_id(image_id):
    """
    Route:  /image/v2/images/<image_id>
    Method: GET, DELETE, PATCH
    """
    utils.show_request(bottle.request)

    # glance image-delete
    if bottle.request.method == 'DELETE':
        bottle.response.status = 204
        IMAGES.delete(image_id)
        return

    # glance image-update
    if bottle.request.method == 'PATCH':
        image_ops = json.load(bottle.request.body)
        return api_response.update_image(IMAGES.update(image_id, image_ops))

    # glance image-show
    return api_response.show_image(IMAGES.show(image_id))
Ejemplo n.º 55
0
def _route_images():
    """
    Route:  /image/v2/images
    Method: GET, POST
    """
    utils.show_request(bottle.request)

    # glance image-create
    if bottle.request.method == 'POST':
        bottle.response.status = 201
        image_md = json.load(bottle.request.body)
        return api_response.create_image(IMAGES.create(image_md))

    # glance image-list
    if (bottle.request.query.get('marker', None) is not None):
        # When the client wants more, tell it we're done
        return api_response.list_images([])
    else:
        # We don't 'do' marker, so return it all on the first call
        return api_response.list_images(IMAGES.list())
Ejemplo n.º 56
0
Archivo: api.py Proyecto: tpot/dwarf
def _route_servers_id_action(dummy_tenant_id, server_id):
    """
    Route:  /v1.1/<dummy_tenant_id>/servers/<server_id>/action
    Method: POST
    """
    utils.show_request(bottle.request)

    body = json.load(bottle.request.body)

    # nova console-log
    if 'os-getConsoleOutput' in body:
        return {'output': SERVERS.console_log(server_id)}

    # nova reboot
    elif 'reboot' in body:
        hard = body['reboot']['type'].lower() == 'hard'
        SERVERS.reboot(server_id, hard)
        return

    bottle.abort(400)