-
Notifications
You must be signed in to change notification settings - Fork 220
Support for txn
in HTTP API
#148
Comments
ping @cablehead |
Pull requests gratefully accepted. |
@cablehead are you planning to work on this anytime in the near future? If not I may take a look at implementing it. |
@beardedeagle Hi. I have a branch currently supports |
I've deleted my previous comment, as I misread the conversation above. Hi there. I won't have time to work on this in the near future (I've just recently become a parent, and I'm slowly adjusting!). @iandyh is it possible to create a PR for your branch? If it looks OK we can look to get it merge. @beardedeagle it'd be awesome if you had time to work on it to, particularly in order to support async clients as well. |
@iandyh That would be immediately be helpful to me since I am not using any async clients, but if you get it pr'd in I can look at helping to get those implemented. |
@beardedeagle @cablehead Let me work on it on Friday with async support if it's straightforward. |
@iandyh were you able to make any headway on that? I pulled your changes locally and have started to tinker. |
Hi
Sorry I was busy last Friday and then it's the Japan holiday season. If it's urgent, feel free to use iandyh/python-marathon `txn` branch. I've been used it for development for a while. I'll prepare the PR when I am back from holiday(Thursday this week)
…Sent from my iPhone
On Aug 14, 2017, at 23:39, Randy Thompson ***@***.***> wrote:
@iandyh were you able to make any headway on that?
―
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Add support for Transaction HTTP API. Reference: https://www.consul.io/api/txn.html Relates-to: python-consul#148
I have merged initial work into master via #166. However, note that there is further work to be done here so leaving this issue open for now, might create more atomic issues later. |
@abn Just out of curiosity, what atomic issues you are referring to? |
@iandyh I just mean I might create more github issues with smaller chunks of further work required to expand on the feature. |
Hi, I tried to use txn like this:
This works fine. My code does not:
However "Results" is always an empty list:
What am I doing wrong? |
@paltryeffort I have tried to reproduce this but failed, havent tried with a token yet though. Here is what I did.
docker run --rm -it -p 8500:8500 consul
import json
from consul.std import Consul
if __name__ == '__main__':
c = Consul()
c.txn.put(payload=[
{
"KV": {
"Verb": "check-not-exists",
"Key": "foo"
}
},
{
"KV": {
"Verb": "set",
"Key": "foo/bar",
"Value": ""
}
},
{
"KV": {
"Verb": "set",
"Key": "foo/baz",
"Value": ""
}
}
])
r = c.txn.put(payload=[
{
"KV": {
"Verb": "get-tree",
"Key": "foo"
}
}
])
print(json.dumps(r, indent=2))
c.txn.put(payload=[
{
"KV": {
"Verb": "delete-tree",
"Key": "foo"
}
}
]) This produce the following output. {
"Index": 0,
"Errors": null,
"Results": [
{
"KV": {
"LockIndex": 0,
"ModifyIndex": 99,
"Value": null,
"Flags": 0,
"Key": "foo/bar",
"CreateIndex": 99
}
},
{
"KV": {
"LockIndex": 0,
"ModifyIndex": 99,
"Value": null,
"Flags": 0,
"Key": "foo/baz",
"CreateIndex": 99
}
}
],
"KnownLeader": true,
"LastContact": 0
} |
@abn you have no token required with docker image. That is the reason why your test has passed. |
Add support for Transaction HTTP API. Reference: https://www.consul.io/api/txn.html Relates-to: #148
https://www.consul.io/api/txn.html
Any play for implementing this? Thanks.
The text was updated successfully, but these errors were encountered: