execute_policy ( $policy_name, $opt )

Runs the policy you create for your Auto Scaling group in PutScalingPolicy.

Access

public

Parameters

Parameter

Type

Required

Description

$policy_name

string

Required

The name or PolicyARN of the policy you want to run. [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]*]

$opt

array

Optional

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

  • AutoScalingGroupName - string - Optional - 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]*]
  • HonorCooldown - boolean - Optional - Set to True if you want Auto Scaling to reject this request when the Auto Scaling group is in cooldown.
  • 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

Execute an autoscaling policy.

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

$response = $as->execute_policy('my-scaling-policy', array(
	'AutoScalingGroupName' => 'my-scaling-group',
	'HonorCooldown' => 'false'
));

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

Related Methods

Source

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

public function execute_policy($policy_name, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['PolicyName'] = $policy_name;
    
    return $this->authenticate('ExecutePolicy', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback