Sha256: 31b5baba1e24643e1d8e9c3d6169eeb9b18efbd9e35b085d8eef93f932fa7c53

Contents?: true

Size: 470 Bytes

Versions: 29

Compression:

Stored size: 470 Bytes

Contents

class Host < CloudstackCli::Base

  desc 'list', 'list hosts'
  option :zone
  def list
    hosts = client.list_hosts(options)
    if hosts.size < 1
      say "No hosts found."
    else
      table = [["Zone", "Type", "Cluster", "Name"]]
      hosts.each do |host|
        table << [
        	host['zonename'], host['type'], host['clustername'], host['name']
        ]
      end
      print_table table
      say "Total number of hosts: #{hosts.size}"
    end
  end

end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
cloudstack-cli-0.15.1 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.15.0 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.14.1 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.14.0 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.13.1 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.13.0 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.12.3 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.12.2 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.12.1 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.12.0 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.11.2 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.11.1 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.11.0 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.10.2 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.10.1 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.10.0 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.9.1 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.9.0 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.8.3 lib/cloudstack-cli/commands/host.rb
cloudstack-cli-0.8.2 lib/cloudstack-cli/commands/host.rb