def remove(cls, resource_id, parent_id=None, grandparent_id=None,
               wait=True, timeout=None):
        """Delete the required resource.

        :param resource_id:      The identifier for the specific resource
                                 within the resource type.
        :param parent_id:        The identifier for the specific ancestor
                                 resource within the resource type.
        :param grandparent_id:   The identifier that is associated with
                                 network objects that are ancestors of the
                                 parent of the necessary resource.
        :param wait:             Whether to wait until the operation is
                                 completed
        :param timeout:          The maximum amount of time required for this
                                 operation to be completed.

        If optional :param wait: is True and timeout is None (the default),
        block if necessary until the resource is available. If timeout is a
        positive number, it blocks at most timeout seconds and raises the
        `TimeOut` exception if no item was available within that time.

        Otherwise (block is false), return a resource if one is immediately
        available, else raise the `NotFound` exception (timeout is ignored
        in that case).
        """
        client = cls._get_client()
        endpoint = cls._endpoint.format(resource_id=resource_id or "",
                                        parent_id=parent_id or "",
                                        grandparent_id=grandparent_id or "")
        client.remove_resource(endpoint)

        elapsed_time = 0
        while wait:
            try:
                resource = cls._get(resource_id=resource_id,
                                    parent_id=parent_id,
                                    grandparent_id=grandparent_id)
                resource.is_ready()
                LOG.debug("The resource is still available. %r", resource)
            except exception.NotFound:
                LOG.debug("The resource was successfully removed.")
                break

            elapsed_time += CONFIG.HNV.retry_interval
            if timeout and elapsed_time > timeout:
                raise exception.TimeOut("The request timed out.")
            time.sleep(CONFIG.HNV.retry_interval)