You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+57-7
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ Schelly is a backup tool focused on the scheduling stuff, so that the heavy lift
3
3
4
4
The triggering and retainment of backups are based on the functional perception of backups, so you configure:
5
5
- Triggering cron string: cron string that defines when a new backup will be created (by calling a backend backup webhook, as [schelly-restic](http://github.com/flaviostutz/schelly-restic), for example)
6
-
- Retention policies: for how long do a backup must be retained? It depends on what the user needs when something goes wrong. In general, the more recent, more backups in time you need. By default, Schelly will try to keep something like (if a backup is outsIDe this, the webhook for backup removal will be called):
6
+
- Retention policies: for how long do a backup must be retained? It depends on what the user needs when something goes wrong. In general, the more recent, more backups in time you need. By default, Schelly will try to keep something like (if a backup is outside this, the webhook for backup removal will be called):
7
7
- the last 4 daily backups
8
8
- the last 4 weekly backps
9
9
- the last 3 monthly backups
@@ -26,10 +26,60 @@ The triggering and retainment of backups are based on the functional perception
26
26
* RETENTION_YEARLY - retention config for years
27
27
format "header1=contents1,header2=contents2"
28
28
* WEBHOOK_BODY - custom data to be sent as body for webhook calls to backup backends
29
-
* GRACE\_TIME\_SECONDS - when trying to run a new backup task, if a previous task is still running because it dIDn't finish yet, check for this parameter. if time elapsed for the running task is greater than this parameter, try to cancel it by emitting a DELETE webhook and start the new task, else mark the new task as SKIPPED and keep the running task as is.
29
+
* GRACE\_TIME\_SECONDS - when trying to run a new backup task, if a previous task is still running because it didn't finish yet, check for this parameter. if time elapsed for the running task is greater than this parameter, try to cancel it by emitting a DELETE webhook and start the new task, else mark the new task as SKIPPED and keep the running task as is.
30
+
31
+
# REST API
32
+
33
+
-```GET /backups```
34
+
- Query backups managed by Schelly
35
+
- Request body: none
36
+
- Request header: none
37
+
- Response body: json
38
+
39
+
```
40
+
{
41
+
id:{same id as returned by underlying webhook on backup creation},
42
+
status:{backup-status}
43
+
start_time:{time of backup trigger on webhook}
44
+
end_time:{time of backup finish detection}
45
+
custom_data:{data returned from webhook}
46
+
tags: {array of tags}
47
+
}
48
+
```
49
+
- status must be one of:
50
+
- 'running' - backup is not finished yet
51
+
- 'available' - backup has completed successfuly
52
+
53
+
- tags may be: 'minutely', 'hourly', 'daily', 'weekly', 'monthly', 'yearly'
54
+
55
+
- Status code 201 if created successfuly
56
+
57
+
- ```POST /backups```
58
+
- Trigger a new backup now
59
+
- Request body: none
60
+
- Request header: none
61
+
- Response body: json
62
+
63
+
```
64
+
{
65
+
id:{same id as returned by underlying webhook on backup creation},
66
+
status:{backup-status}
67
+
start_time:{time of backup trigger on webhook}
68
+
end_time:{time of backup finish detection}
69
+
custom_data:{data returned from webhook}
70
+
}
71
+
```
72
+
- status must be one of:
73
+
- 'running' - backup is not finished yet
74
+
- 'available' - backup has completed successfuly
75
+
76
+
- Status code 201 if created successfuly
77
+
30
78
31
79
# Webhook spec
32
80
81
+
will be invoked when Schelly needs to create/delete a backup on a backend server
82
+
33
83
The webhook server must expose the following REST endpoints:
34
84
35
85
- ```POST {webhook-url}```
@@ -40,7 +90,7 @@ The webhook server must expose the following REST endpoints:
40
90
41
91
```
42
92
{
43
-
ID:{alphanumeric-backup-ID},
93
+
id:{alphanumeric-backup-id},
44
94
status:{backup-status}
45
95
message:{backend-message}
46
96
}
@@ -51,29 +101,29 @@ The webhook server must expose the following REST endpoints:
51
101
52
102
- Status code 201 if created successfuly
53
103
54
-
- ```GET {webhook-url}/{backup-ID}```
104
+
- ```GET {webhook-url}/{backup-id}```
55
105
- Invoked when Schelly wants to query a specific backup instance
56
106
- Request header: ```{webhook-headers}```
57
107
- Response body: json
58
108
59
109
```
60
110
{
61
-
ID:{ID},
111
+
id:{id},
62
112
status:{backup-status},
63
113
message:{backend message}
64
114
}
65
115
```
66
116
- Status code: 200 if found, 404 if not found
67
117
68
-
- ```DELETE {webhook-url}/{backup-ID}```
118
+
- ```DELETE {webhook-url}/{backup-id}```
69
119
- Invoked when Schelly wants to trigger a new backup
0 commit comments