QubitProducts / bamboo

HAProxy auto configuration and auto service discovery for Mesos Marathon
Apache License 2.0
793 stars 214 forks source link

Allow creating entries using PUT #81

Closed c089 closed 9 years ago

c089 commented 9 years ago

Currently, to get a "create or update" behaviour, clients have to implement it themselves, because POSTing with an existing id will fail, as will putting with a non-existing id. It would be convenient if PUT could be used for creating new configurations too.

j1n6 commented 9 years ago

I'm working on this.

j1n6 commented 9 years ago

how about allowing creating and updating entry using POST?

c089 commented 9 years ago

Why would you want to use POST instead of PUT for this?

j1n6 commented 9 years ago

I checked with Marathon guys, they keep creating new app feature in PUT (used to work with POST, but they deprecated in 0.8.1). I will keep it consistent with Marathon allowing PUT to create new record. Ignore my previous comment. :)

A working solution should available by end the week.

c089 commented 9 years ago

:+1: thanks for your work

j1n6 commented 9 years ago

I'm also improving API URL encoding #58 issue together with this. So you should be able to PUT /api/services/{marathon-app-id} without escaping the Marathon App ID.

It turns out the internal webserver goji changes HTTP behaviour when URL has double '//' by forcing 301 redirect and losing HTTP body (I don't like this...). I'm considering moving to other webservers, hopefully it's not too much work involved.

j1n6 commented 9 years ago

Closed by #109 Bamboo's API URI requirement has changed, you don't need to encode Marathon AppId Anymore.