class EC2Launcher::DSL::BlockDevice
Attributes
mount_point[R]
name[R]
Public Class Methods
json_create(o)
click to toggle source
# File lib/ec2launcher/dsl/block_device.rb, line 71 def self.json_create(o) new(o['data']) end
new(option_hash = nil)
click to toggle source
# File lib/ec2launcher/dsl/block_device.rb, line 23 def initialize(option_hash = nil) if option_hash @name = option_hash["name"] @count = option_hash["count"] @size = option_hash["size"] @iops = option_hash["iops"] @raid_level = option_hash["raid_level"] @mount = option_hash["mount_point"] @owner = option_hash["owner"] @group = option_hash["group"] @block_ra = option_hash["block_ra"] end # Default values @count ||= 1 @group ||= "root" @user ||= "root" end
Public Instance Methods
as_json(*)
click to toggle source
# File lib/ec2launcher/dsl/block_device.rb, line 50 def as_json(*) { JSON.create_id => self.class.name, "data" => { "name" => @name, "count" => @count, "size" => @size, "iops" => @iops, "raid_level" => @raid_level, "mount_point" => @mount, "owner" => @owner, "group" => @group, "block_ra" => @block_ra } } end
is_raid?()
click to toggle source
# File lib/ec2launcher/dsl/block_device.rb, line 42 def is_raid?() @raid_level.nil? end
provisioned_iops?()
click to toggle source
# File lib/ec2launcher/dsl/block_device.rb, line 46 def provisioned_iops?() ! @iops.nil? || @iops == 0 end
to_json(*a)
click to toggle source
# File lib/ec2launcher/dsl/block_device.rb, line 67 def to_json(*a) as_json.to_json(*a) end