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

Conversation

@ibrahimmenem
Copy link
Contributor

very simple PR to add support to node metadata introduced in consul 0.7.3.

@ibrahimmenem
Copy link
Contributor Author

hey @cablehead @abn, it seems that latest version of pytest_twisted breaks your CI, I pinned it to the previous version 1.5 so the tests are passing. I'd really appreciate your comment on this PR.

@ihpu
Copy link

ihpu commented Feb 12, 2018

I am also missing this feature in the library. Would be great to add this to the next version

@apakulov-stripe
Copy link

Hi @cablehead and @abn!
Do you have plans release this change soon?

@matusvalo
Copy link
Collaborator

Thank you for your PR.

According to documentation of consul it is possible to specify multiple times (see [1]). In proposed implementation it is possible to post only single key:value against server. Is it possible to rewrite params to be in form of sequence of two-element tuples? This is also accepted by urlib.parse.urlencode [2] which process params variable in base.HTTPClient.uri.

Moreover is it possible to use dictionary instead of string 'key:value'? This is proposed API:

consul.catalog.nodes(node_meta={'a':'b', 'c':'d'})

In this form PR will be perfect. Please let me know if it is feasible for you.

[1] https://www.consul.io/api/catalog.html#node-meta
[2] https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlencode

@ibrahimmenem
Copy link
Contributor Author

hi @matusvalo, thanks for answering! this sounds like a little bit bigger change but I think I can do it during the weekend.

@ibrahimmenem ibrahimmenem force-pushed the add-node-meta-parameter branch from 3bd7c99 to 0008ff3 Compare June 22, 2018 21:59
@ibrahimmenem
Copy link
Contributor Author

@matusvalo I think the PR is ready, please tell me if it looks good to you.
thanks

@matusvalo
Copy link
Collaborator

PR seems OK. I am merging it. Thank you @ibrahimmenem .

@matusvalo matusvalo merged commit b7870b7 into python-consul:master Jun 25, 2018
@hreidar
Copy link

hreidar commented Jul 9, 2018

@ibrahimmenem Any interest in adding this node_meta functionality to /catalog/register API also? so we can add metadata when registering external nodes to Consul.

https://www.consul.io/api/catalog.html#nodemeta

@ibrahimmenem
Copy link
Contributor Author

@hreidar this should be straightforward, I could do that during the weekend if you don't want to add it.

@hreidar
Copy link

hreidar commented Jul 10, 2018

@ibrahimmenem my coding skills are not that good so I'll leave it to you ;-) Thank you.

@sayuan sayuan mentioned this pull request Jul 11, 2018
mbrulatout referenced this pull request in criteo/py-consul Aug 28, 2023
Add nodemeta to catalog and health end points
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants