Ejemplo n.º 1
0
    def delete(self, bigip):
        u"""Delete a resource on a BIG-IP system.

        Loads a resource and deletes it.

        Args:
            bigip: BigIP instance to use for delete resource.

        Raises:
            F5CcclResourceDeleteError: resouce cannot be deleted for an
            unspecified reason.

            F5CcclResourceNotFoundError: resouce cannot be deleted because
            it already exists on the BIG-IP
        """
        LOGGER.info("Deleting %s: /%s/%s",
                    self.classname(), self.partition, self.name)
        try:
            obj = self._uri_path(bigip).load(
                name=urlquote(self.name),
                partition=self.partition)
            obj.delete()
        except AttributeError as err:
            msg = "Could not delete {}, is it present on the BIG-IP?".format(
                str(self))
            raise cccl_exc.F5CcclResourceDeleteError(msg)
        except iControlUnexpectedHTTPError as err:
            self._handle_http_error(err)
        except F5SDKError as err:
            LOGGER.error("Delete FAILED: /%s/%s", self.partition, self.name)
            raise cccl_exc.F5CcclResourceDeleteError(str(err))
Ejemplo n.º 2
0
 def f():
     raise exceptions.F5CcclResourceDeleteError()