Sha256: 0a6216ce5bf18d5d1cfc7bd00c34cd3b8e833257a1d20e7a926c0f2555f0e7e8

Contents?: true

Size: 570 Bytes

Versions: 19

Compression:

Stored size: 570 Bytes

Contents

class Account < CloudstackCli::Base

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

  desc 'list [NAME]', 'list accounts (by name)'
  def list(name = nil)
    accounts = client.list_accounts({name: name})
    if accounts.size < 1
      puts "No accounts found."
    else
      table = [["Name", "Type", "Domain"]]
      accounts.each do |account|
        table << [account['name'], TYPES[account['accounttype']], account['domain']]
      end
      print_table table
      say "Total number of accounts: #{accounts.size}"
    end
  end
  
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
cloudstack-cli-0.11.2 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.11.1 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.11.0 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.10.2 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.10.1 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.10.0 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.9.1 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.9.0 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.8.3 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.8.2 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.8.1 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.8.0 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.7.4 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.7.3 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.7.2 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.7.1 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.7.0 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.6.1 lib/cloudstack-cli/commands/account.rb
cloudstack-cli-0.6.0 lib/cloudstack-cli/commands/account.rb