Class: Fog::AWS::EC2::Snapshot
- Inherits:
-
Model
- Object
- Model
- Fog::AWS::EC2::Snapshot
show all
- Defined in:
- lib/fog/aws/models/ec2/snapshot.rb
Instance Method Summary
collapse
Methods inherited from Model
aliases, attribute, #attributes, attributes, #collection, identity, #identity, #initialize, #inspect, #merge_attributes
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#destroy ⇒ Object
13
14
15
16
|
# File 'lib/fog/aws/models/ec2/snapshot.rb', line 13
def destroy
connection.delete_snapshot(@snapshot_id)
true
end
|
#reload ⇒ Object
18
19
20
21
22
|
# File 'lib/fog/aws/models/ec2/snapshot.rb', line 18
def reload
if new_snapshot = snapshots.get(@snapshot_id)
merge_attributes(new_snapshot.attributes)
end
end
|
#save ⇒ Object
24
25
26
27
28
29
|
# File 'lib/fog/aws/models/ec2/snapshot.rb', line 24
def save
data = connection.create_snapshot(volume_id).body
new_attributes = data.reject {|key,value| key == 'requestId'}
merge_attributes(new_attributes)
true
end
|
#snapshots ⇒ Object
31
32
33
|
# File 'lib/fog/aws/models/ec2/snapshot.rb', line 31
def snapshots
@snapshots
end
|
#volume ⇒ Object
35
36
37
|
# File 'lib/fog/aws/models/ec2/snapshot.rb', line 35
def volume
connection.describe_volumes(@volume_id)
end
|