Beispiel #1
0
async def update(server: Server):
    new_server = NewServer()
    updresult = new_server.updateServer(dict(server))
    return updresult


# RUN FastAPI => uvicorn <filename>:<obj name> --reload
Beispiel #2
0
def add():
    server = request.get_json()
    new_server = NewServer()
    new_server.create_server(server)

    return {"message": "OK", "server name": server["server_name"]}


# set server flask use

# set FLASK_APP = {filename.py}
# flask run => to run server
Beispiel #3
0
def update():
    server = request.get_json()
    new_server = NewServer()
    updresult = new_server.updateServer(server)
    return updresult


# set server flask use

# set FLASK_APP = {filename.py}
# set FLASK_ENV = development
# flask run => to run server
Beispiel #4
0
def get_server_by_id(server_id):
    new_server = NewServer()
    server = new_server.getServersById(server_id)
    return jsonify(server)
Beispiel #5
0
def get():
    new_server = NewServer()
    all_server = new_server.getServers()
    return jsonify(all_server)
Beispiel #6
0
def delete(server_id):
    new_server = NewServer()
    delresult = new_server.delServersById(server_id)
    return delresult
Beispiel #7
0
def add():
    server = request.get_json()
    new_server = NewServer()
    new_server.create_server(server)

    return {"message": "OK", "server name": server["server_name"]}
Beispiel #8
0
async def add(server: Server):
    new_server = NewServer()
    new_server.create_server(dict(server))
    return {"message": "OK", "server name": server.server_name}
Beispiel #9
0
async def get_server_by_id(server_id: str):
    new_server = NewServer()
    server = new_server.getServersById(server_id)
    return server
Beispiel #10
0
async def get():
    new_server = NewServer()
    all_server = new_server.getServers()
    return all_server