mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat: backup schedule creation form
This commit is contained in:
@@ -16,14 +16,12 @@ export type RetentionPolicy = typeof retentionPolicySchema.infer;
|
||||
const backupScheduleSchema = type({
|
||||
id: "number",
|
||||
volumeId: "number",
|
||||
volumeName: "string",
|
||||
repositoryId: "string",
|
||||
repositoryName: "string",
|
||||
enabled: "boolean",
|
||||
cronExpression: "string",
|
||||
retentionPolicy: retentionPolicySchema.or("null"),
|
||||
excludePatterns: "string[]",
|
||||
includePatterns: "string[]",
|
||||
excludePatterns: "string[] | null",
|
||||
includePatterns: "string[] | null",
|
||||
lastBackupAt: "number | null",
|
||||
lastBackupStatus: "'success' | 'error' | null",
|
||||
lastBackupError: "string | null",
|
||||
@@ -66,7 +64,7 @@ export const getBackupScheduleResponse = type({
|
||||
schedule: backupScheduleSchema,
|
||||
});
|
||||
|
||||
export type GetBackupScheduleResponseDto = typeof getBackupScheduleResponse.infer;
|
||||
export type GetBackupScheduleDto = typeof getBackupScheduleResponse.infer;
|
||||
|
||||
export const getBackupScheduleDto = describeRoute({
|
||||
description: "Get a backup schedule by ID",
|
||||
@@ -84,6 +82,26 @@ export const getBackupScheduleDto = describeRoute({
|
||||
},
|
||||
});
|
||||
|
||||
export const getBackupScheduleForVolumeResponse = backupScheduleSchema.or("null");
|
||||
|
||||
export type GetBackupScheduleForVolumeResponseDto = typeof getBackupScheduleForVolumeResponse.infer;
|
||||
|
||||
export const getBackupScheduleForVolumeDto = describeRoute({
|
||||
description: "Get a backup schedule for a specific volume",
|
||||
tags: ["Backups"],
|
||||
operationId: "getBackupScheduleForVolume",
|
||||
responses: {
|
||||
200: {
|
||||
description: "Backup schedule details for the volume",
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: resolver(getBackupScheduleForVolumeResponse),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* Create a new backup schedule
|
||||
*/
|
||||
@@ -105,6 +123,8 @@ export const createBackupScheduleResponse = type({
|
||||
schedule: backupScheduleSchema,
|
||||
});
|
||||
|
||||
export type CreateBackupScheduleDto = typeof createBackupScheduleResponse.infer;
|
||||
|
||||
export const createBackupScheduleDto = describeRoute({
|
||||
description: "Create a new backup schedule for a volume",
|
||||
operationId: "createBackupSchedule",
|
||||
|
||||
Reference in New Issue
Block a user