Closed tetherit closed 9 years ago
The docs have an example with attributes different from yours. Looking at the code I suspect that parameters are expected to be a JSON document (serialised, which the client doesn't do).
I don't see any examples for federation-upstream on that page, the documentation says this is the format:
PUT /api/parameters/federation-upstream/%2f/my-upstream
{"value":{"uri":"amqp://server-name","expires":3600000}}
You can see some examples here: https://www.rabbitmq.com/federation.html
Ah, I spotted my mistake! - Here is some working example code for your reference!
def add_federation_upstream(vhost, name, uri)
attributes = { value: { uri: uri, 'reconnect-delay' => 60 } }
CLIENT.update_parameters_of('federation-upstream', vhost, name, attributes)
end
@hackeron feel free to add a test that demonstrates how the method is supposed to be used (and cleans up the parameters it defines).
I am going to sleep soon, but I have added a todo to do this - maybe even add a method add_federation_upstream? - it can take (vhost, name, url, parameters) :)
Sure, take you time.
I'm not opposed adding more specific like put_federation_upstream
but we need to have an example for update_parameters_of
, even if we use basically the same data in it.
I'm trying to run this:
But I'm getting:
Any ideas?