rabbitmq_http_api_client icon indicating copy to clipboard operation
rabbitmq_http_api_client copied to clipboard

Unable to list parameters by name - undefined method `each_pair'

Open tetherit opened this issue 10 years ago • 2 comments

When I try to list_parameters_of by name, I get this error:

> client.list_parameters_of('federation-upstream', 'monitor', '33ac8c46007794dee1a6')
NoMethodError: undefined method `each_pair' for #<Array:0x0000000153b1e0>
from /var/lib/gems/2.2.0/gems/hashie-3.4.1/lib/hashie/mash.rb:179:in `deep_update'

If I don't list by name, I see the parameters as expected:

> client.list_parameters_of('federation-upstream', 'monitor')
=> [{"value"=>{"uri"=>"amqp://33ac8c46007794dee1a6:[email protected]/monitor", "reconnect-delay"=>30}, "vhost"=>"monitor", "component"=>"federation-upstream", "name"=>"33ac8c46007794dee1a6"}]

tetherit avatar May 23 '15 23:05 tetherit

Can you please post the output of the same request with curl? The body seems to be non-standard.

The path is

/api/parameters/#{uri_encode(component)}/#{uri_encode(vhost)}/#{uri_encode(name)}

michaelklishin avatar May 23 '15 23:05 michaelklishin

Sure:

$ curl "http://timeline:[email protected]:15672/api/parameters/federation-upstream/monitor/33ac8c46007794dee1a6"
{"value":{"uri":"amqp://33ac8c46007794dee1a6:[email protected]/monitor","reconnect-delay":30},"vhost":"monitor","component":"federation-upstream","name":"33ac8c46007794dee1a6"}

I'm also seeing the same issue with list_policies_of:

> client.list_policies_of('monitor', 'federate-me')
NoMethodError: undefined method `each_pair' for ["vhost", "monitor"]:Array
from /var/lib/gems/2.2.0/gems/hashie-3.4.1/lib/hashie/mash.rb:179:in `deep_update'

tetherit avatar May 23 '15 23:05 tetherit