Class: Nrcmd::User
- Inherits:
-
Thor
- Object
- Thor
- Nrcmd::User
- Defined in:
- lib/nrcmd/users_cli.rb
Constant Summary collapse
- URL =
'https://api.newrelic.com/v2'
Instance Method Summary collapse
Instance Method Details
#list ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/nrcmd/users_cli.rb', line 17 def list uri = URL + '/users.json' filter_param = "" ["filter"].gsub(" ", "").split(',').each do |filter| fkv = filter.split('=') filter_param << "filter[#{fkv[0]}]=#{fkv[1]}&" end res = Nrcmd::Http.get(uri, {}, filter_param) result = JSON.parse(res.body) print JSON[ result ] end |