Initial curated Unraid-AppOps-Gateway source from 3bd6f6fee310125bfbb4d4650389a817f498724d
This commit is contained in:
commit
1dfbca08a1
528 files changed
+131054
No files matched your search
@@ -0,0 +1,30 @@
|
||||
from __future__ import annotations
|
||||
|
||||
NO_ROLLBACK_ACTIONS = {
|
||||
'container.clear_logs',
|
||||
'container.stop',
|
||||
'gateway.clear_cache',
|
||||
'unraid.mover.start',
|
||||
'volume.delete',
|
||||
}
|
||||
|
||||
|
||||
def build_preflight(action: str, target: str, policy_decision: str, risk: str):
|
||||
dependencies = ['connector']
|
||||
if action.startswith('container.'):
|
||||
dependencies.append('container runtime')
|
||||
if action.startswith('sonarr.') or action.startswith('radarr.'):
|
||||
dependencies.append('media indexer api')
|
||||
|
||||
return {
|
||||
'action': action,
|
||||
'target': target,
|
||||
'risk': risk,
|
||||
'policyDecision': policy_decision,
|
||||
'affectedApps': [target],
|
||||
'dependencies': dependencies,
|
||||
'preChecks': ['policy evaluate', 'connector config', 'maintenance status'],
|
||||
'postChecks': ['connector state', 'service availability', 'policy audit'],
|
||||
'rollbackAvailable': action not in NO_ROLLBACK_ACTIONS,
|
||||
'auditPreview': f'Action {action} on {target} is prepared for execution review.',
|
||||
}
|
||||
Reference in new issue
Block a user