public function copyImage($srcRegion, $srcImageId, $name = null, $description = null, $clientToken = null, $destRegion = null)
{
$result = null;
$options = array('SourceRegion' => (string) $srcRegion, 'SourceImageId' => (string) $srcImageId);
if ($description !== null) {
$options['Description'] = (string) $description;
}
if ($name !== null) {
$options['Name'] = (string) $name;
}
if ($name !== null) {
$options['ClientToken'] = (string) $clientToken;
}
if ($destRegion !== null) {
//It overrides region to copy
$options['_host'] = $this->ec2->getUrl($destRegion);
$options['_region'] = $destRegion;
}
$response = $this->client->call(ucfirst(__FUNCTION__), $options);
if ($response->getError() === false) {
$sxml = simplexml_load_string($response->getRawContent());
$result = (string) $sxml->imageId;
}
return $result;
}