Sha256: f40e24f6f61087ed13d2a60940578a4f7cad38ca6602853f1f323059735a32fe

Contents?: true

Size: 620 Bytes

Versions: 27

Compression:

Stored size: 620 Bytes

Contents

class User < CloudstackCli::Base

  desc 'list', 'list users'
  option :listall
  option :account
  def list
    resolve_account
    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'], Account::TYPES[user['accounttype']], "#{user['firstname']} #{user['lastname']}",
          user['email'], user['state'], user['domain']
        ]
      end
      print_table table
      say "Total number of users: #{users.size}"
    end
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
cloudstack-cli-1.4.1 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.4.0 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.3.3 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.3.2 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.3.1 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.3.0 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.2.7 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.2.6 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.2.5 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.2.4 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.2.3 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.2.1 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.2.0 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.1.0 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.0.8 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.0.7 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.0.6 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.0.5 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.0.4 lib/cloudstack-cli/commands/user.rb
cloudstack-cli-1.0.3 lib/cloudstack-cli/commands/user.rb