Sha256: b644cdf1609d1c39959108383486f012d35faa95ae284108bac3854eb76f22e3

Contents?: true

Size: 629 Bytes

Versions: 27

Compression:

Stored size: 629 Bytes

Contents

class Cluster < CloudstackCli::Base

  desc 'list', 'list clusters'
  option :zone, desc: "lists clusters by zone"
  def list
    resolve_zone if options[:zone]
    clusters = client.list_clusters(options)
    if clusters.size < 1
      say "No clusters found."
    else
      table = [%w(Name Pod_Name Type Zone State)]
      clusters.each do |cluster|
        table << [
        	cluster['name'], cluster['podname'],
          cluster['hypervisortype'], cluster['zonename'],
          cluster['managedstate']
        ]
      end
      print_table table
      say "Total number of clusters: #{clusters.size}"
    end
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
cloudstack-cli-1.4.1 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.4.0 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.3.3 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.3.2 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.3.1 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.3.0 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.2.7 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.2.6 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.2.5 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.2.4 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.2.3 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.2.1 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.2.0 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.1.0 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.0.8 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.0.7 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.0.6 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.0.5 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.0.4 lib/cloudstack-cli/commands/cluster.rb
cloudstack-cli-1.0.3 lib/cloudstack-cli/commands/cluster.rb