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.



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

def initialize(attributes)
  @attributes = attributes
end

Class Method Details

.allObject



318
319
320
# File 'lib/aws_cloud_map.rb', line 318

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

.find(snapshot_id) ⇒ Object



322
323
324
# File 'lib/aws_cloud_map.rb', line 322

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

Instance Method Details

#aws_idObject Also known as: id



298
299
300
# File 'lib/aws_cloud_map.rb', line 298

def aws_id
  @attributes[:aws_id]
end

#aws_progressObject



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

def aws_progress
  @attributes[:aws_progress]
end

#aws_started_atObject



302
303
304
# File 'lib/aws_cloud_map.rb', line 302

def aws_started_at
  @attributes[:aws_started_at]
end

#aws_statusObject



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

def aws_status
  @attributes[:aws_status]
end

#aws_volume_idObject



294
295
296
# File 'lib/aws_cloud_map.rb', line 294

def aws_volume_id
  @attributes[:aws_volume_id]
end

#create_volume(size, region) ⇒ Object

TODO test



314
315
316
# File 'lib/aws_cloud_map.rb', line 314

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

#volumeObject

TODO test



309
310
311
# File 'lib/aws_cloud_map.rb', line 309

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