Sha256: 6877baf55407594c4696446921ed98b7f250dc6c95d544e64f9168ec5a704f3d

Contents?: true

Size: 944 Bytes

Versions: 11

Compression:

Stored size: 944 Bytes

Contents

class Iso < CloudstackCli::Base

  desc 'list [TYPE]', "list iso's by type [featured|self|self-executable|executable|community], default is featured"
  option :project
  option :zone
  option :account
  option :listall
  def list(type='featured')
    project = find_project if options[:project]
    unless %w(featured self self-executable executable community).include?(type)
      say "unsupported iso type '#{type}'", :red
      exit 1
    end
    zone = client.get_zone(options[:zone]) if options[:zone]
    isos = client.list_isos(
      filter: type,
      project_id: project ? project['id'] : nil,
      zone_id: zone ? zone['id'] : nil
    )
    if isos.size < 1
      puts "No iso's found"
    else
      table = [["Name", "Zone", "Bootable"]]
      isos.each do |iso|
        table <<  [iso['name'], iso['zonename'], iso['bootable']]
      end
      print_table(table)
      say "Total number of isos: #{isos.size}"
    end
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cloudstack-cli-0.8.3 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.8.2 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.8.1 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.8.0 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.7.4 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.7.3 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.7.2 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.7.1 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.7.0 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.6.1 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.6.0 lib/cloudstack-cli/commands/iso.rb