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

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

Deletes a VPC.You must detach or delete all gateways or other objects that are dependent on the VPC first. For example, you must terminate all running instances, delete all security groups (except the default), delete all the route tables (except the default), and so on.
public deleteVpc ( string $vpcId ) : boolean
$vpcId string The ID of the VPC
Результат boolean Returns true on success or throws an exception
    public function deleteVpc($vpcId)
    {
        $result = null;
        $options = array('VpcId' => (string) $vpcId);
        $action = ucfirst(__FUNCTION__);
        $response = $this->client->call($action, $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            if ((string) $sxml->return != 'true') {
                throw new Ec2Exception(sprintf('Amazon Ec2 could not %s "%s". It returned "%s"', $action, $options['VpcId'], $sxml->return));
            }
            $result = true;
            $entity = $this->ec2->getEntityManagerEnabled() ? $this->ec2->vpc->get($options['VpcId']) : null;
            if ($entity !== null) {
                $this->getEntityManager()->detach($entity);
            }
        }
        return $result;
    }
Ec2Api