docs(openapi): add local data delete endpoint (#1214)

* docs(openapi): add local data delete endpoint

* chore: feedback

Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>
Signed-off-by: Adam Uhlíř <adam@uhlir.dev>

---------

Signed-off-by: Adam Uhlíř <adam@uhlir.dev>
Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>
This commit is contained in:
Adam Uhlíř 2025-05-03 18:54:38 +02:00 committed by GitHub
parent b39d541227
commit 19a5e05c13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 1 deletions

View File

@ -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)

View File

@ -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."