Scalr\Service\Aws\Ec2\V20150415\Ec2Api::deleteVolume PHP Метод

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

Deletes an Amazon EBS volume. The volume must be in the available state (not attached to an instance)
public deleteVolume ( string $volumeId ) : boolean
$volumeId string The ID of the volume.
Результат boolean Returns true on success or throws an exception otherwise
    public function deleteVolume($volumeId)
    {
        $result = false;
        $options = ['VolumeId' => (string) $volumeId];
        $response = $this->client->call(ucfirst(__FUNCTION__), $options);
        if ($response->getError() === false) {
            //Success
            $sxml = simplexml_load_string($response->getRawContent());
            if ((string) $sxml->return != 'true') {
                throw new Ec2Exception(sprintf('Amazon Ec2 could not delete the volume with ID "%s". It returned "%s"', $options['VolumeId'], $sxml->return));
            }
            $result = true;
            $entity = $this->ec2->getEntityManagerEnabled() ? $this->ec2->volume->get($options['VolumeId']) : null;
            if ($entity !== null) {
                $this->getEntityManager()->detach($entity);
            }
        }
        return $result;
    }
Ec2Api