Sha256: e778d28161089b36976b5e9f88f2e42046978a36c0b87e3cf34f071fe6f85f15

Contents?: true

Size: 706 Bytes

Versions: 3

Compression:

Stored size: 706 Bytes

Contents

class Snapshot < CloudstackCli::Base

  desc 'list', 'list snapshots'
  option :account
  option :project
  option :domain
  option :listall, default: true
  def list
    resolve_account
    resolve_project
    resolve_domain
    snapshots = client.list_snapshots(options)
    if snapshots.size < 1
      say "No snapshots found."
    else
      table = [["Account", "Name", "Volume", "Created", "Type"]]
      snapshots.each do |snapshot|
        table << [
        	snapshot['account'], snapshot['name'], snapshot['volumename'],
        	snapshot['created'], snapshot['snapshottype']
        ]
      end
      print_table table
      say "Total number of snapshots: #{snapshots.size}"
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cloudstack-cli-1.0.0.rc3 lib/cloudstack-cli/commands/snapshot.rb
cloudstack-cli-1.0.0.rc2 lib/cloudstack-cli/commands/snapshot.rb
cloudstack-cli-1.0.0.rc1 lib/cloudstack-cli/commands/snapshot.rb