Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

deregister service id and check id #175

Closed

Description

@chinakevinguo

Is this code really like this? when change 'get' to 'put' ,it works...

            def deregister(self, service_id):
                """
                Used to remove a 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.
                """
                # return self.agent.http.get(
                #     CB.bool(), '/v1/agent/service/deregister/%s' % service_id)

                return self.agent.http.put(
                    CB.bool(), '/v1/agent/service/deregister/%s' % service_id)

Activity

  1. bobh66 commented on Oct 25, 2017

    @bobh66

    See PR #174

  2. bobh66 commented on Oct 25, 2017

    @bobh66

    I don't know when the above PR will be accepted, so if you need a workaround you can do something like this:

    from consul import Consul
    from consul.base import CB
    
    
    class MyAgentService(Consul.Agent.Service):
        def deregister(self, service_id):
            return self.agent.http.put(CB.bool(), '/v1/agent/service/deregister/%s' % service_id)
    
    
    client = Consul(host=host, port=port)
    client.agent.service = MyAgentService(consul)
    
    

    This will override the "bad" deregister method and use put instead of get.

  3. chinakevinguo commented on Oct 26, 2017

    @chinakevinguo
    Author

    ok, thanks ,i'll close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions