Class: AWS::AutoScaling::ScheduledAction
- Inherits:
-
Core::Resource
- Object
- Core::Resource
- AWS::AutoScaling::ScheduledAction
- Defined in:
- lib/aws/auto_scaling/scheduled_action.rb
Instance Attribute Summary collapse
-
#arn ⇒ String
readonly
The current value of arn.
-
#auto_scaling_group_name ⇒ String
readonly
The current value of auto_scaling_group_name.
-
#desired_capacity ⇒ Integer
readonly
The current value of desired_capacity.
-
#end_time ⇒ Time
readonly
The current value of end_time.
-
#max_size ⇒ Integer
readonly
The current value of max_size.
-
#min_size ⇒ Integer
readonly
The current value of min_size.
- #name ⇒ String readonly
-
#recurrence ⇒ String
readonly
The current value of recurrence.
-
#start_time ⇒ Time
readonly
The current value of start_time.
Attributes included from Core::Model
Instance Method Summary collapse
-
#delete ⇒ nil
Deletes the current scheduled action.
- #exists? ⇒ Boolean
- #group ⇒ Group
-
#initialize(name, options = {}) ⇒ ScheduledAction
constructor
A new instance of ScheduledAction.
-
#update(options = {}) ⇒ nil
(also: #put)
Updates the scheduled action.
Methods inherited from Core::Resource
attribute_providers, attribute_providers_for, attributes, #attributes_from_response, define_attribute_type, #eql?, #inspect, new_from
Methods included from Core::Cacheable
Methods included from Core::Model
#client, #config_prefix, #inspect
Constructor Details
#initialize(name, options = {}) ⇒ ScheduledAction
Returns a new instance of ScheduledAction.
38 39 40 41 |
# File 'lib/aws/auto_scaling/scheduled_action.rb', line 38 def initialize name, = {} @name = name super end |
Instance Attribute Details
#arn ⇒ String (readonly)
Returns the current value of arn.
35 36 37 |
# File 'lib/aws/auto_scaling/scheduled_action.rb', line 35 def arn @arn end |
#auto_scaling_group_name ⇒ String (readonly)
Returns the current value of auto_scaling_group_name.
35 36 37 |
# File 'lib/aws/auto_scaling/scheduled_action.rb', line 35 def auto_scaling_group_name @auto_scaling_group_name end |
#desired_capacity ⇒ Integer (readonly)
Returns the current value of desired_capacity.
35 36 37 |
# File 'lib/aws/auto_scaling/scheduled_action.rb', line 35 def desired_capacity @desired_capacity end |
#end_time ⇒ Time (readonly)
Returns the current value of end_time.
35 36 37 |
# File 'lib/aws/auto_scaling/scheduled_action.rb', line 35 def end_time @end_time end |
#max_size ⇒ Integer (readonly)
Returns the current value of max_size.
35 36 37 |
# File 'lib/aws/auto_scaling/scheduled_action.rb', line 35 def max_size @max_size end |
#min_size ⇒ Integer (readonly)
Returns the current value of min_size.
35 36 37 |
# File 'lib/aws/auto_scaling/scheduled_action.rb', line 35 def min_size @min_size end |
#name ⇒ String (readonly)
44 45 46 |
# File 'lib/aws/auto_scaling/scheduled_action.rb', line 44 def name @name end |
#recurrence ⇒ String (readonly)
Returns the current value of recurrence.
35 36 37 |
# File 'lib/aws/auto_scaling/scheduled_action.rb', line 35 def recurrence @recurrence end |
#start_time ⇒ Time (readonly)
Returns the current value of start_time.
35 36 37 |
# File 'lib/aws/auto_scaling/scheduled_action.rb', line 35 def start_time @start_time end |
Instance Method Details
#delete ⇒ nil
Deletes the current scheduled action.
123 124 125 126 127 128 129 |
# File 'lib/aws/auto_scaling/scheduled_action.rb', line 123 def delete client_opts = {} client_opts[:scheduled_action_name] = name client_opts[:auto_scaling_group_name] = auto_scaling_group_name client.delete_scheduled_action(client_opts) nil end |
#exists? ⇒ Boolean
114 115 116 117 118 119 |
# File 'lib/aws/auto_scaling/scheduled_action.rb', line 114 def exists? client_opts = {} client_opts[:scheduled_action_names] = [name] resp = client.describe_scheduled_actions(client_opts) !resp.scheduled_update_group_actions.empty? end |
#group ⇒ Group
69 70 71 |
# File 'lib/aws/auto_scaling/scheduled_action.rb', line 69 def group Group.new(auto_scaling_group_name, :config => config) end |
#update(options = {}) ⇒ nil Also known as: put
Updates the scheduled action. If you omit an option, the corresponding value remains unchanged in the Auto Scaling group.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/aws/auto_scaling/scheduled_action.rb', line 93 def update = {} client_opts = .dup client_opts[:scheduled_action_name] = name client_opts[:auto_scaling_group_name] = auto_scaling_group_name # convert these options to timestamps [:start_time, :end_time].each do |opt| if client_opts[opt].is_a?(Time) client_opts[opt] = client_opts[opt].iso8601 end end client.put_scheduled_update_group_action(client_opts) nil end |