Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = (robot) ->
- robot.hear /check resource (.*)/i, (res) ->
- vropsresource = res.match[1]
- res.reply "looking for #{vropsresource}"
- user = 'admin'
- pass = 'VMware1!'
- auth = 'Basic ' + new Buffer(user + ':' + pass).toString('base64')
- urlstring = 'https://192.168.110.70/api/resources?name=#{vropsresource}'
- res.reply "#{user}, #{auth}"
- res.http(urlstring)
- .headers
- Authorization: auth
- Accept: 'application/json'
- Content-type:'application/json'
- .get() (err, res, body) ->
- res.reply "Got back #{body}"
Add Comment
Please, Sign In to add comment