async def update(server: Server): new_server = NewServer() updresult = new_server.updateServer(dict(server)) return updresult # RUN FastAPI => uvicorn <filename>:<obj name> --reload
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
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
def get_server_by_id(server_id): new_server = NewServer() server = new_server.getServersById(server_id) return jsonify(server)
def get(): new_server = NewServer() all_server = new_server.getServers() return jsonify(all_server)
def delete(server_id): new_server = NewServer() delresult = new_server.delServersById(server_id) return delresult
def add(): server = request.get_json() new_server = NewServer() new_server.create_server(server) return {"message": "OK", "server name": server["server_name"]}
async def add(server: Server): new_server = NewServer() new_server.create_server(dict(server)) return {"message": "OK", "server name": server.server_name}
async def get_server_by_id(server_id: str): new_server = NewServer() server = new_server.getServersById(server_id) return server
async def get(): new_server = NewServer() all_server = new_server.getServers() return all_server