put_scheduled_update_group_action ( $auto_scaling_group_name, $scheduled_action_name, $opt )

Creates a scheduled scaling action for an Auto Scaling group. If you leave a parameter unspecified, the corresponding value remains unchanged in the affected Auto Scaling group.

Access

public

Parameters

Parameter

Type

Required

Description

$auto_scaling_group_name

string

Required

The name or ARN of the Auto Scaling group. [Constraints: The value must be between 1 and 1600 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]

$scheduled_action_name

string

Required

The name of this scaling action. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • Time - string - Optional - Time is deprecated. The time for this action to start. Time is an alias for StartTime and can be specified instead of StartTime, or vice versa. If both Time and StartTime are specified, their values should be identical. Otherwise, PutScheduledUpdateGroupAction will return an error. May be passed as a number of seconds since UNIX Epoch, or any string compatible with strtotime().
  • StartTime - string - Optional - The time for this action to start, as in --start-time 2010-06-01T00:00:00Z. When StartTime and EndTime are specified with Recurrence, they form the boundaries of when the recurring action will start and stop. May be passed as a number of seconds since UNIX Epoch, or any string compatible with strtotime().
  • EndTime - string - Optional - The time for this action to end. May be passed as a number of seconds since UNIX Epoch, or any string compatible with strtotime().
  • Recurrence - string - Optional - The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format. For information about cron syntax, go to Wikipedia, The Free Encyclopedia. When StartTime and EndTime are specified with Recurrence, they form the boundaries of when the recurring action will start and stop. [Constraints: The value must be between 1 and 255 characters, and must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
  • MinSize - integer - Optional - The minimum size for the new Auto Scaling group.
  • MaxSize - integer - Optional - The maximum size for the Auto Scaling group.
  • DesiredCapacity - integer - Optional - The number of Amazon EC2 instances that should be running in the group.
  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Create a scheduled scaling action for an auto scaling group.

// Instantiate the class
$as = new AmazonAS();

$response = $as->put_scheduled_update_group_action('my-scaling-group', 'my-scheduled-action', array(
	'Time' => '+10 minutes',
	'EndTime' => '+20 minutes',
	'MinSize' => 1,
	'MaxSize' => 2,
	'DesiredCapacity' => 2
));

// Success?
var_dump($response->isOK());
Result:
bool(true)

Changelog

Version

Description

1.3.7

The PutScheduledUpdateGroupAction operation introduced backwards-incompatible changes in the July 2011 update. These changes were accounted for in this version of the SDK.

Related Methods

Source

Method defined in services/as.class.php | Toggle source view (26 lines) | View on GitHub

public function put_scheduled_update_group_action($auto_scaling_group_name, $scheduled_action_name, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['AutoScalingGroupName'] = $auto_scaling_group_name;
    $opt['ScheduledActionName'] = $scheduled_action_name;
    
    // Optional DateTime
    if (isset($opt['Time']))
    {
        $opt['Time'] = $this->util->convert_date_to_iso8601($opt['Time']);
    }
    
    // Optional DateTime
    if (isset($opt['StartTime']))
    {
        $opt['StartTime'] = $this->util->convert_date_to_iso8601($opt['StartTime']);
    }
    
    // Optional DateTime
    if (isset($opt['EndTime']))
    {
        $opt['EndTime'] = $this->util->convert_date_to_iso8601($opt['EndTime']);
    }

    return $this->authenticate('PutScheduledUpdateGroupAction', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback