Scalr\Service\Aws\Ec2\V20140615\Ec2Api::deleteSnapshot PHP Метод

deleteSnapshot() публичный Метод

Deletes a snapshot of an Amazon EBS volume. Note! If you make periodic snapshots of a volume, the snapshots are incremental so that only the blocks on the device that have changed since your last snapshot are incrementally saved in the new snapshot. Even though snapshots are saved incrementally, the snapshot deletion process is designed so that you need to retain only the most recent snapshot in order to restore the volume.
public deleteSnapshot ( string $snapshotId ) : boolean
$snapshotId string The ID of the Amazon EBS snapshot.
Результат boolean Returns TRUE on success
    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;
    }
Ec2Api