Skip to content

Commit 473746a

Browse files
committed
Add policy entity to openapi spec
1 parent 39cd688 commit 473746a

File tree

8 files changed

+189
-1
lines changed

8 files changed

+189
-1
lines changed

api/openapi/wizard/wizard.yml

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,65 @@ components:
179179
disks:
180180
type: array
181181
items:
182-
type: string
182+
type: string
183+
RetentionKind:
184+
type: string
185+
enum:
186+
- hourly
187+
- daily
188+
- weekly
189+
- monthly
190+
Weekday:
191+
type: string
192+
enum:
193+
- monday
194+
- tuesday
195+
- wednesday
196+
- thursday
197+
- friday
198+
- saturday
199+
- sunday
200+
Retention:
201+
type: object
202+
required:
203+
- kind
204+
- amount
205+
properties:
206+
kind:
207+
$ref: "#/components/schemas/RetentionKind"
208+
amount:
209+
type: number
210+
description: The amount of backups to keep
211+
minimum: 0
212+
Schedule:
213+
type: object
214+
required:
215+
- kind
216+
- weekday
217+
- time
218+
properties:
219+
kind:
220+
$ref: "#/components/schemas/RetentionKind"
221+
weekday:
222+
$ref: "#/components/schemas/Weekday"
223+
time:
224+
type: string
225+
format: time
226+
Policy:
227+
type: object
228+
required:
229+
- id
230+
- retentions
231+
- schedules
232+
properties:
233+
id:
234+
type: string
235+
format: uuid
236+
retentions:
237+
type: array
238+
items:
239+
$ref: "#/components/schemas/Retention"
240+
schedules:
241+
type: array
242+
items:
243+
$ref: "#/components/schemas/Schedule"

web/src/app/api/.openapi-generator/FILES

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ model/deviceKind.ts
1212
model/findDevices200Response.ts
1313
model/findSSHKeys200Response.ts
1414
model/models.ts
15+
model/policy.ts
1516
model/protectionStatus.ts
1617
model/registerDevice200Response.ts
1718
model/registerDeviceRequest.ts
19+
model/retention.ts
20+
model/retentionKind.ts
21+
model/schedule.ts
22+
model/weekday.ts
1823
param.ts
1924
variables.ts

web/src/app/api/model/models.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ export * from './device';
22
export * from './deviceKind';
33
export * from './findDevices200Response';
44
export * from './findSSHKeys200Response';
5+
export * from './policy';
56
export * from './protectionStatus';
67
export * from './registerDevice200Response';
78
export * from './registerDeviceRequest';
9+
export * from './retention';
10+
export * from './retentionKind';
11+
export * from './schedule';
12+
export * from './weekday';

web/src/app/api/model/policy.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Backup Wizard API
3+
* An API to communicate with the backup wizard daemon
4+
*
5+
* The version of the OpenAPI document: 1.0.0
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
import { Schedule } from './schedule';
13+
import { Retention } from './retention';
14+
15+
16+
export interface Policy {
17+
id: string;
18+
retentions: Array<Retention>;
19+
schedules: Array<Schedule>;
20+
}
21+

web/src/app/api/model/retention.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Backup Wizard API
3+
* An API to communicate with the backup wizard daemon
4+
*
5+
* The version of the OpenAPI document: 1.0.0
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
import { RetentionKind } from './retentionKind';
13+
14+
15+
export interface Retention {
16+
kind: RetentionKind;
17+
/**
18+
* The amount of backups to keep
19+
*/
20+
amount: number;
21+
}
22+
export namespace Retention {
23+
}
24+
25+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* Backup Wizard API
3+
* An API to communicate with the backup wizard daemon
4+
*
5+
* The version of the OpenAPI document: 1.0.0
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
14+
export type RetentionKind = 'hourly' | 'daily' | 'weekly' | 'monthly';
15+
16+
export const RetentionKind = {
17+
Hourly: 'hourly' as RetentionKind,
18+
Daily: 'daily' as RetentionKind,
19+
Weekly: 'weekly' as RetentionKind,
20+
Monthly: 'monthly' as RetentionKind
21+
};
22+

web/src/app/api/model/schedule.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Backup Wizard API
3+
* An API to communicate with the backup wizard daemon
4+
*
5+
* The version of the OpenAPI document: 1.0.0
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
import { RetentionKind } from './retentionKind';
13+
import { Weekday } from './weekday';
14+
15+
16+
export interface Schedule {
17+
kind: RetentionKind;
18+
weekday: Weekday;
19+
time: string;
20+
}
21+
export namespace Schedule {
22+
}
23+
24+

web/src/app/api/model/weekday.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Backup Wizard API
3+
* An API to communicate with the backup wizard daemon
4+
*
5+
* The version of the OpenAPI document: 1.0.0
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
14+
export type Weekday = 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday';
15+
16+
export const Weekday = {
17+
Monday: 'monday' as Weekday,
18+
Tuesday: 'tuesday' as Weekday,
19+
Wednesday: 'wednesday' as Weekday,
20+
Thursday: 'thursday' as Weekday,
21+
Friday: 'friday' as Weekday,
22+
Saturday: 'saturday' as Weekday,
23+
Sunday: 'sunday' as Weekday
24+
};
25+

0 commit comments

Comments
 (0)