Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions appwrite_console/models/backup_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class BackupArchive(AppwriteModel):
Archive update date in ISO 8601 format.
policyid : str
Archive policy ID.
size : float
size : Optional[float]
Archive size in bytes.
status : str
The status of the archive creation. Possible values: pending, processing, uploading, completed, failed, skipped.
startedat : str
startedat : Optional[str]
The backup start time.
migrationid : str
Migration ID.
Expand All @@ -40,9 +40,9 @@ class BackupArchive(AppwriteModel):
createdat: str = Field(..., alias='$createdAt')
updatedat: str = Field(..., alias='$updatedAt')
policyid: str = Field(..., alias='policyId')
Comment thread
greptile-apps[bot] marked this conversation as resolved.
size: float = Field(..., alias='size')
size: Optional[float] = Field(default=None, alias='size')
status: str = Field(..., alias='status')
startedat: str = Field(..., alias='startedAt')
startedat: Optional[str] = Field(default=None, alias='startedAt')
migrationid: str = Field(..., alias='migrationId')
services: List[Any] = Field(..., alias='services')
resources: List[Any] = Field(..., alias='resources')
Expand Down
10 changes: 5 additions & 5 deletions appwrite_console/models/backup_restoration.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ class BackupRestoration(AppwriteModel):
Backup policy ID.
status : str
The status of the restoration. Possible values: pending, downloading, processing, completed, failed.
startedat : str
startedat : Optional[str]
The backup start time.
migrationid : str
Migration ID.
services : List[Any]
The services that are backed up by this policy.
resources : List[Any]
The resources that are backed up by this policy.
options : str
Optional data in key-value object.
options : Dict[str, Any]
Resource mappings used by the restoration.
"""

id: str = Field(..., alias='$id')
Expand All @@ -40,8 +40,8 @@ class BackupRestoration(AppwriteModel):
archiveid: str = Field(..., alias='archiveId')
policyid: str = Field(..., alias='policyId')
status: str = Field(..., alias='status')
startedat: str = Field(..., alias='startedAt')
startedat: Optional[str] = Field(default=None, alias='startedAt')
migrationid: str = Field(..., alias='migrationId')
services: List[Any] = Field(..., alias='services')
resources: List[Any] = Field(..., alias='resources')
options: str = Field(..., alias='options')
options: Dict[str, Any] = Field(..., alias='options')
51 changes: 39 additions & 12 deletions test/services/test_backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def test_create_archive(self, m):
"$id": "5e5ea5c16897e",
"$createdAt": "2020-10-15T06:38:00.000+00:00",
"$updatedAt": "2020-10-15T06:38:00.000+00:00",
"policyId": "did8jx6ws45jana098ab7",
"size": 100000.0,
"status": "completed",
"startedAt": "2020-10-15T06:38:00.000+00:00",
"policyId": "",
"size": None,
"status": "pending",
"startedAt": None,
"migrationId": "did8jx6ws45jana098ab7",
"services": [],
"resources": [],
Expand All @@ -62,7 +62,7 @@ def test_get_archive(self, m):
"$id": "5e5ea5c16897e",
"$createdAt": "2020-10-15T06:38:00.000+00:00",
"$updatedAt": "2020-10-15T06:38:00.000+00:00",
"policyId": "did8jx6ws45jana098ab7",
"policyId": "",
"size": 100000.0,
"status": "completed",
"startedAt": "2020-10-15T06:38:00.000+00:00",
Expand Down Expand Up @@ -216,13 +216,13 @@ def test_create_restoration(self, m):
"$createdAt": "2020-10-15T06:38:00.000+00:00",
"$updatedAt": "2020-10-15T06:38:00.000+00:00",
"archiveId": "did8jx6ws45jana098ab7",
"policyId": "did8jx6ws45jana098ab7",
"status": "completed",
"startedAt": "2020-10-15T06:38:00.000+00:00",
"policyId": "",
"status": "pending",
"startedAt": None,
"migrationId": "did8jx6ws45jana098ab7",
"services": [],
"resources": [],
"options": "{databases.database[{oldId, newId, newName}]}",
"options": {"tablesdb": {"database": [{"oldId": "source", "newId": "restored"}]}},
}
headers = {'Content-Type': 'application/json'}
m.request(
Expand All @@ -240,8 +240,35 @@ def test_create_restoration(self, m):
@requests_mock.Mocker()
def test_list_restorations(self, m):
data = {
"total": 5.0,
"restorations": [],
"total": 2,
"restorations": [
{
"$id": "pending-restoration",
"$createdAt": "2026-09-10T08:00:00.000+00:00",
"$updatedAt": "2026-09-10T08:00:00.000+00:00",
"archiveId": "archive",
"policyId": "",
"status": "pending",
"startedAt": None,
"migrationId": "migration-pending",
"services": ["databases"],
"resources": ["database"],
"options": {},
},
{
"$id": "completed-restoration",
"$createdAt": "2026-09-10T08:00:00.000+00:00",
"$updatedAt": "2026-09-10T09:00:00.000+00:00",
"archiveId": "archive",
"policyId": "",
"status": "completed",
"startedAt": "2026-09-10T08:30:00.000+00:00",
"migrationId": "migration-completed",
"services": ["databases"],
"resources": ["database"],
"options": {"tablesdb": {"database": [{"oldId": "source", "newId": "restored"}]}},
},
],
}
headers = {'Content-Type': 'application/json'}
m.request(
Expand All @@ -266,7 +293,7 @@ def test_get_restoration(self, m):
"migrationId": "did8jx6ws45jana098ab7",
"services": [],
"resources": [],
"options": "{databases.database[{oldId, newId, newName}]}",
"options": {"tablesdb": {"database": [{"oldId": "source", "newId": "restored"}]}},
}
headers = {'Content-Type': 'application/json'}
m.request(
Expand Down