Remove old api
This commit is contained in:
parent
68255eb274
commit
c206d8c90a
45
app.py
45
app.py
@ -65,50 +65,7 @@ def save_status(status):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
@app.route('/status.json', methods=['GET'])
|
|
||||||
def get_status():
|
|
||||||
"""
|
|
||||||
GET /status.json - Retrieve current status
|
|
||||||
---
|
|
||||||
responses:
|
|
||||||
200:
|
|
||||||
description: Current GitOps status
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
repo:
|
|
||||||
type: string
|
|
||||||
example: "rsyslog"
|
|
||||||
server:
|
|
||||||
type: string
|
|
||||||
example: "rsyslog-lab"
|
|
||||||
sync_status:
|
|
||||||
type: string
|
|
||||||
enum: ["SYNCED", "OUT_OF_SYNC", "UNKNOWN"]
|
|
||||||
drift_count:
|
|
||||||
type: integer
|
|
||||||
example: 0
|
|
||||||
files:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
last_check:
|
|
||||||
type: string
|
|
||||||
format: date-time
|
|
||||||
example: "2026-04-23T10:30:00Z"
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
status = load_status()
|
|
||||||
if status:
|
|
||||||
return jsonify(status), 200
|
|
||||||
else:
|
|
||||||
return jsonify({"error": "Failed to load status"}), 500
|
|
||||||
except Exception as e:
|
|
||||||
logger.error(f"Error in GET /status.json: {e}")
|
|
||||||
return jsonify({"error": str(e)}), 500
|
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/status', methods=['GET', 'POST', 'OPTIONS'])
|
@app.route('/api/status', methods=['GET', 'POST', 'OPTIONS'])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user