You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::AutoScaling::ScheduledAction

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb

Defined Under Namespace

Classes: Collection

Actions collapse

Associations collapse

Read-Only Attributes collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ ScheduledAction #initialize(options = {}) ⇒ ScheduledAction

Returns a new instance of ScheduledAction

Overloads:

  • #initialize(name, options = {}) ⇒ ScheduledAction

    Parameters:

    • name (String)

    Options Hash (options):

  • #initialize(options = {}) ⇒ ScheduledAction

    Options Hash (options):

    • :name (required, String)
    • :client (Client)


19
20
21
22
23
24
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 19

def initialize(*args)
  options = Hash === args.last ? args.pop.dup : {}
  @name = extract_name(args, options)
  @data = options.delete(:data)
  @client = options.delete(:client) || Client.new(options)
end

Instance Method Details

#auto_scaling_group_nameString

The name of the group.

Returns:

  • (String)


36
37
38
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 36

def auto_scaling_group_name
  data.auto_scaling_group_name
end

#clientClient

Returns:



96
97
98
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 96

def client
  @client
end

#dataTypes::ScheduledUpdateGroupAction



116
117
118
119
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 116

def data
  load unless @data
  @data
end

#data_loaded?Boolean

Returns true if this resource is loaded. Accessing attributes or #data on an unloaded resource will trigger a call to #load.

Returns:

  • (Boolean)

    Returns true if this resource is loaded. Accessing attributes or #data on an unloaded resource will trigger a call to #load.



124
125
126
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 124

def data_loaded?
  !!@data
end

#delete(options = {}) ⇒ EmptyStructure

Examples:

Request syntax with placeholder values


scheduled_action.delete({
  auto_scaling_group_name: "ResourceName", # required
})

Parameters:

  • options (Hash) (defaults to: {})

    ({})

Options Hash (options):

  • :auto_scaling_group_name (required, String)

    The name of the Auto Scaling group.

Returns:

  • (EmptyStructure)


139
140
141
142
143
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 139

def delete(options = {})
  options = options.merge(scheduled_action_name: @name)
  resp = @client.delete_scheduled_action(options)
  resp.data
end

#desired_capacityInteger

The number of instances you prefer to maintain in the group.

Returns:

  • (Integer)


89
90
91
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 89

def desired_capacity
  data.desired_capacity
end

#end_timeTime

The date and time that the action is scheduled to end. This date and time can be up to one month in the future.

Returns:

  • (Time)


65
66
67
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 65

def end_time
  data.end_time
end

#groupAutoScalingGroup?

Returns:



148
149
150
151
152
153
154
155
156
157
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 148

def group
  if data.auto_scaling_group_name
    AutoScalingGroup.new(
      name: data.auto_scaling_group_name,
      client: @client
    )
  else
    nil
  end
end

#loadself Also known as: reload

Loads, or reloads #data for the current Aws::AutoScaling::ScheduledAction. Returns self making it possible to chain methods.

scheduled_action.reload.data

Returns:

  • (self)


106
107
108
109
110
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 106

def load
  resp = @client.describe_scheduled_actions(scheduled_action_names: [@name])
  @data = resp.scheduled_update_group_actions[0]
  self
end

#max_sizeInteger

The maximum size of the group.

Returns:

  • (Integer)


83
84
85
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 83

def max_size
  data.max_size
end

#min_sizeInteger

The minimum size of the group.

Returns:

  • (Integer)


77
78
79
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 77

def min_size
  data.min_size
end

#nameString Also known as: scheduled_action_name

Returns:

  • (String)


29
30
31
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 29

def name
  @name
end

#recurrenceString

The recurring schedule for the action.

Returns:

  • (String)


71
72
73
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 71

def recurrence
  data.recurrence
end

#scheduled_action_arnString

The Amazon Resource Name (ARN) of the scheduled action.

Returns:

  • (String)


42
43
44
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 42

def scheduled_action_arn
  data.scheduled_action_arn
end

#start_timeTime

The date and time that the action is scheduled to begin. This date and time can be up to one month in the future.

When StartTime and EndTime are specified with Recurrence, they form the boundaries of when the recurring action will start and stop.

Returns:

  • (Time)


58
59
60
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 58

def start_time
  data.start_time
end

#timeTime

This parameter is deprecated.

Returns:

  • (Time)


48
49
50
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scheduled_action.rb', line 48

def time
  data.time
end