Merge pull request #1553 from davidsulpy/master

added scheme as an option for rabbitmq.coffee
This commit is contained in:
Josh Nichols 2015-08-12 12:56:04 -04:00
Родитель 9274dea244 33fe5fbb4e
Коммит 88649da75f
1 изменённых файлов: 9 добавлений и 10 удалений

Просмотреть файл

@ -5,7 +5,7 @@
# None
#
# Configuration:
# HUBOT_RABBITMQ_HOST
# HUBOT_RABBITMQ_ROOT_URL
# HUBOT_RABBITMQ_USER (default is 'guest')
# HUBOT_RABBITMQ_PWD (default is 'guest')
# HUBOT_RABBITMQ_VIRT_HOST (defaults to '/')
@ -21,10 +21,9 @@
# Notes:
#
# Author:
# kevwil
# kevwil, davidsulpy
host = process.env.HUBOT_RABBITMQ_HOST
url = process.env.HUBOT_RABBITMQ_ROOT_URL
user = process.env.HUBOT_RABBITMQ_USER ?= 'guest'
pwd = process.env.HUBOT_RABBITMQ_PWD ?= 'guest'
virt = process.env.HUBOT_RABBITMQ_VIRT_HOST ?= '%2F'
@ -43,7 +42,7 @@ dhm = (t) ->
# get_queues = (msg) ->
# msg
# .http("http://#{host}/api/queues")
# .http("#{url}/api/queues")
# .query(sort_reverse: 'messages')
# .headers(Authorization: auth, Accept: 'application/json')
# .get() (err, res, body) ->
@ -66,7 +65,7 @@ module.exports = (robot) ->
robot.respond /rabbit nodes/i, (msg) ->
results = []
msg
.http("http://#{host}/api/nodes")
.http("#{url}/api/nodes")
.headers(Authorization: auth, Accept: 'application/json')
.get() (err, res, body) ->
if err
@ -82,7 +81,7 @@ module.exports = (robot) ->
robot.respond /rabbit queues/i, (msg) ->
results = []
msg
.http("http://#{host}/api/queues")
.http("#{url}/api/queues")
.query(sort_reverse: 'messages')
.headers(Authorization: auth, Accept: 'application/json')
.get() (err, res, body) ->
@ -103,7 +102,7 @@ module.exports = (robot) ->
robot.respond /rabbit slow queues/i, (msg) ->
results = []
msg
.http("http://#{host}/api/queues")
.http("#{url}/api/queues")
.query(sort_reverse: 'messages')
.headers(Authorization: auth, Accept: 'application/json')
.get() (err, res, body) ->
@ -126,7 +125,7 @@ module.exports = (robot) ->
sub = msg.match[1]
results = []
msg
.http("http://#{host}/api/queues/#{virt}/#{sub}/bindings")
.http("#{url}/api/queues/#{virt}/#{sub}/bindings")
.headers(Authorization: auth, Accept: 'application/json')
.get() (err, res, body) ->
if err
@ -148,7 +147,7 @@ module.exports = (robot) ->
robot.respond /rabbit vhosts/i, (msg) ->
results = []
msg
.http("http://#{host}/api/vhosts")
.http("#{url}/api/vhosts")
.headers(Authorization: auth, Accept: 'application/json')
.get() (err, res, body) ->
if err