mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat(snapshot): backend restore api
This commit is contained in:
@@ -52,6 +52,8 @@ import type {
|
||||
ListSnapshotsResponses,
|
||||
ListSnapshotFilesData,
|
||||
ListSnapshotFilesResponses,
|
||||
RestoreSnapshotData,
|
||||
RestoreSnapshotResponses,
|
||||
ListBackupSchedulesData,
|
||||
ListBackupSchedulesResponses,
|
||||
CreateBackupScheduleData,
|
||||
@@ -362,6 +364,22 @@ export const listSnapshotFiles = <ThrowOnError extends boolean = false>(
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Restore a snapshot to a target path on the filesystem
|
||||
*/
|
||||
export const restoreSnapshot = <ThrowOnError extends boolean = false>(
|
||||
options: Options<RestoreSnapshotData, ThrowOnError>,
|
||||
) => {
|
||||
return (options.client ?? _heyApiClient).post<RestoreSnapshotResponses, unknown, ThrowOnError>({
|
||||
url: "/api/v1/repositories/{name}/restore",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options.headers,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* List all backup schedules
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user