From 19a5e05c1397a26e4d9b02264bdf560829f3d8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Uhl=C3=AD=C5=99?= Date: Sat, 3 May 2025 18:54:38 +0200 Subject: [PATCH] docs(openapi): add local data delete endpoint (#1214) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(openapi): add local data delete endpoint * chore: feedback Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com> Signed-off-by: Adam Uhlíř --------- Signed-off-by: Adam Uhlíř Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com> --- codex/rest/api.nim | 2 +- openapi.yaml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/codex/rest/api.nim b/codex/rest/api.nim index 7c7dcd34..0d9e5d80 100644 --- a/codex/rest/api.nim +++ b/codex/rest/api.nim @@ -288,7 +288,7 @@ proc initDataApi(node: CodexNodeRef, repoStore: RepoStore, router: var RestRoute cid: Cid, resp: HttpResponseRef ) -> RestApiResponse: ## Deletes either a single block or an entire dataset - ## from the local node. Does nothing and returns 200 + ## from the local node. Does nothing and returns 204 ## if the dataset is not locally available. ## var headers = buildCorsHeaders("DELETE", allowedOrigin) diff --git a/openapi.yaml b/openapi.yaml index 0c3ca9fe..23c5ead8 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -627,6 +627,26 @@ paths: "500": description: Well it was bad-bad + delete: + summary: "Deletes either a single block or an entire dataset from the local node." + tags: [Data] + operationId: deleteLocal + parameters: + - in: path + name: cid + required: true + schema: + $ref: "#/components/schemas/Cid" + description: Block or dataset to be deleted. + + responses: + "204": + description: Data was successfully deleted. + "400": + description: Invalid CID is specified + "500": + description: There was an error during deletion + "/data/{cid}/network": post: summary: "Download a file from the network to the local node if it's not available locally. Note: Download is performed async. Call can return before download is completed."