Skip to content

Commit

Permalink
Add policy entity to openapi spec
Browse files Browse the repository at this point in the history
  • Loading branch information
bkuen committed Dec 27, 2023
1 parent 39cd688 commit 473746a
Show file tree
Hide file tree
Showing 8 changed files with 189 additions and 1 deletion.
63 changes: 62 additions & 1 deletion api/openapi/wizard/wizard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,65 @@ components:
disks:
type: array
items:
type: string
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"
5 changes: 5 additions & 0 deletions web/src/app/api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions web/src/app/api/model/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
21 changes: 21 additions & 0 deletions web/src/app/api/model/policy.ts
Original file line number Diff line number Diff line change
@@ -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<Retention>;
schedules: Array<Schedule>;
}

25 changes: 25 additions & 0 deletions web/src/app/api/model/retention.ts
Original file line number Diff line number Diff line change
@@ -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 {
}


22 changes: 22 additions & 0 deletions web/src/app/api/model/retentionKind.ts
Original file line number Diff line number Diff line change
@@ -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
};

24 changes: 24 additions & 0 deletions web/src/app/api/model/schedule.ts
Original file line number Diff line number Diff line change
@@ -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 {
}


25 changes: 25 additions & 0 deletions web/src/app/api/model/weekday.ts
Original file line number Diff line number Diff line change
@@ -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
};

0 comments on commit 473746a

Please sign in to comment.