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

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

Deletes a route table from a VPC. The route table must not be associated with a subnet. You can't delete the main route table
public deleteRoute ( string $routeTableId, string $destinationCidrBlock ) : boolean
$routeTableId string The ID of the Route Table.
$destinationCidrBlock string The CIDR range for the route to delete.
Результат boolean Returns TRUE on success
    public function deleteRoute($routeTableId, $destinationCidrBlock)
    {
        $result = false;
        $options = ['RouteTableId' => (string) $routeTableId, 'DestinationCidrBlock' => (string) $destinationCidrBlock];
        $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 RouteTableId:"%s". It returned "%s"', $action, $options['RouteTableId'], $sxml->return));
            }
            $result = true;
        }
        return $result;
    }
Ec2Api