Add hook trigger for object update
|Category:||Core & System|
|Target version:||Release 4.2|
Create a new trigger hook action on object update. At least for networks.
#3 Updated by Simon Boulet about 6 years ago
- File opennebula-update-hook.patch added
I'm posting this here even though this feature is closed, as there seems to be several features / bugs related to this, and have found the UPDATE hook to be very straight forward to implement compared to adding hooks for API calls (#1783 and #1734). In fact, I've actually found the UPDATE hook to be partially implemented.
The attached patch add an UPDATE hook at the PoolSQL hooks level. It will NOT be triggered for VMs or Hosts, as these used specialized hooks. It will work for User, VNet, Image and Groups, see "Other Hooks" from the Hooks page:
It can be particularly useful for tracking changes to User or VNet templates (one.user.update, or "Configuration Attributes" from Sunstone).
That page should also be updated for this new UPDATE hook, and also to remove the DISABLE hook which is invalid (under "Other Hooks").
#5 Updated by Ruben S. Montero about 6 years ago
- Status changed from New to Closed
I went through the code and I'd rather not use these mechanism. Note that the update hook is trigger whenever the object is updated in the database. This can be because of an explicit update operation or any other state change (e.g. user is added to a group, quota updates...)
This can be very confusing for someone developing a hook as it could be triggered by multiple events. I think that the original API - hooks is a better place to add this.
Anyway, Thank you very much for your suggestions and support :)