public function deleteSnapshot($snapshotId)
{
$result = false;
$options = array('SnapshotId' => (string) $snapshotId);
$response = $this->client->call(ucfirst(__FUNCTION__), $options);
if ($response->getError() === false) {
$sxml = simplexml_load_string($response->getRawContent());
if ((string) $sxml->return != 'true') {
throw new Ec2Exception(sprintf('Amazon Ec2 could not delete snapshot "%s". It returned "%s"', $options['SnapshotId'], $sxml->return));
}
$result = true;
$entity = $this->ec2->getEntityManagerEnabled() ? $this->ec2->snapshot->get($options['SnapshotId']) : null;
if ($entity !== null) {
$this->getEntityManager()->detach($entity);
}
}
return $result;
}