Consul: How to update the service tags?

Created on 24 Dec 2015  路  5Comments  路  Source: hashicorp/consul

In service document, that says:

The enableTagOverride can optionally be specified to disable the anti-entropy 
feature for this service. If enableTagOverride is set to TRUE then external agents 
can update this service in the catalog and modify the tags. 

But I cannot find any api to update a exist service.

The APIs agent/service/register and catalog/register will create a new service and cannot update the service.

Then, how to update a service tags?

Most helpful comment

how to reopen this issue? I need an API only update the tags with others untouched

All 5 comments

Hi @subchen you'd use the https://www.consul.io/docs/agent/http/catalog.html#catalog_register API to register the service again with the same information except for the tags. It can definitely be used to update an existing service (it's also what the agents use during anti-entropy to sync up changes).

Please let me know if you have any trouble updating!

Thanks for your explanations.
But I cannot get the full catalog information to update, sometime I have some dynamic services or checks registered by API.

Could I only update the service itself without others?

how to reopen this issue? I need an API only update the tags with others untouched

how to reopen this issue? I need an API only update the tags with others untouched

similar here.

Was this page helpful?
0 / 5 - 0 ratings