Package: viant-python-consul
Python client forConsul.ioDocumentationRead the DocsStatusExampleimportconsulc=consul.Consul()# poll a key for updatesindex=NonewhileTrue:index,data=c.kv.get('foo',index=index)printdata['Value']# in another processc.kv.put('foo','bar')Installationpip install python-consulNote:When using python-consul library in environment with proxy server, setting ofhttp_proxy,https_proxyandno_proxyenvironment variables can be required for proper functionality.StatusThere’s a few API endpoints still to go to expose all features available in
Consul v0.6.0. If you need an endpoint that’s not in the documentation, just
open an issue and I’ll try and add it straight away.Mailing Listhttps://groups.google.com/forum/#!forum/python-consulContributingpython-consul is currently maintained by:@matusvalo@abn@cableheadPlease reach out if you’re interested in being a maintainer as well. Otherwise,
open a PR or Issue we’ll try and respond as quickly as we’re able.Issue Labelstoday!:Some triaging is in progress and this issue should be taken care of in
a couple of hours!priority:There’s a clear need to address this issue and it’s likely a core
contributor will take it on. Opening a PR for these is greatly
appreciated!help wanted:This issue makes sense and would be useful. It’s unlikely a core
contributor will get to this though, so if you’d like to see it
addressed please open a PR.question:The need for the issue isn’t clear or needs clarification, so please
follow up.  Issues in this state for a few months, without
responses will likely will be closed.PRsPull requests are very much appreciated! When you create a PR please ensure:All current tests pass, including flake8To add tests for your new features, if reasonableTo add docstrings for new api features you add and if needed link to these
docstrings from the sphinx documentationReleases# release the current version, eg: 0.6.1-dev -> 0.6.1bumpversionrelease# prepare the next patch (z-stream) version, eg: 0.6.1 -> 0.6.2-devbumpversion--no-tagpatch# else, prepare the next minor (y-stream) version, eg: 0.6.1 -> 0.7.0-devbumpversion--no-tagminorChange log1.1.0add support for nodemeta to catalog and health end points (thanks
@ibrahimmenem)update Check.script to use args, as Consul 1.1 has dropped the script
parameter1.0.1Support for Python 3.4 dropped (sorry)Add support for Consul 1.0.0 (thanks @matusvalo!)Expose all 400 errors and add tests for common callback handler (thanks @bagerard)0.7.2Add header parameter to http check (thanks @matusvalo)Add basic Transaction HTTP API support (thanks @iandyh)Fix invalid url error when specifying credentials via host (Issue #167)0.7.1Add a common base client for shared functionality between different HTTP clients (thanks @abn!)Fix request quoting issue (thanks @abn)Fix installation issue due to aiohttp only being available for Python>=3.4.2 (thanks @abn)Added support for current release of aiohttp (thanks @eaterek)Improved Tornado example (thanks @chriswue)Add and use ACL token in Event.fire (thanks @illenseer)Add client side cert support (thanks @brocade-craig)Add token params to catalog register (thanks @gregdurham)Add support for DeregisterCriticalServiceAfter (thanks @daroot)Improve reliability of test suite (thanks @daroot!)Update CI: Add py35 and py36 to tests (thanks @Poogles)0.7.0FeaturesAdd Operator endpoint (thanks @bantonj!)0.6.2Bug FixTornado backend encoding bug related to None values (thanks @plredmond)python-consul doesn’t support python 2.6 (thanks @lowzj)Maintenanceupdate max ttl to 86400 to conform to consul (thanks @philloooo)Correct error message in ACL create/update (thanks @Crypto89)FeaturesCatalog API should support tokens (thanks @racktear!)Allow enable tag override (thanks @shalev67!)0.6.1FeaturesAdd the coordinate endpoint and near support on Catalog and Health Checks
(thanks @shalev67!)Rework all endpoints to use a common callback handler to help ensure
consistent handling of responses (thanks @shalev67)Add Query api support (thanks @shalev67)Add token support for the Health endpoints (thanks @morpheu!)Force to use UTF-8 encoding for the response with the request’s client
(thanks @maxnasonov)MaintenanceMigrate readthedocs links from .org to .io (thanks @adamchainz)0.6.0FeaturesAdd support for the new TCP and Docker health checks (thanks @abn)Add support for join and force-leave (thanks @abn)Use standard consul environment variables to override configuration (thanks
@amayausky)MaintenanceTest binaries updated to Consul 0.6.4Tweaks to fix small updates to Consul’s API0.4.7FeaturesAdd ACL token support to agent.service.register and agent.check.register0.4.6FeaturesAdd health.checks endpoint, update health TODOs (thanks @cruatta!)Improve error when a HTTP 503 status code is returned (thanks @raboof!)Added index and wait parameter to event.list (thanks @max0d41!)0.4.5FeaturesAllow SSL certificate verification to be disabled (thanks @jgadling!)Use requests.session for performance (thanks @msabramo!)Support ‘wait’ param for all blocking queries (thanks @rmt!)deduplicate query string when doing deletes with the std (requests) library
(thanks @sduthil!)0.4.4FeaturesSupport creation of ALCs with explicit ID. (thanks @KyleJamesWalker)0.4.3FeaturesSupport ‘dc’ argument to health endpoints (thanks @etuttle!)0.4.2FeaturesAdd status endpoints (thanks @cruatta!)0.4.1FeaturesAdd health.node (thanks @davidbirdsong!)0.4.0API changes (backwards incompatible)Deprecated old health.check.ttl_pass call has been removedDeprecate loose parametersscript,interval,ttl,httpandtimeout,
to configure checks via agent.service.register and agent.check.register. Both
methods now take a single argument to specify checks. A convenience
consul.Check has been added to create checks.0.3.20FeaturesAdd Node and Service Maintenance (thanks @cruatta!)Bug FixUnclosed connector Exception in consul.aio (thanks @jettify!)0.3.19Bug FixFix six dependency (thanks @pawlowskimichal!)0.3.18FeaturesAdding ability to register checks with services (thanks @cruatta!)Bug FixFix distribution for consul.aio for python3 (thanks @mbachry!)0.3.17FeaturesAdd address param to agent.service.register0.3.16FeaturesAdd cas param for kv.delete (thanks @qix)0.3.15FeaturesAdd tag parameter to health.service() (thanks @reversefold)0.3.14Featuresadd the keys and separator params to kv.get (thanks @Heuriskein)add support for the events api (thanks @Heuriskein!)0.3.13Featuresadd HTTP check support (thanks @JoeHazzers)raise ConsulException on kv.get 500 response code (thanks @jjpersch)add the wait argument to kv.get0.3.12Featuresadd behavior and ttl to session.createadd session.renew0.3.11Featuresadd the health.state endpoint (thanks @pete0emerson!)bump test binaries to 0.5.00.3.9Bug FixExclude consul.aio if asyncio isn’t available, avoids an error message on
install, trying to byte compile that module0.3.8API changes (backwards incompatible)Reorder named arguments to be more consistent. index is always the first
named argument, if available, and dc is now always the last named argument.0.3.7FeaturesAdd dc support for kv calls; add ability to set the default dc for an entire
client session (thanks @angad)Add asyncio client (thanks @jettify)0.3.6FeaturesAdd https support (thanks @pete0emerson)Add wan param to agent.members (thanks @sgargan)0.3.5Bug FixFix typo setting notes on a check (thanks @ShaheedHaque!)0.3.4FeaturesAdd support for the Agent.Check (thanks @sgargan and @ShaheedHaque)Deprecatedhealth.check.ttl_pass has been moved to agent.check.ttl_pass0.3.3FeaturesAdd support for the Session API (Consul.Session)Bug FixesFix a bug retrieving folder nodes from the KV storehttps://github.com/cablehead/python-consul/pull/6#issue-48589128Thanks @zacman850.3.2FeaturesAdd support for Python 3.40.3.1FeaturesAdd support for the Catalog API (Consul.Catalog)Add ability to set a default consistency mode for an entire client sessionAdd the ability to pass the consistency mode with kv.get0.3.0FeaturesAdd support for ACLs (Consul.ACL)API changes (backwards incompatible)For Consul.Agent.Service.register, renamecheckargument toscript