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

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

Deletes an Internet gateway from your AWS account. The gateway must not be attached to a VPC
public deleteInternetGateway ( string $internetGatewayId ) : boolean
$internetGatewayId string The ID of the Internet Gateway
Результат boolean Returns TRUE on success
    public function deleteInternetGateway($internetGatewayId)
    {
        $result = false;
        $options = array('InternetGatewayId' => (string) $internetGatewayId);
        $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 InternetGatewayId:"%s". It returned "%s"', $action, $options['InternetGatewayId'], $sxml->return));
            }
            $result = true;
            $entity = $this->ec2->getEntityManagerEnabled() ? $this->ec2->internetGateway->get($options['InternetGatewayId']) : null;
            if ($entity !== null) {
                $this->ec2->getEntityManager()->detach($entity);
            }
        }
        return $result;
    }
Ec2Api