Sha256: 55df714f1ad14010cccead28d4d108692f6a46e2be43b185069fa22ff1101dae

Contents?: true

Size: 1.11 KB

Versions: 18

Compression:

Stored size: 1.11 KB

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

  desc 'detach <vm-id>', "detaches any ISO file (if any) currently attached to a virtual machine"
  def detach(vm_id)
    client.detach_iso(vm_id, {async: true})
    say "OK", :green
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

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