Managing watches via http api

780 views
Skip to first unread message

Erez Tamam

unread,
Mar 23, 2016, 1:15:03 PM3/23/16
to Consul
Hi,

is there a way to add and remove watches from an agent via the http api?
all i saw was you can add watches via the command line.

if watches over api is not enabled, will it be in the future? or is it not planned?

Best regards,
Erez Tamam

James Phillips

unread,
Apr 5, 2016, 1:32:35 AM4/5/16
to consu...@googlegroups.com
Hi Erez,

Currently, watches can't be created through an API, only through the agent configuration. We haven't had many requests to add this, so there's currently no plan to implement a new API. Watches are reloadable, so you don't need to completely restart the agent to change them - https://www.consul.io/docs/agent/options.html#reloadable-configuration, but it's not currently as easy as services and checks.

-- James

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/consul/issues
IRC: #consul on Freenode
---
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/01b167e3-be26-4bcb-ba61-0836bcd1e3c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Keselman

unread,
Apr 5, 2016, 1:09:50 PM4/5/16
to Consul
API for managing watches would be a great feature. Lack of such led to a fairly inconvenient workaround for dynamically-created services. Can you plan for it? 

James Phillips

unread,
Apr 5, 2016, 1:16:52 PM4/5/16
to consu...@googlegroups.com
Hi Michael,

I went ahead and opened https://github.com/hashicorp/consul/issues/1918 to keep track of the feature, since there's some interest :-)

-- James

Florian

unread,
Apr 20, 2016, 10:38:08 AM4/20/16
to Consul
Hey Michael,

Could you explain your workaround a little maybe? 

I really need this feature so I'm also looking at a workaround but an already proven one would be very useful!

Best - Florian

Michael Keselman

unread,
Apr 20, 2016, 11:22:03 AM4/20/16
to consu...@googlegroups.com
Contemplated implementing HTTP long poll call from applications, but wanted to use simple shell script, not higher level languages. Ended up creating a separate container where multiple command-line "consul watch" commands are running simultaneously. You can either pass watches' info to that container at the start or implement some very basic mechanism to instantiate additional watches during run-time (e.g. HTTP server)  

You received this message because you are subscribed to a topic in the Google Groups "Consul" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/consul-tool/seDUReCAq2c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to consul-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/60860857-c5f0-4d69-9ad0-d5f661ff155d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
-Michael Keselman
Reply all
Reply to author
Forward
0 new messages