set_region ( $region )

This allows you to explicitly sets the region for the service to use.

Access

public

Parameters

Parameter

Type

Required

Description

$region

string

Required

The region to explicitly set. Available options are REGION_US_E1, REGION_US_W1, REGION_US_W2, REGION_EU_W1, REGION_APAC_SE1, REGION_APAC_SE2, REGION_APAC_NE1, REGION_US_GOV1, REGION_SA_E1.

Returns

Type

Description

$this

A reference to the current instance.

Examples

Set the region to use.

$cw = new AmazonCloudWatch();

// Set the region to US-East (Northern Virginia)
$cw->set_region(AmazonCloudWatch::REGION_US_E1);

// List metrics
$response = $cw->list_metrics();

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

Source

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

public function set_region($region)
{
    // @codeCoverageIgnoreStart
    $this->set_hostname($region);
    return $this;
    // @codeCoverageIgnoreEnd
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback