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