Sha256: 0f48c50cb84d3e9bb072b4c53d57bfd9cf071113cd40ffd27b597bec1870c90b

Contents?: true

Size: 855 Bytes

Versions: 8

Compression:

Stored size: 855 Bytes

Contents

class Iso < CloudstackCli::Base

  desc 'list [TYPE]', "list iso's by type [featured|self|self-executable|executable|community]"
  option :project
  option :zone
  option :account
  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(
      type: 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)
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cloudstack-cli-0.3.3 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.3.2 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.3.1 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.2.2 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.2.1 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.2.0 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.1.7 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-0.1.6 lib/cloudstack-cli/commands/iso.rb