update_bandwidth_rate_limit ( $opt )

This operation updates the bandwidth rate limits of a gateway. You can update both the upload and download bandwidth rate limit or specify only one of the two. If you don’t set a bandwidth rate limit, the existing rate limit remains.

By default, a gateway’s bandwidth rate limits are not set. If you don’t set any limit, the gateway does not have any limitations on its bandwidth usage and could potentially use the maximum available bandwidth.

To specify which gateway to update, use the Amazon Resource Name (ARN) of the gateway in your request.

Access

public

Parameters

Parameter

Type

Required

Description

$opt

array

Optional

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

  • GatewayARN - string - Required - The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and region.
  • AverageUploadRateLimitInBitsPerSec - long - Optional - The average upload bandwidth rate limit in bits per second.
  • AverageDownloadRateLimitInBitsPerSec - long - Optional - The average download bandwidth rate limit in bits per second.
  • 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

Bandwidth Rate Limit

$sg = new AmazonStorageGateway();

$response = $sg->update_bandwidth_rate_limit(array(
	'GatewayARN'                           => $gateway_arn,
	'AverageUploadRateLimitInBitsPerSec'   => 51200,
	'AverageDownloadRateLimitInBitsPerSec' => 102400,
));
var_dump($response->isOK());

sleep(2);

$response = $sg->describe_bandwidth_rate_limit(array(
	'GatewayARN' => $gateway_arn,
));
var_dump($response->isOK());

sleep(2);

$response = $sg->delete_bandwidth_rate_limit(array(
	'GatewayARN'    => $gateway_arn,
	'BandwidthType' => 'ALL',
));
var_dump($response->isOK());

Source

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

public function update_bandwidth_rate_limit($opt = null)
{
    if (!$opt) $opt = array();
    
    return $this->authenticate('UpdateBandwidthRateLimit', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback