5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/mccloud/provider/libvirt/provider/status.rb', line 5
def status(selection=nil,options=nil)
env.ui.info ""
env.ui.info "Server(s) - provider #{@name}"
printf "%-10s %-12s %-20s %-15s %-8s\n", "Name", "Instance Id", "IP", "Type","Status"
80.times { |i| printf "=" } ; env.ui.info ""
raw.servers.each do |vm|
if vm.name.start_with?(self.filter)
unless self.filter==""
vm.name[self.filter]=""
printf "%-10s %-12s %-20s %-20s %-15s %-8s\n",vm.name,vm.mac, vm.public_ip_address, vm.cpus,vm.memory_size,vm.state
else
env.ui.info "Name: #{vm.name}"
env.ui.info "Instance Id: #{vm.uuid}"
env.ui.info "Public Ip: #{vm.public_ip_address}"
env.ui.info "Cpus: #{vm.cpus}"
env.ui.info "State: #{vm.state}"
80.times { |i| printf "=" } ; env.ui.info ""
end
end
end
env.ui.info "Volume(s) - provider #{@name}"
80.times { |i| printf "=" } ; env.ui.info ""
volume_list=raw.volumes.all()
volume_list.each do |volume|
printf "%-20s: %-10s %-10s \n",volume.name,volume.id,volume.key
printf "%-20s: %-10s %-20s %-10s\n","",volume.pool_name, volume.path, volume.format_type
printf "%-20s: %-10s %-10s\n","",volume.capacity,volume.allocation
end
end
|