python-consul
python-consul copied to clipboard
agent.service.deregister(service_id) method no allowed,must be put ,not get
def deregister(self, service_id):
"""Deregister the service from the local agent. The agent will
take care of deregistering the service with the Catalog. If there
is an associated check, that is also deregistered.
:param str service_id: The service id to deregister
:rtype: bool
"""
#return self._get_no_response_body(['deregister', service_id]) # now
return self._put_no_response_body(['deregister', service_id]) # change
Hey @lyy8510a, any chance you just upgraded your consul agent >= 1.0.0 without upgrading this library? There were changes made in consul to restrict the HTTP methods allowed for certain calls: https://github.com/hashicorp/consul/pull/3405