Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement tagging of local results #63

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

mjugl
Copy link
Collaborator

@mjugl mjugl commented Dec 16, 2024

Feature request to add the ability to assign optional tags to local results.

Creating a tagged upload

Upload is a PUT-request to the /local endpoint. In addition to an upload file, an optional field containing a tag can be provided. If left empty, the upload is performed as usual.

Tags are unique per project.

Request

PUT /local HTTP/1.1
Content-Type: multipart/form-data; boundary=---123
Content-Length: 1337

---123
Content-Disposition: form-data; name="tag"

foobar
---123
Content-Disposition: form-data; name="file"; filename="my-blob.bin"
Content-Type: application/octet/stream

filedatagoeshere

Response

The response does not change.

HTTP/1.1 200
Content-Type: application/json
{
  "url": "http://localhost:8080/local/3d813718-67d4-4741-962e-d5df012d5a68"
}

Fetching uploads listed under a tag

A new endpoint is introduced at /local/tags/{tag-name}. Files that have been tagged using the specified tag will be listed.

Request

GET /local/tags/foobar HTTP/1.1
Accept: application/json

Response

The response can be used to fetch the result from GET /local/{object-uuid} as per usual.

HTTP/1.1 200
Content-Type: application/json
{
  "results": [
    { 
      "url": "http://localhost:8080/local/3d813718-67d4-4741-962e-d5df012d5a68",
      "filename": "my-blob.bin"
    }
  ]
}

@mjugl mjugl added the enhancement New feature or request label Dec 16, 2024
@mjugl mjugl self-assigned this Dec 16, 2024
@mjugl mjugl changed the title Implement tagging of local results feat: implement tagging of local results Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant