python-consul icon indicating copy to clipboard operation
python-consul copied to clipboard

agent.service.deregister(service_id) method no allowed,must be put ,not get

Open lyy8510a opened this issue 7 years ago • 1 comments

    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

lyy8510a avatar Oct 30 '18 06:10 lyy8510a

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

TylerLubeck avatar Nov 16 '18 04:11 TylerLubeck