Sha256: 8db06809e89ba54e09a0ddf22436bcfe12df60aa0a9b29da7cd37a81bda098f0

Contents?: true

Size: 603 Bytes

Versions: 5

Compression:

Stored size: 603 Bytes

Contents

class Volume < CloudstackCli::Base

  desc "list", "list volumes"
  option :project
  def list
    projectid = find_project['id'] if options[:project]
    volumes = client.list_volumes(projectid)
    if volumes.size < 1
      puts "No volumes found."
    else
      table = [["Name", "Type", "Size", "VM", "Storage", "Offeringname"]]
      volumes.each do |volume|
        table << [volume['name'], volume['type'],
          (volume['size'] / 1024**3).to_s + 'GB',
          volume['vmname'],
          volume['storage'], volume['diskofferingname']]
      end
      print_table(table)
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cloudstack-cli-0.5.4 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.5.3 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.5.2 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.5.1 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.5.0 lib/cloudstack-cli/commands/volume.rb