Class: CfFactory::CfAsScalingPolicy
- Inherits:
-
Object
- Object
- CfFactory::CfAsScalingPolicy
show all
- Includes:
- CfBase
- Defined in:
- lib/cf_factory/as/cf_as_scaling_policy.rb
Instance Method Summary
collapse
Methods included from CfBase
#generate, #generate_ref, #get_deletion_policy, #get_name, #get_update_policy, #hash_to_string, #retrieve_attribute, #set_meta_data, #set_quotes, #set_tags
Constructor Details
#initialize(name, auto_scaling_group, adjustment_type, scaling_adjustment, options = {}) ⇒ CfAsScalingPolicy
Returns a new instance of CfAsScalingPolicy.
8
9
10
11
12
13
14
|
# File 'lib/cf_factory/as/cf_as_scaling_policy.rb', line 8
def initialize(name, auto_scaling_group, adjustment_type, scaling_adjustment, options = {})
@name = name
@auto_scaling_group = auto_scaling_group
@adjustment_type = adjustment_type
@scaling_adjustment = scaling_adjustment
@cooldown = options[:cooldown]
end
|
Instance Method Details
#get_cf_attributes ⇒ Object
20
21
22
|
# File 'lib/cf_factory/as/cf_as_scaling_policy.rb', line 20
def get_cf_attributes
{}
end
|
#get_cf_properties ⇒ Object
24
25
26
27
28
29
30
31
32
|
# File 'lib/cf_factory/as/cf_as_scaling_policy.rb', line 24
def get_cf_properties
result = {
"AutoScalingGroupName" => @auto_scaling_group.generate_ref,
"AdjustmentType" => @adjustment_type,
"ScalingAdjustment" => @scaling_adjustment
}
result["Cooldown"] = @cooldown unless @cooldown.nil?
result
end
|
#get_cf_type ⇒ Object
16
17
18
|
# File 'lib/cf_factory/as/cf_as_scaling_policy.rb', line 16
def get_cf_type
"AWS::AutoScaling::ScalingPolicy"
end
|