Skip to main content

Find service from Consul

Project description

Consul Service Finder

I got a problem when I try to simulate multiple service register on Consul server and the client can find one of the services to use the API.

I can use below URL to get all services but that is not what I want.

curl http://localhost:8500/v1/agent/services

Ideas

* Consul Query to search service by service name

* Count the service be used

* Return min count of services by same service name

Example


    csf = ConsulServiceFinder()

    # create query by service name
    csf.createQueryByServiceName("microweb_microtalk", "q_test")

    # find one service and compose it's url
    csf.composeServiceUrl(csf.requestOneServiceByServiceName("microweb_microtalk"))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

consulservicefinder-0.0.4.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

consulservicefinder-0.0.4-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page