lib/cloudstack-cli/commands/account.rb in cloudstack-cli-0.11.2 vs lib/cloudstack-cli/commands/account.rb in cloudstack-cli-0.12.0
- old
+ new
@@ -4,10 +4,25 @@
0 => 'user',
1 => 'domain-admin',
2 => 'admin'
}
+ desc "show NAME", "show detailed infos about an account"
+ def show(name)
+ unless account = client.list_accounts({name: name})
+ puts "No account with name #{name} found."
+ else
+ account = account.first
+ account.delete 'user'
+ account['accounttype'] = "#{account['accounttype']} (#{TYPES[account['accounttype']]})"
+ table = account.map do |key, value|
+ [ set_color("#{key}", :yellow), "#{value}" ]
+ end
+ print_table table
+ end
+ end
+
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."
@@ -18,7 +33,7 @@
end
print_table table
say "Total number of accounts: #{accounts.size}"
end
end
-
-end
\ No newline at end of file
+
+end