Update json schema
Some checks failed
ci/woodpecker/tag/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
dvirlabs 2026-04-24 15:34:27 +03:00
parent c206d8c90a
commit 58e31bed84

34
app.py
View File

@ -40,7 +40,8 @@ def load_status():
"server": "unknown", "server": "unknown",
"sync_status": "UNKNOWN", "sync_status": "UNKNOWN",
"drift_count": 0, "drift_count": 0,
"files": [], "deployed_files": [],
"drifted_files": [],
"last_check": "" "last_check": ""
} }
except Exception as e: except Exception as e:
@ -89,8 +90,20 @@ def api_status():
type: string type: string
drift_count: drift_count:
type: integer type: integer
files: deployed_files:
type: array type: array
items:
type: object
properties:
name:
type: string
drifted_files:
type: array
items:
type: object
properties:
name:
type: string
last_check: last_check:
type: string type: string
post: post:
@ -113,10 +126,22 @@ def api_status():
enum: ["SYNCED", "OUT_OF_SYNC", "UNKNOWN", "PROGRESSING"] enum: ["SYNCED", "OUT_OF_SYNC", "UNKNOWN", "PROGRESSING"]
drift_count: drift_count:
type: integer type: integer
files: deployed_files:
type: array type: array
items: items:
type: object type: object
properties:
name:
type: string
example: [{"name": "rsyslog.conf"}]
drifted_files:
type: array
items:
type: object
properties:
name:
type: string
example: []
last_check: last_check:
type: string type: string
responses: responses:
@ -206,7 +231,8 @@ def ready():
"server": "unknown", "server": "unknown",
"sync_status": "UNKNOWN", "sync_status": "UNKNOWN",
"drift_count": 0, "drift_count": 0,
"files": [], "deployed_files": [],
"drifted_files": [],
"last_check": "" "last_check": ""
} }
save_status(default_status) save_status(default_status)