From 6e947ff2662d0b9fc475c5b21e9f1cfb0bb308a0 Mon Sep 17 00:00:00 2001 From: Sashanoraa Date: Sun, 15 May 2022 08:52:46 -0400 Subject: [feature] Media cleanup endpoint (#560) Adds an admin endpoint to trigger a remote media cleanup. Fixed #348 Signed-off-by: Sashanoraa --- docs/api/swagger.yaml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'docs/api') diff --git a/docs/api/swagger.yaml b/docs/api/swagger.yaml index 4c78baff9..7bfb96a35 100644 --- a/docs/api/swagger.yaml +++ b/docs/api/swagger.yaml @@ -2574,6 +2574,38 @@ paths: summary: View domain block with the given ID. tags: - admin + /api/v1/admin/media_cleanup: + post: + consumes: + - application/json + - application/xml + - application/x-www-form-urlencoded + operationId: mediaCleanup + parameters: + - description: |- + Number of days of remote media to keep. Native values will be treated as 0. + If value is not specified, the value of media-remote-cache-days in the server config will be used. + format: int64 + in: query + name: remote_cache_days + type: integer + x-go-name: RemoteCacheDays + produces: + - application/json + responses: + "200": + description: Echos the number of days requested. The cleanup is performed + asynchronously after the request completes. + "400": + description: bad request + "403": + description: forbidden + security: + - OAuth2 Bearer: + - admin + summary: Clean up remote media older than the specified number of days. + tags: + - admin /api/v1/apps: post: consumes: -- cgit v1.2.3