tempodb / tempodb-python

Python client for TempoDB
MIT License
28 stars 19 forks source link

Added Client.create_series #4

Closed doismellburning closed 12 years ago

doismellburning commented 12 years ago

Note this method doesn't handle the 400 returned if there is a key collision; I'm not quite sure of the best way to handle this

doismellburning commented 12 years ago

From http://tempo-db.com/docs/api/series/:

Keys must be unique. If requesting a key that already exists, a 400 Bad Request will be returned.

I don't believe this is the correct behaviour. First, 400 indicates a syntactically incorrect request; the request is syntactically fine but has semantic issues.

My REST-fu is weak, but I suspect the correct behaviour (having gone through http://viswaug.files.wordpress.com/2008/11/http-headers-status1.png a few times) is likely to be a 409 Conflict or 412 Precondition Failed

This pull request should probably be considered incomplete as it doesn't make any attempt to handle failures in creation, but it's a start...! :)

doismellburning commented 12 years ago

Ping?

myagley commented 12 years ago

Thanks for the pull request! I think you are correct with the 409 Conflict/Duplicate. We are close to a release on the server-side. I'll make sure the 409 makes it in and then I can update the clients.

myagley commented 12 years ago

Also, apparently the email notifications were turned off for this repo. I apologize for not getting back to you earlier. This should be fixed going forward.

doismellburning commented 12 years ago

Excellent, cheers

myagley commented 12 years ago

Thanks for the pull request! I merged the code changes. The latest server release also returns a 409 if there is a conflict. The client still needs to be updated to reflect this.

doismellburning commented 12 years ago

Excellent, thanks