Sha256: 1d137fd4cc99f3d6610d06fc6e1b447c77862964e0c8378bd8d6574507ba7246

Contents?: true

Size: 979 Bytes

Versions: 19

Compression:

Stored size: 979 Bytes

Contents

class Iso < CloudstackCli::Base

  desc 'list', "list iso's"
  option :project
  option :zone
  option :account
  option :type,
    enum: %w(featured self self-executable executable community all)
  def list
    resolve_project
    resolve_zone
    resolve_account
    options[:isofilter] = options[:type]
    options.delete :type
    isos = client.list_isos(options)
    if isos.size < 1
      puts "No iso's found."
    else
      table = [%w(Name Zone Bootable Public Featured)]
      isos.each do |iso|
        table <<  [
          iso['name'],
          iso['zonename'],
          iso['bootable'],
          iso['ispublic'],
          iso['isfeatured']
        ]
      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({virtualmachine_id: vm_id}, {sync: true})
    say " OK", :green
  end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
cloudstack-cli-1.2.5 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.2.4 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.2.3 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.2.1 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.2.0 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.1.0 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.0.8 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.0.7 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.0.6 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.0.5 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.0.4 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.0.3 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.0.2 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.0.1 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.0.0 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.0.0.rc4 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.0.0.rc3 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.0.0.rc2 lib/cloudstack-cli/commands/iso.rb
cloudstack-cli-1.0.0.rc1 lib/cloudstack-cli/commands/iso.rb