Feature #1734

Add hook trigger for object update

Added by Javi Fontan almost 8 years ago. Updated over 7 years ago.

Status:ClosedStart date:01/18/2013
Priority:LowDue date:
Assignee:-% Done:


Category:Core & System
Target version:Release 4.2
Resolution:duplicate Pull request:


Create a new trigger hook action on object update. At least for networks.

opennebula-update-hook.patch Magnifier (2.47 KB) Simon Boulet, 07/05/2013 06:20 PM

Related issues

Related to Backlog #1783: create hooks for API actions on network and image resources Pending 02/26/2013


#1 Updated by Ruben S. Montero over 7 years ago

  • Priority changed from Normal to Low

#2 Updated by Ruben S. Montero over 7 years ago

  • Status changed from New to Closed
  • Resolution set to duplicate

#3 Updated by Simon Boulet over 7 years ago

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").



#4 Updated by Ruben S. Montero over 7 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 over 7 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 :)


Also available in: Atom PDF