Sha256: 10096589b693a834d7a1339956099f88dc52ae7f61e5041156f567682028b78c

Contents?: true

Size: 634 Bytes

Versions: 5

Compression:

Stored size: 634 Bytes

Contents

class User < CloudstackCli::Base

  USER_TYPES = {
    0 => 'user',
    1 => 'domain-admin',
    2 => 'admin'
  }

  desc 'user list', 'list users'
  option :listall
  option :account
  def list
    users = client.list_users(options)
    if users.size < 1
      say "No users found."
    else
      table = [["Account", "Type", "Name", "Email", "State", "Domain"]]
      users.each do |user|
        table << [
          user['account'], USER_TYPES[user['accounttype']], "#{user['firstname']} #{user['lastname']}",
          user['email'], user['state'], user['domain']
        ]
      end
      print_table table
    end
  end
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cloudstack-cli-0.4.3 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-0.4.2 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-0.4.1 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-0.4.0 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-0.3.11 lib/cloudstack-cli/commands/user.rb