From 5bd04817cc0b4a59cae55ba34e95426875fa7617 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Thu, 18 Aug 2022 10:13:00 +0300 Subject: [PATCH] Fix wrong path for swagger definition --- docs/docs.go | 56 ++++++++++++++++++++++++++++++-------- docs/swagger.json | 56 ++++++++++++++++++++++++++++++-------- docs/swagger.yaml | 49 +++++++++++++++++++++++++-------- http/handler/api/diskfs.go | 2 +- http/handler/api/memfs.go | 2 +- 5 files changed, 129 insertions(+), 36 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index f3b29d60..9baa93ac 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -302,7 +302,7 @@ const docTemplate = `{ } } }, - "/api/v3/fs/disk/": { + "/api/v3/fs/disk": { "get": { "security": [ { @@ -487,7 +487,7 @@ const docTemplate = `{ } } }, - "/api/v3/fs/mem/": { + "/api/v3/fs/mem": { "get": { "security": [ { @@ -897,21 +897,33 @@ const docTemplate = `{ "parameters": [ { "type": "string", - "description": "Comma separated list of fields (config, state, report, metadata) that will be part of the output. If empty, all fields will be part of the output", + "description": "Comma separated list of fields (config, state, report, metadata) that will be part of the output. If empty, all fields will be part of the output.", "name": "filter", "in": "query" }, { "type": "string", - "description": "Return only these process that have this reference value. Overrides a list of IDs. If empty, the reference will be ignored", + "description": "Return only these process that have this reference value. If empty, the reference will be ignored.", "name": "reference", "in": "query" }, { "type": "string", - "description": "Comma separated list of process ids to list", + "description": "Comma separated list of process ids to list. Overrides the reference. If empty all IDs will be returned.", "name": "id", "in": "query" + }, + { + "type": "string", + "description": "Glob pattern for process IDs. If empty all IDs will be returned. Intersected with results from refpattern.", + "name": "idpattern", + "in": "query" + }, + { + "type": "string", + "description": "Glob pattern for process references. If empty all IDs will be returned. Intersected with results from idpattern.", + "name": "refpattern", + "in": "query" } ], "responses": { @@ -2733,9 +2745,20 @@ const docTemplate = `{ "type": "integer" }, "types": { - "type": "array", - "items": { - "type": "string" + "type": "object", + "properties": { + "allow": { + "type": "array", + "items": { + "type": "string" + } + }, + "block": { + "type": "array", + "items": { + "type": "string" + } + } } } } @@ -4330,9 +4353,20 @@ const docTemplate = `{ "type": "integer" }, "types": { - "type": "array", - "items": { - "type": "string" + "type": "object", + "properties": { + "allow": { + "type": "array", + "items": { + "type": "string" + } + }, + "block": { + "type": "array", + "items": { + "type": "string" + } + } } } } diff --git a/docs/swagger.json b/docs/swagger.json index cf6df2a5..35c2db46 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -294,7 +294,7 @@ } } }, - "/api/v3/fs/disk/": { + "/api/v3/fs/disk": { "get": { "security": [ { @@ -479,7 +479,7 @@ } } }, - "/api/v3/fs/mem/": { + "/api/v3/fs/mem": { "get": { "security": [ { @@ -889,21 +889,33 @@ "parameters": [ { "type": "string", - "description": "Comma separated list of fields (config, state, report, metadata) that will be part of the output. If empty, all fields will be part of the output", + "description": "Comma separated list of fields (config, state, report, metadata) that will be part of the output. If empty, all fields will be part of the output.", "name": "filter", "in": "query" }, { "type": "string", - "description": "Return only these process that have this reference value. Overrides a list of IDs. If empty, the reference will be ignored", + "description": "Return only these process that have this reference value. If empty, the reference will be ignored.", "name": "reference", "in": "query" }, { "type": "string", - "description": "Comma separated list of process ids to list", + "description": "Comma separated list of process ids to list. Overrides the reference. If empty all IDs will be returned.", "name": "id", "in": "query" + }, + { + "type": "string", + "description": "Glob pattern for process IDs. If empty all IDs will be returned. Intersected with results from refpattern.", + "name": "idpattern", + "in": "query" + }, + { + "type": "string", + "description": "Glob pattern for process references. If empty all IDs will be returned. Intersected with results from idpattern.", + "name": "refpattern", + "in": "query" } ], "responses": { @@ -2725,9 +2737,20 @@ "type": "integer" }, "types": { - "type": "array", - "items": { - "type": "string" + "type": "object", + "properties": { + "allow": { + "type": "array", + "items": { + "type": "string" + } + }, + "block": { + "type": "array", + "items": { + "type": "string" + } + } } } } @@ -4322,9 +4345,20 @@ "type": "integer" }, "types": { - "type": "array", - "items": { - "type": "string" + "type": "object", + "properties": { + "allow": { + "type": "array", + "items": { + "type": "string" + } + }, + "block": { + "type": "array", + "items": { + "type": "string" + } + } } } } diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 74450880..c4990b87 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -345,9 +345,16 @@ definitions: ttl_seconds: type: integer types: - items: - type: string - type: array + properties: + allow: + items: + type: string + type: array + block: + items: + type: string + type: array + type: object type: object dir: type: string @@ -1450,9 +1457,16 @@ definitions: ttl_seconds: type: integer types: - items: - type: string - type: array + properties: + allow: + items: + type: string + type: array + block: + items: + type: string + type: array + type: object type: object dir: type: string @@ -1897,7 +1911,7 @@ paths: security: - ApiKeyAuth: [] summary: Reload the currently active configuration - /api/v3/fs/disk/: + /api/v3/fs/disk: get: description: List all files on the filesystem. The listing can be ordered by name, size, or date of last modification in ascending or descending order. @@ -2018,7 +2032,7 @@ paths: security: - ApiKeyAuth: [] summary: Add a file to the filesystem - /api/v3/fs/mem/: + /api/v3/fs/mem: get: description: List all files on the memory filesystem. The listing can be ordered by name, size, or date of last modification in ascending or descending order. @@ -2284,19 +2298,30 @@ paths: parameters: - description: Comma separated list of fields (config, state, report, metadata) that will be part of the output. If empty, all fields will be part of the - output + output. in: query name: filter type: string - - description: Return only these process that have this reference value. Overrides - a list of IDs. If empty, the reference will be ignored + - description: Return only these process that have this reference value. If + empty, the reference will be ignored. in: query name: reference type: string - - description: Comma separated list of process ids to list + - description: Comma separated list of process ids to list. Overrides the reference. + If empty all IDs will be returned. in: query name: id type: string + - description: Glob pattern for process IDs. If empty all IDs will be returned. + Intersected with results from refpattern. + in: query + name: idpattern + type: string + - description: Glob pattern for process references. If empty all IDs will be + returned. Intersected with results from idpattern. + in: query + name: refpattern + type: string produces: - application/json responses: diff --git a/http/handler/api/diskfs.go b/http/handler/api/diskfs.go index 7234680c..c143619d 100644 --- a/http/handler/api/diskfs.go +++ b/http/handler/api/diskfs.go @@ -160,7 +160,7 @@ func (h *DiskFSHandler) DeleteFile(c echo.Context) error { // @Param order query string false "asc, desc" // @Success 200 {array} api.FileInfo // @Security ApiKeyAuth -// @Router /api/v3/fs/disk/ [get] +// @Router /api/v3/fs/disk [get] func (h *DiskFSHandler) ListFiles(c echo.Context) error { pattern := util.DefaultQuery(c, "glob", "") sortby := util.DefaultQuery(c, "sort", "none") diff --git a/http/handler/api/memfs.go b/http/handler/api/memfs.go index 41e90368..d500e2be 100644 --- a/http/handler/api/memfs.go +++ b/http/handler/api/memfs.go @@ -125,7 +125,7 @@ func (h *MemFSHandler) PatchFile(c echo.Context) error { // @Param order query string false "asc, desc" // @Success 200 {array} api.FileInfo // @Security ApiKeyAuth -// @Router /api/v3/fs/mem/ [get] +// @Router /api/v3/fs/mem [get] func (h *MemFSHandler) ListFiles(c echo.Context) error { pattern := util.DefaultQuery(c, "glob", "") sortby := util.DefaultQuery(c, "sort", "none")