lib/telemetry/amqp/management.rb in telemetry-amqp-0.1.0 vs lib/telemetry/amqp/management.rb in telemetry-amqp-0.2.0

- old
+ new

@@ -1,8 +1,7 @@ require 'telemetry/amqp/defaults' require 'faraday' -require 'faraday_middleware' module Telemetry module AMQP module Management include Telemetry::AMQP::Defaults @@ -51,18 +50,18 @@ rescue StandardError => e puts e.message nil end - def ex_q_bindings(exchange:, queue:, **) - mgmt_connection.get("/api/bindings/telegraf/e/#{exchange}/q/#{queue}").body + def ex_q_bindings(exchange:, queue:, vhost: '/', **) + mgmt_connection.get("/api/bindings/#{vhost}/e/#{exchange}/q/#{queue}").body rescue StandardError => e puts e.message [] end - def remove_binding(exchange: 'influxdb.out', queue: "influxdb.#{hostname}", key: '#', vhost: 'telegraf', **) + def remove_binding(exchange: 'influxdb.out', queue: "influxdb.#{hostname}", key: '#', vhost: '/', **) mgmt_connection.delete("/api/bindings/#{vhost}/e/#{exchange}/q/#{queue}/#{key}").success? rescue StandardError => e puts e.message false