-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtenant_backup_restore.py
40 lines (29 loc) · 1.02 KB
/
tenant_backup_restore.py
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
33
34
35
36
37
38
39
40
# Copyright 2023 Cisco Systems, Inc. and its affiliates
# mypy: disable-error-code="empty-body"
from typing import List
from pydantic import BaseModel
from catalystwan.endpoints import APIEndpoints, get, view
from catalystwan.utils.session_type import ProviderAsTenantView, TenantView
class BackupFiles(BaseModel):
backup_files: List[str]
class TenantBackupRestore(APIEndpoints):
@view({ProviderAsTenantView})
def delete_tenant_backup(self):
# DELETE /tenantbackup/delete
...
@view({ProviderAsTenantView, TenantView})
def download_existing_backup_file(self):
# GET /tenantbackup/download/{path}
...
@view({ProviderAsTenantView, TenantView})
def export_tenant_backup(self):
# GET /tenantbackup/export
...
@view({ProviderAsTenantView})
def import_tenant_backup(self):
# POST /tenantbackup/import
...
@view({ProviderAsTenantView, TenantView})
@get("/tenantbackup/list")
def list_tenant_backup(self) -> BackupFiles:
...