Class: Awsum::Ec2::Snapshot

Inherits:
Object show all
Defined in:
lib/awsum/ec2/snapshot.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ec2, id, volume_id, status, start_time, progress) ⇒ Snapshot

:nodoc:



8
9
10
11
12
13
14
15
# File 'lib/awsum/ec2/snapshot.rb', line 8

def initialize(ec2, id, volume_id, status, start_time, progress) #:nodoc:
  @ec2 = ec2
  @id = id
  @volume_id = volume_id
  @status = status
  @start_time = start_time
  @progress = progress
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/awsum/ec2/snapshot.rb', line 6

def id
  @id
end

#progressObject (readonly)

Returns the value of attribute progress.



6
7
8
# File 'lib/awsum/ec2/snapshot.rb', line 6

def progress
  @progress
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



6
7
8
# File 'lib/awsum/ec2/snapshot.rb', line 6

def start_time
  @start_time
end

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/awsum/ec2/snapshot.rb', line 6

def status
  @status
end

#volume_idObject (readonly)

Returns the value of attribute volume_id.



6
7
8
# File 'lib/awsum/ec2/snapshot.rb', line 6

def volume_id
  @volume_id
end

Instance Method Details

#deleteObject

Delete this Snapshot



18
19
20
# File 'lib/awsum/ec2/snapshot.rb', line 18

def delete
  @ec2.delete_snapshot id
end

#reloadObject



22
23
24
25
26
27
28
29
# File 'lib/awsum/ec2/snapshot.rb', line 22

def reload
  reloaded_snapshot = @ec2.snapshot id

  @volume_id = reloaded_snapshot.volume_id
  @status = reloaded_snapshot.status
  @start_time = reloaded_snapshot.start_time
  @progress = reloaded_snapshot.progress
end