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

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

Deletes a subnet from a VPC. You must terminate all running instances in the subnet before deleting it, otherwise Amazon VPC returns an error
public deleteSubnet ( string $subnetId ) : boolean
$subnetId string The ID of the subnet.
Результат boolean Returns TRUE on success.
    public function deleteSubnet($subnetId)
    {
        $result = null;
        $options = array('SubnetId' => (string) $subnetId);
        $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 subnet "%s". It returned "%s"', $options['SubnetId'], $sxml->return));
            }
            $result = true;
            $entity = $this->ec2->getEntityManagerEnabled() ? $this->ec2->subnet->get($options['SubnetId']) : null;
            if ($entity !== null) {
                $this->getEntityManager()->detach($entity);
            }
        }
        return $result;
    }
Ec2Api