Module: CloudstackClient::User
- Defined in:
- lib/cloudstack_client/commands/user.rb
Instance Method Summary collapse
-
#list_users(args = {}) ⇒ Object
Lists users.
Instance Method Details
#list_users(args = {}) ⇒ Object
Lists users.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/cloudstack_client/commands/user.rb', line 9 def list_users(args = {}) params = { 'command' => 'listUsers', 'isrecursive' => true } params['listall'] = true if args[:listall] if args[:account] account = list_accounts(name: args[:account]).first unless account puts "Error: Account #{args[:account]} not found." exit 1 end params['domainid'] = account["domainid"] params['account'] = args[:account] end json = send_request(params) json['user'] || [] end |