Class: AWS::Snapshot

Inherits:
Object
  • Object
show all
Includes:
AWS
Defined in:
lib/aws_cloud_map.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from AWS

connect, ec2

Constructor Details

#initialize(attributes) ⇒ Snapshot

Returns a new instance of Snapshot.



251
252
253
# File 'lib/aws_cloud_map.rb', line 251

def initialize(attributes)
  @attributes = attributes
end

Class Method Details

.allObject



287
288
289
# File 'lib/aws_cloud_map.rb', line 287

def self.all
  @@ec2.describe_snapshots.map { |snapshot| new(snapshot) }
end

.find(snapshot_id) ⇒ Object



291
292
293
# File 'lib/aws_cloud_map.rb', line 291

def self.find(snapshot_id)
  new(@@ec2.describe_snapshots([snapshot_id]).first)
end

Instance Method Details

#aws_idObject Also known as: id



267
268
269
# File 'lib/aws_cloud_map.rb', line 267

def aws_id
  @attributes[:aws_id]
end

#aws_progressObject



255
256
257
# File 'lib/aws_cloud_map.rb', line 255

def aws_progress
  @attributes[:aws_progress]
end

#aws_started_atObject



271
272
273
# File 'lib/aws_cloud_map.rb', line 271

def aws_started_at
  @attributes[:aws_started_at]
end

#aws_statusObject



259
260
261
# File 'lib/aws_cloud_map.rb', line 259

def aws_status
  @attributes[:aws_status]
end

#aws_volume_idObject



263
264
265
# File 'lib/aws_cloud_map.rb', line 263

def aws_volume_id
  @attributes[:aws_volume_id]
end

#create_volume(size, region) ⇒ Object

TODO test



283
284
285
# File 'lib/aws_cloud_map.rb', line 283

def create_volume(size, region)
  @@ec2.create_volume(id, size, region)
end

#volumeObject

TODO test



278
279
280
# File 'lib/aws_cloud_map.rb', line 278

def volume
  @volume ||= Volume.find(aws_volume_id)
end