Add PUT /api/v3/fs endpoint for file operations

This commit is contained in:
Ingo Oppermann
2023-03-03 14:26:17 +01:00
parent eb3f396793
commit a3ff16ef30
10 changed files with 486 additions and 39 deletions

View File

@@ -321,6 +321,9 @@ const docTemplate = `{
"produces": [
"application/json"
],
"tags": [
"v16.12.0"
],
"summary": "List all registered filesystems",
"operationId": "filesystem-3-list",
"responses": {
@@ -334,6 +337,56 @@ const docTemplate = `{
}
}
}
},
"put": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Execute file operations (copy or move) between registered filesystems",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"v16.?.?"
],
"summary": "File operations between filesystems",
"operationId": "filesystem-3-file-operation",
"parameters": [
{
"description": "Filesystem operation",
"name": "config",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/api.FilesystemOperation"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.Error"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
}
},
"/api/v3/fs/{name}": {
@@ -347,6 +400,9 @@ const docTemplate = `{
"produces": [
"application/json"
],
"tags": [
"v16.7.2"
],
"summary": "List all files on a filesystem",
"operationId": "filesystem-3-list-files",
"parameters": [
@@ -401,6 +457,9 @@ const docTemplate = `{
"application/data",
"application/json"
],
"tags": [
"v16.7.2"
],
"summary": "Fetch a file from a filesystem",
"operationId": "filesystem-3-get-file",
"parameters": [
@@ -454,6 +513,9 @@ const docTemplate = `{
"text/plain",
"application/json"
],
"tags": [
"v16.7.2"
],
"summary": "Add a file to a filesystem",
"operationId": "filesystem-3-put-file",
"parameters": [
@@ -515,6 +577,9 @@ const docTemplate = `{
"produces": [
"text/plain"
],
"tags": [
"v16.7.2"
],
"summary": "Remove a file from a filesystem",
"operationId": "filesystem-3-delete-file",
"parameters": [
@@ -2785,6 +2850,27 @@ const docTemplate = `{
}
}
},
"api.FilesystemOperation": {
"type": "object",
"required": [
"operation"
],
"properties": {
"from": {
"type": "string"
},
"operation": {
"type": "string",
"enum": [
"copy",
"move"
]
},
"to": {
"type": "string"
}
}
},
"api.GraphQuery": {
"type": "object",
"properties": {