summaryrefslogtreecommitdiff
path: root/src/web.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/web.h')
-rw-r--r--src/web.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/web.h b/src/web.h
index 0e33018..dd6e824 100644
--- a/src/web.h
+++ b/src/web.h
@@ -2,11 +2,14 @@
#include <stddef.h>
#include <stdint.h>
+#include <time.h>
struct MHD_PostProcessor;
#define CLIENT_NAME_MAX 32
#define CLIENT_SECRET_LEN 33
+#define BACKUP_STATUS_MAX 16
+#define MAX_BACKUPS_DISPLAY 50
struct App {
const char* dbname;
@@ -64,6 +67,9 @@ struct ListClientResultClient {
int64_t id;
char name[CLIENT_NAME_MAX];
char secret[CLIENT_SECRET_LEN];
+ struct timespec last_backup;
+ char status[BACKUP_STATUS_MAX]; // "OK", "RUNNING", "STALE", "FAILED", "INTERRUPTED"
+ int is_stale;
};
struct ListClientResult {
@@ -74,24 +80,24 @@ struct ListClientResult {
int list_clients(struct Request *req, struct ListClientResult *result);
-#define BACKUP_STATUS_MAX 16
-#define BACKUP_DATETIME_MAX 32
-#define MAX_BACKUPS_DISPLAY 50
-
struct BackupRecord {
int64_t id;
char status[BACKUP_STATUS_MAX];
- char started[BACKUP_DATETIME_MAX];
- char completed[BACKUP_DATETIME_MAX];
+ struct timespec started;
+ struct timespec completed;
};
-struct GetClientResult {
+struct GetClientOnlyResult {
int found;
int64_t id;
char name[CLIENT_NAME_MAX];
char secret[CLIENT_SECRET_LEN];
- uint16_t backups_len;
+};
+
+struct GetBackupsResult {
+ uint16_t backups_len; // On input: max backups to fetch; On output: actual count
struct BackupRecord backups[];
};
-int get_client_with_backups(struct Request *req, int64_t client_id, struct GetClientResult *result);
+int get_client(struct Request *req, int64_t client_id, struct GetClientOnlyResult *result);
+int get_client_backups(struct Request *req, int64_t client_id, struct GetBackupsResult *result);