forked from agent0ai/agent-zero
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup_get_defaults.py
More file actions
32 lines (26 loc) · 973 Bytes
/
backup_get_defaults.py
File metadata and controls
32 lines (26 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from python.helpers.api import ApiHandler, Request, Response
from python.helpers.backup import BackupService
class BackupGetDefaults(ApiHandler):
@classmethod
def requires_auth(cls) -> bool:
return True
@classmethod
def requires_loopback(cls) -> bool:
return False
async def process(self, input: dict, request: Request) -> dict | Response:
try:
backup_service = BackupService()
default_metadata = backup_service.get_default_backup_metadata()
return {
"success": True,
"default_patterns": {
"include_patterns": default_metadata["include_patterns"],
"exclude_patterns": default_metadata["exclude_patterns"]
},
"metadata": default_metadata
}
except Exception as e:
return {
"success": False,
"error": str(e)
}