Class: AWS::EC2::VolumeCollection
- Inherits:
-
Collection
- Object
- Collection
- AWS::EC2::VolumeCollection
- Defined in:
- lib/aws/ec2/volume_collection.rb
Overview
Represents a collection of Amazon EBS volumes. Typically you should get an instance of this class by calling #volumes.
Instance Method Summary collapse
-
#create(options = {}) ⇒ Volume
Creates a new Amazon EBS volume that any Amazon EC2 instance in the same Availability Zone can attach to.
- #each {|Instance| ... } ⇒ nil
Instance Method Details
#create(options = {}) ⇒ Volume
Creates a new Amazon EBS volume that any Amazon EC2 instance in the same Availability Zone can attach to. For more information about Amazon EBS, go to the Amazon Elastic Compute Cloud User Guide.
82 83 84 85 86 87 88 |
# File 'lib/aws/ec2/volume_collection.rb', line 82 def create = {} if snapshot = .delete(:snapshot) [:snapshot_id] = snapshot.id end resp = client.create_volume() Volume.new_from(:create_volume, resp, resp.volume_id, :config => config) end |
#each {|Instance| ... } ⇒ nil
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/aws/ec2/volume_collection.rb', line 41 def each(&block) resp = filtered_request(:describe_volumes) resp.volume_set.each do |v| volume = Volume.new_from(:describe_volumes, v, v.volume_id, :config => config) yield(volume) end nil end |