disable_metrics_collection ( $auto_scaling_group_name, $opt )

Disables monitoring of group metrics for the Auto Scaling group specified in AutoScalingGroupName. You can specify the list of affected metrics with the Metrics parameter.

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]*]

$opt

array

Optional

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

  • Metrics - string|array - Optional - The list of metrics to disable. If no metrics are specified, all metrics are disabled. The following metrics are supported:
    • GroupMinSize
    • GroupMaxSize
    • GroupDesiredCapacity
    • GroupInServiceInstances
    • GroupPendingInstances
    • GroupTerminatingInstances
    • GroupTotalInstances
    Pass a string for a single value, or an indexed array for multiple values.
  • 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

Disable the collection of metrics.

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

$response = $as->disable_metrics_collection('my-scaling-group', array(
	'Metrics' => array(
		'GroupMinSize',
		'GroupMaxSize',
		'GroupDesiredCapacity',
		'GroupInServiceInstances',
		'GroupPendingInstances',
		'GroupTerminatingInstances',
		'GroupTotalInstances'
	)
));

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

Related Methods

Source

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

public function disable_metrics_collection($auto_scaling_group_name, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['AutoScalingGroupName'] = $auto_scaling_group_name;
    
    // Optional list (non-map)
    if (isset($opt['Metrics']))
    {
        $opt = array_merge($opt, CFComplexType::map(array(
            'Metrics' => (is_array($opt['Metrics']) ? $opt['Metrics'] : array($opt['Metrics']))
        ), 'member'));
        unset($opt['Metrics']);
    }

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

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback