Ejemplo n.º 1
0
    def update(self, bigip, data=None, modify=False):
        u"""Update a resource (e.g., pool) on a BIG-IP system.

        Modifies a resource on a BIG-IP system using attributes
        defined in the model object.
        The internal data model is applied to the BIG-IP

        Args:
            bigip: BigIP instance to use for updating resource.
            data: Applies mostly for 'patching' or modify, but contains targets
                for update operation specifically
            modify: Specifies if this is a modify, or patch of specific
                Key/Value Pairs rather than the whole object

        Raises:
            F5CcclResourceUpdateError: resouce cannot be updated for an
            unspecified reason.

            F5CcclResourceNotFoundError: resouce cannot be updated because
            it does not exist on the BIG-IP
        """
        if not data:
            data = self._data
        try:
            obj = self._uri_path(bigip).load(name=urlquote(self.name),
                                             partition=self.partition)
            payload = copy.copy(data)
            if modify:
                obj.modify(**payload)
            else:
                obj.update(**payload)
        except iControlUnexpectedHTTPError as err:
            self._handle_http_error(err)
        except F5SDKError as err:
            raise cccl_exc.F5CcclResourceUpdateError(str(err))
Ejemplo n.º 2
0
 def f():
     raise exceptions.F5CcclResourceUpdateError()