Guest User

Untitled

a guest
Nov 2nd, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. module.exports = (robot) ->
  2.  
  3. robot.hear /check resource (.*)/i, (res) ->
  4. vropsresource = res.match[1]
  5. res.reply "looking for #{vropsresource}"
  6. user = 'admin'
  7. pass = 'VMware1!'
  8. auth = 'Basic ' + new Buffer(user + ':' + pass).toString('base64')
  9. urlstring = 'https://192.168.110.70/api/resources?name=#{vropsresource}'
  10. res.reply "#{user}, #{auth}"
  11. res.http(urlstring)
  12. .headers
  13. Authorization: auth
  14. Accept: 'application/json'
  15. Content-type:'application/json'
  16. .get() (err, res, body) ->
  17. res.reply "Got back #{body}"
Add Comment
Please, Sign In to add comment