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

✨ add logs api #96

Merged
merged 4 commits into from
May 13, 2024
Merged

✨ add logs api #96

merged 4 commits into from
May 13, 2024

Conversation

lvenier
Copy link
Contributor

@lvenier lvenier commented May 10, 2024

Feature to expose container logs though the api.
Needed to implement Plugin issue SaaShup/netbox-docker-plugin#98

[X] Add new endpoint in the API
[X] Add Ui fetch logs and display

UI example :
image

@linkdd
Copy link
Collaborator

linkdd commented May 10, 2024

I just tested, and I see 2 issues:

  • the content type is text/html when it should be text/plain or maybe application/octet-stream
  • it is a standard HTTP response, not "Server Sent Event", not "Websocket"

Therefore, there is no way of simulating docker logs -f.

I don't see the second point as blocking for now. The plugin could then implement an API view /containers/{id}/logs/ that proxy the request to the agent and returns the data, so that we could load it in the UI with HTMX and have it autoreload every 5s or so.

@linkdd
Copy link
Collaborator

linkdd commented May 10, 2024

Actually, third point. Why is it a PUT request?

@lvenier lvenier merged commit 7386c3e into main May 13, 2024
1 check passed
@lvenier lvenier deleted the plugin_98_add_logs branch May 13, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants