Add DELETE /api/v3/fs/:storage endpoint

Works similar to the GET endpoint. It has the same query parameter (without
"sort" and "order"). A glob pattern has to be provided. To select all
files, use the glob pattern "/**".
This commit is contained in:
Ingo Oppermann
2023-03-17 17:05:56 +01:00
parent 7e7aadc6cb
commit a692f88b69
14 changed files with 426 additions and 36 deletions

View File

@@ -467,6 +467,72 @@ const docTemplate = `{
}
}
}
},
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Delete all files on a filesystem based on patterns",
"produces": [
"application/json"
],
"tags": [
"v16.?.?"
],
"summary": "Delete all files on a filesystem based on patterns",
"operationId": "filesystem-3-delete-files",
"parameters": [
{
"type": "string",
"description": "Name of the filesystem",
"name": "storage",
"in": "path",
"required": true
},
{
"type": "string",
"description": "glob pattern for file names",
"name": "glob",
"in": "query"
},
{
"type": "integer",
"description": "minimal size of files",
"name": "size_min",
"in": "query"
},
{
"type": "integer",
"description": "maximal size of files",
"name": "size_max",
"in": "query"
},
{
"type": "integer",
"description": "minimal last modification time",
"name": "lastmod_start",
"in": "query"
},
{
"type": "integer",
"description": "maximal last modification time",
"name": "lastmod_end",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
"/api/v3/fs/{storage}/{filepath}": {
@@ -605,7 +671,7 @@ const docTemplate = `{
"v16.7.2"
],
"summary": "Remove a file from a filesystem",
"operationId": "filesystem-3-delete-file",
"operationId": "filesystem-3-delete-files",
"parameters": [
{
"type": "string",