diff --git a/api/openapi/wizard/wizard.yml b/api/openapi/wizard/wizard.yml index 2111fde..fa29cfc 100644 --- a/api/openapi/wizard/wizard.yml +++ b/api/openapi/wizard/wizard.yml @@ -179,4 +179,65 @@ components: disks: type: array items: - type: string \ No newline at end of file + type: string + RetentionKind: + type: string + enum: + - hourly + - daily + - weekly + - monthly + Weekday: + type: string + enum: + - monday + - tuesday + - wednesday + - thursday + - friday + - saturday + - sunday + Retention: + type: object + required: + - kind + - amount + properties: + kind: + $ref: "#/components/schemas/RetentionKind" + amount: + type: number + description: The amount of backups to keep + minimum: 0 + Schedule: + type: object + required: + - kind + - weekday + - time + properties: + kind: + $ref: "#/components/schemas/RetentionKind" + weekday: + $ref: "#/components/schemas/Weekday" + time: + type: string + format: time + Policy: + type: object + required: + - id + - retentions + - schedules + properties: + id: + type: string + format: uuid + retentions: + type: array + items: + $ref: "#/components/schemas/Retention" + schedules: + type: array + items: + $ref: "#/components/schemas/Schedule" \ No newline at end of file diff --git a/web/src/app/api/.openapi-generator/FILES b/web/src/app/api/.openapi-generator/FILES index 3bcf8bb..c04cba3 100644 --- a/web/src/app/api/.openapi-generator/FILES +++ b/web/src/app/api/.openapi-generator/FILES @@ -12,8 +12,13 @@ model/deviceKind.ts model/findDevices200Response.ts model/findSSHKeys200Response.ts model/models.ts +model/policy.ts model/protectionStatus.ts model/registerDevice200Response.ts model/registerDeviceRequest.ts +model/retention.ts +model/retentionKind.ts +model/schedule.ts +model/weekday.ts param.ts variables.ts diff --git a/web/src/app/api/model/models.ts b/web/src/app/api/model/models.ts index 3ebc1b2..69bdfaa 100644 --- a/web/src/app/api/model/models.ts +++ b/web/src/app/api/model/models.ts @@ -2,6 +2,11 @@ export * from './device'; export * from './deviceKind'; export * from './findDevices200Response'; export * from './findSSHKeys200Response'; +export * from './policy'; export * from './protectionStatus'; export * from './registerDevice200Response'; export * from './registerDeviceRequest'; +export * from './retention'; +export * from './retentionKind'; +export * from './schedule'; +export * from './weekday'; diff --git a/web/src/app/api/model/policy.ts b/web/src/app/api/model/policy.ts new file mode 100644 index 0000000..3e963a9 --- /dev/null +++ b/web/src/app/api/model/policy.ts @@ -0,0 +1,21 @@ +/** + * Backup Wizard API + * An API to communicate with the backup wizard daemon + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Schedule } from './schedule'; +import { Retention } from './retention'; + + +export interface Policy { + id: string; + retentions: Array; + schedules: Array; +} + diff --git a/web/src/app/api/model/retention.ts b/web/src/app/api/model/retention.ts new file mode 100644 index 0000000..337041b --- /dev/null +++ b/web/src/app/api/model/retention.ts @@ -0,0 +1,25 @@ +/** + * Backup Wizard API + * An API to communicate with the backup wizard daemon + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { RetentionKind } from './retentionKind'; + + +export interface Retention { + kind: RetentionKind; + /** + * The amount of backups to keep + */ + amount: number; +} +export namespace Retention { +} + + diff --git a/web/src/app/api/model/retentionKind.ts b/web/src/app/api/model/retentionKind.ts new file mode 100644 index 0000000..2a588ee --- /dev/null +++ b/web/src/app/api/model/retentionKind.ts @@ -0,0 +1,22 @@ +/** + * Backup Wizard API + * An API to communicate with the backup wizard daemon + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export type RetentionKind = 'hourly' | 'daily' | 'weekly' | 'monthly'; + +export const RetentionKind = { + Hourly: 'hourly' as RetentionKind, + Daily: 'daily' as RetentionKind, + Weekly: 'weekly' as RetentionKind, + Monthly: 'monthly' as RetentionKind +}; + diff --git a/web/src/app/api/model/schedule.ts b/web/src/app/api/model/schedule.ts new file mode 100644 index 0000000..3c527cb --- /dev/null +++ b/web/src/app/api/model/schedule.ts @@ -0,0 +1,24 @@ +/** + * Backup Wizard API + * An API to communicate with the backup wizard daemon + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { RetentionKind } from './retentionKind'; +import { Weekday } from './weekday'; + + +export interface Schedule { + kind: RetentionKind; + weekday: Weekday; + time: string; +} +export namespace Schedule { +} + + diff --git a/web/src/app/api/model/weekday.ts b/web/src/app/api/model/weekday.ts new file mode 100644 index 0000000..784e043 --- /dev/null +++ b/web/src/app/api/model/weekday.ts @@ -0,0 +1,25 @@ +/** + * Backup Wizard API + * An API to communicate with the backup wizard daemon + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export type Weekday = 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday'; + +export const Weekday = { + Monday: 'monday' as Weekday, + Tuesday: 'tuesday' as Weekday, + Wednesday: 'wednesday' as Weekday, + Thursday: 'thursday' as Weekday, + Friday: 'friday' as Weekday, + Saturday: 'saturday' as Weekday, + Sunday: 'sunday' as Weekday +}; +