set_resource_prefix ( $prefix )

Set the resource prefix to use. This method is useful for alternate services that are API-compatible with AWS.

Access

public

Parameters

Parameter

Type

Required

Description

$prefix

string

Required

An alternate prefix to prepend to the resource path. Useful for mock or test applications.

Returns

Type

Description

$this

A reference to the current instance.

Examples

Configure hostname and resource prefix.

// Instantiate the class
$ec2 = new AmazonEC2();

// Point to the new endpoint
$ec2->set_hostname('localhost', '3000');
$ec2->set_resource_prefix('/services/mock');
$ec2->allow_hostname_override(false);

// Describe images
$response = $ec2->describe_images();

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

Source

Method defined in sdk.class.php | Toggle source view (5 lines) | View on GitHub

public function set_resource_prefix($prefix)
{
    $this->resource_prefix = $prefix;
    return $this;
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback