mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
32 lines
No EOL
1.1 KiB
Ruby
32 lines
No EOL
1.1 KiB
Ruby
module Fog
|
|
module AWS
|
|
class EC2
|
|
|
|
# Create an EBS volume
|
|
#
|
|
# ==== Parameters
|
|
# * availability_zone<~String> - availability zone to create volume in
|
|
# * size<~Integer> - Size in GiBs for volume. Must be between 1 and 1024.
|
|
# * snapshot_id<~String> - Optional, snapshot to create volume from
|
|
#
|
|
# ==== Returns
|
|
# * response<~Fog::AWS::Response>:
|
|
# * body<~Hash>:
|
|
# * :volume_id<~String> - Reference to volume
|
|
# * :size<~Integer> - Size in GiBs for volume
|
|
# * :status<~String> - State of volume
|
|
# * :create_time<~Time> - Timestamp for creation
|
|
# * :availability_zone<~String> - Availability zone for volume
|
|
# * :snapshot_id<~String> - Snapshot volume was created from, if any
|
|
def create_volume(availability_zone, size, snapshot_id = nil)
|
|
request({
|
|
'Action' => 'CreateVolume',
|
|
'AvailabilityZone' => availability_zone,
|
|
'Size' => size,
|
|
'SnapshotId' => snapshot_id
|
|
}, Fog::Parsers::AWS::EC2::CreateVolume.new)
|
|
end
|
|
|
|
end
|
|
end
|
|
end |