Manila share driver hooks are designed to provide additional possibilities for each manila-share service; such as any kind of notification and additional actions before and after share driver calls.
Perform actions before some share driver method calls.
driver call and preceding hook call.
Call additional ‘periodic’ hook each ‘N’ ticks.
Possibility to update results of driver’s action by post-running hook.
Errors in hook execution can be suppressed.
Any hook can be disabled.
service.
especially, more than one hook instance, then all of them will be executed in one thread.
Share drivers can [re]define method get_periodic_hook_data that runs with each execution of ‘periodic’ hook and receives list of shares (as parameter) with existing access rules. So, each share driver, for each of its shares can add/update some information that will be used then in the periodic hook.
All implementations of ‘hook’ interface are expected to be in ‘manila/share/hooks’. Each implementation should inherit class ‘manila.share.hook:HookBase’ and redefine its abstract methods.
Just set config option ‘hook_drivers’ in driver’s config group. For example:
[MY_DRIVER]
hook_drivers=path.to:FooClass,path.to:BarClass
Then all classes defined above will be initialized. In the same config group, any config option of hook modules can be redefined too.
Note
More info about common config options for hooks can be found in module manila.share.hook
Above list with wrapped methods can be extended in future.
Module with hook interface for actions performed by share driver.
All available hooks are placed in manila/share/hooks dir.
Hooks are used by share services and can serve several use cases such as any kind of notification and performing additional backend-specific actions.
Bases: object
Hook called on periodic basis.
Hook called after driver’s action.
Hook called before driver’s action.
Authentication and Authorization
Enter search terms or a module, class or function name.