Feature #1734
Add hook trigger for object update
Status: | Closed | Start date: | 01/18/2013 | |
---|---|---|---|---|
Priority: | Low | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | Core & System | |||
Target version: | Release 4.2 | |||
Resolution: | duplicate | Pull request: |
Description
Create a new trigger hook action on object update. At least for networks.
Related issues
History
#1 Updated by Ruben S. Montero about 8 years ago
- Priority changed from Normal to Low
#2 Updated by Ruben S. Montero about 8 years ago
- Status changed from New to Closed
- Resolution set to duplicate
#3 Updated by Simon Boulet about 8 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:
http://opennebula.org/documentation:rel4.0:hooks
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").
Thanks
Simon
#4 Updated by Ruben S. Montero about 8 years ago
- Status changed from Closed to New
- Target version set to Release 4.2
Reopen it to evaluate... It seems very straight forward :)
#5 Updated by Ruben S. Montero about 8 years ago
- Status changed from New to Closed
Hi Simon,
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 :)
Ruben