Skip to content

Commit b918d50

Browse files
authored
Add all addons option to partial backups (#36)
1 parent 54b2374 commit b918d50

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

aiohasupervisor/models/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
SupervisorRole,
2626
)
2727
from aiohasupervisor.models.backups import (
28+
AddonSet,
2829
Backup,
2930
BackupAddon,
3031
BackupComplete,
@@ -203,6 +204,7 @@
203204
"GreenOptions",
204205
"YellowInfo",
205206
"YellowOptions",
207+
"AddonSet",
206208
"Backup",
207209
"BackupAddon",
208210
"BackupComplete",

aiohasupervisor/models/backups.py

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ class Folder(StrEnum):
2626
MEDIA = "media"
2727

2828

29+
class AddonSet(StrEnum):
30+
"""AddonSet type."""
31+
32+
ALL = "all"
33+
34+
2935
# --- OBJECTS ----
3036

3137

@@ -145,6 +151,8 @@ class FullBackupOptions(Request):
145151
class PartialBackupOptions(FullBackupOptions, PartialBackupRestoreOptions):
146152
"""PartialBackupOptions model."""
147153

154+
addons: set[str] | AddonSet | None = None
155+
148156

149157
@dataclass(frozen=True, slots=True)
150158
class BackupJob(ResponseData):

tests/test_backups.py

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from aiohasupervisor import SupervisorClient
1313
from aiohasupervisor.models import (
14+
AddonSet,
1415
BackupsOptions,
1516
DownloadBackupOptions,
1617
Folder,
@@ -253,6 +254,10 @@ async def test_backups_full_backup(
253254
PartialBackupOptions(name="Test", background=None, addons={"core_ssh"}),
254255
"9ecf0028",
255256
),
257+
(
258+
PartialBackupOptions(name="Test", background=None, addons=AddonSet.ALL),
259+
"9ecf0028",
260+
),
256261
],
257262
)
258263
async def test_backups_partial_backup(

0 commit comments

Comments
 (0)