Sha256: b4babb6d66f3730a355549c13565b8de15b57445cebd2129b1f43bbacf6258c4

Contents?: true

Size: 955 Bytes

Versions: 20

Compression:

Stored size: 955 Bytes

Contents

class Volume < CloudstackCli::Base

  desc "list", "list volumes"
  option :project, desc: 'list resources by project'
  option :account, desc: 'list resources by account'
  option :keyword, desc: 'list by keyword'
  option :name, desc: 'name of the disk volume'
  option :type, desc: 'type of disk volume (ROOT or DATADISK)'
  def list
    options[:project_id] = find_project['id'] if options[:project]
    volumes = client.list_volumes(options)
    if volumes.size < 1
      say "No volumes found."
    else
      table = [%w(Name Type Size VM Storage Offeringname Status)]
      volumes.each do |volume|
        table << [
          volume['name'], volume['type'],
          (volume['size'] / 1024**3).to_s + 'GB',
          volume['vmname'],
          volume['storage'],
          volume['diskofferingname'],
          volume['state']
        ]
      end
      print_table(table)
      say "Total number of volumes: #{volumes.size}"
    end
  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
cloudstack-cli-0.13.0 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.12.3 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.12.2 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.12.1 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.12.0 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.11.2 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.11.1 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.11.0 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.10.2 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.10.1 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.10.0 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.9.1 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.9.0 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.8.3 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.8.2 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.8.1 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.8.0 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.7.4 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.7.3 lib/cloudstack-cli/commands/volume.rb
cloudstack-cli-0.7.2 lib/cloudstack-cli/commands/volume.rb