Initial commit - copied workspace after database cleanup
This commit is contained in:
21
server/routes/setup.py
Normal file
21
server/routes/setup.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from flask import Blueprint, jsonify
|
||||
from server.database import get_db
|
||||
from models.models import Client
|
||||
|
||||
bp = Blueprint('setup', __name__, url_prefix='/api/setup')
|
||||
|
||||
@bp.route('/clients_without_description', methods=['GET'])
|
||||
def clients_without_description():
|
||||
db = get_db()
|
||||
clients = db.query(Client).filter(Client.description == None).all()
|
||||
result = []
|
||||
for c in clients:
|
||||
result.append({
|
||||
'uuid': c.uuid,
|
||||
'hostname': c.hostname,
|
||||
'ip_address': c.ip_address,
|
||||
'last_alive': c.last_alive,
|
||||
'created_at': c.created_at,
|
||||
'group': c.group_id,
|
||||
})
|
||||
return jsonify(result)
|
||||
Reference in New Issue
Block a user