55# None
66#
77# Configuration:
8- # HUBOT_RABBITMQ_HOST
8+ # HUBOT_RABBITMQ_ROOT_URL
99# HUBOT_RABBITMQ_USER (default is 'guest')
1010# HUBOT_RABBITMQ_PWD (default is 'guest')
1111# HUBOT_RABBITMQ_VIRT_HOST (defaults to '/')
2121# Notes:
2222#
2323# Author:
24- # kevwil
24+ # kevwil, davidsulpy
2525
26-
27- host = process .env .HUBOT_RABBITMQ_HOST
26+ url = process .env .HUBOT_RABBITMQ_ROOT_URL
2827user = process .env .HUBOT_RABBITMQ_USER ?= ' guest'
2928pwd = process .env .HUBOT_RABBITMQ_PWD ?= ' guest'
3029virt = process .env .HUBOT_RABBITMQ_VIRT_HOST ?= ' %2F'
@@ -43,7 +42,7 @@ dhm = (t) ->
4342
4443# get_queues = (msg) ->
4544# msg
46- # .http("http://#{host }/api/queues")
45+ # .http("#{url }/api/queues")
4746# .query(sort_reverse: 'messages')
4847# .headers(Authorization: auth, Accept: 'application/json')
4948# .get() (err, res, body) ->
@@ -66,7 +65,7 @@ module.exports = (robot) ->
6665 robot .respond / rabbit nodes/ i , (msg ) ->
6766 results = []
6867 msg
69- .http (" http:// #{ host } /api/nodes" )
68+ .http (" #{ url } /api/nodes" )
7069 .headers (Authorization : auth, Accept : ' application/json' )
7170 .get () (err , res , body ) ->
7271 if err
@@ -82,7 +81,7 @@ module.exports = (robot) ->
8281 robot .respond / rabbit queues/ i , (msg ) ->
8382 results = []
8483 msg
85- .http (" http:// #{ host } /api/queues" )
84+ .http (" #{ url } /api/queues" )
8685 .query (sort_reverse : ' messages' )
8786 .headers (Authorization : auth, Accept : ' application/json' )
8887 .get () (err , res , body ) ->
@@ -103,7 +102,7 @@ module.exports = (robot) ->
103102 robot .respond / rabbit slow queues/ i , (msg ) ->
104103 results = []
105104 msg
106- .http (" http:// #{ host } /api/queues" )
105+ .http (" #{ url } /api/queues" )
107106 .query (sort_reverse : ' messages' )
108107 .headers (Authorization : auth, Accept : ' application/json' )
109108 .get () (err , res , body ) ->
@@ -126,7 +125,7 @@ module.exports = (robot) ->
126125 sub = msg .match [1 ]
127126 results = []
128127 msg
129- .http (" http:// #{ host } /api/queues/#{ virt} /#{ sub} /bindings" )
128+ .http (" #{ url } /api/queues/#{ virt} /#{ sub} /bindings" )
130129 .headers (Authorization : auth, Accept : ' application/json' )
131130 .get () (err , res , body ) ->
132131 if err
@@ -148,7 +147,7 @@ module.exports = (robot) ->
148147 robot .respond / rabbit vhosts/ i , (msg ) ->
149148 results = []
150149 msg
151- .http (" http:// #{ host } /api/vhosts" )
150+ .http (" #{ url } /api/vhosts" )
152151 .headers (Authorization : auth, Accept : ' application/json' )
153152 .get () (err , res , body ) ->
154153 if err
0 commit comments