mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 13:28:42 -05:00
(#12) List active vms for a given token
This commit updates the list command to add a flag --active. It will list all active vms based on the given token as well as what template they are and how long they've been running for. As a result, this also updates how the delete --all command formats running vms.
This commit is contained in:
parent
2a5e5ba9bb
commit
6447a5f217
2 changed files with 36 additions and 6 deletions
|
|
@ -41,10 +41,18 @@ class Utils
|
|||
os_types
|
||||
end
|
||||
|
||||
def self.prettyprint_hosts(hosts)
|
||||
def self.prettyprint_hosts(hosts, verbose, url)
|
||||
puts "Running VMs:"
|
||||
hosts.each do |vm|
|
||||
puts "- #{vm}"
|
||||
vm_info = Pooler.query(verbose, url, vm)
|
||||
if vm_info['ok']
|
||||
domain = vm_info[vm]['domain']
|
||||
template = vm_info[vm]['template']
|
||||
lifetime = vm_info[vm]['lifetime']
|
||||
running = vm_info[vm]['running']
|
||||
|
||||
puts "- #{vm}#{domain} (#{running}/#{lifetime} hours)"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue