From 7386eec1667800485b1f739b1f8d49fb80454a8e Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 1 Nov 2023 14:32:00 +0700 Subject: [PATCH 1/2] add backup API endoint docs --- mkdocs/docs/api/backup.md | 38 ++++++++++++++++++++++++++++++++++++++ mkdocs/mkdocs.yml | 1 + 2 files changed, 39 insertions(+) create mode 100644 mkdocs/docs/api/backup.md diff --git a/mkdocs/docs/api/backup.md b/mkdocs/docs/api/backup.md new file mode 100644 index 0000000..69b5a78 --- /dev/null +++ b/mkdocs/docs/api/backup.md @@ -0,0 +1,38 @@ +# Backup + +Index [snapshots](snapshot.md) are a more reliable way than zip file backup as described here. + +## Backup List +**GET** `/api/backup/` +Return a list of available backup files with metadata. + +**POST** `/api/backup/` +Start a backup task now. This will return immediately, triggering an async task in the background. The message will contain a `task_id` key that can be monitored separately. + +Example return message: +```json +{ + "message": "backup task started", + "task_id": "f22f6981-35bb-4b7c-bd91-80a57d960b52" +} +``` + +## Backup Item +**GET** `/api/backup//` +Return metadata of a single backup file. + +**POST** `/api/backup//` +Start a backup restore task now. This will return immediately, triggering an async task in the background. The message will contain a `task_id` key that can be monitored separately. + +Example return message: + +```json +{ + "message": "backup restore task started", + "filename": "ta_backup-20231101-auto.zip", + "task_id": "4fc2afdf-4045-4288-a33c-e3267a9efb5a" +} +``` + +**DELETE** `/api/backup//` +Delete backup file from the filesystem. diff --git a/mkdocs/mkdocs.yml b/mkdocs/mkdocs.yml index b14c88c..8fbe342 100644 --- a/mkdocs/mkdocs.yml +++ b/mkdocs/mkdocs.yml @@ -36,6 +36,7 @@ nav: - 'Playlist': 'api/playlist.md' - 'Download': 'api/download.md' - 'Snapshot': 'api/snapshot.md' + - 'Backup': 'api/backup.md' - 'Task': 'api/task.md' - 'Stats': 'api/stats.md' - 'Additional': 'api/additional.md' From 5d6db7a4f16c5d76ceb14cdbca1f257dbd734400 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 1 Nov 2023 22:58:07 +0700 Subject: [PATCH 2/2] add user config api docs --- mkdocs/docs/api/config.md | 18 ++++++++++++++++++ mkdocs/mkdocs.yml | 1 + 2 files changed, 19 insertions(+) create mode 100644 mkdocs/docs/api/config.md diff --git a/mkdocs/docs/api/config.md b/mkdocs/docs/api/config.md new file mode 100644 index 0000000..3667314 --- /dev/null +++ b/mkdocs/docs/api/config.md @@ -0,0 +1,18 @@ +# Config + +## User Config +Per user modified config values. + +**GET** `/api/config/user/` +Return all config values *modified* by user. + +**POST** `/api/config/user/` +Modify one or more config values. For possible key, values, see `UserConfig` class. + +Example post data: +```json +{ + "colors": "dark", + "page_size": 20 +} +``` diff --git a/mkdocs/mkdocs.yml b/mkdocs/mkdocs.yml index 8fbe342..6c9a800 100644 --- a/mkdocs/mkdocs.yml +++ b/mkdocs/mkdocs.yml @@ -39,6 +39,7 @@ nav: - 'Backup': 'api/backup.md' - 'Task': 'api/task.md' - 'Stats': 'api/stats.md' + - 'Config': 'api/config.md' - 'Additional': 'api/additional.md' - Links: - 'Main site': https://www.tubearchivist.com