jrxFive / python-nomad

Client library Hashicorp Nomad
https://python-nomad.readthedocs.io/en/latest/
MIT License
139 stars 73 forks source link

[Question] How to access Nomad's event stream? #113

Closed fumblehool closed 3 years ago

fumblehool commented 3 years ago

I'm using Nomad v1 and it has event-streaming enabled (endpoint: /v1/event/stream) Can I use python-nomad to access the stream?

docs: https://www.nomadproject.io/api-docs/events https://learn.hashicorp.com/tutorials/nomad/event-stream?in=nomad/integrate-nomad

jonathanrcross commented 3 years ago

Hi @fumblehool, unfortunately we havent added support for the event stream endpoint(s) that came out in the 1.0 release of Nomad.

fumblehool commented 3 years ago

@jonathanrcross I can work on this. Do you have design for implementation in mind?

jonathanrcross commented 3 years ago

I think we would probably reference/reimplement how the official Nomad Golang client API is doing it. Unsure if we should create a separate thread on the callers behalf or return a thread like object that yields, so the caller has more control of when to close/stop requesting from the event stream.

We may have to do some overriding with the timeout that is passed to to the request session as well.

jonathanrcross commented 3 years ago

Hi @fumblehool, you can access the event steam in the 1.4.1 release of python-nomad. Sorry it took so long for this feature to be added.