List of all available event hooks

Hello,

Is there anybody who knows all available event hooks? Interworx documentation seems to be lacking this stuff.

I. am working on a plugin that automatically installs a custom script upon new account creation and creates a database and user. However, due to a lack of documentation, I do not know which events I should hook my codes into.

For example, In cPanel:

https://documentation.cpanel.net/display/DD/Guide+to+Standardized+Hooks+-+Whostmgr+Functions

We can use the Accounts::create event to hook our codes.

Hi ajs

Welcome to IW forums

If you search the forums, there are plenty of threads on event plugins

As you say, documentation is limited but for IW, just check out API and you should be able to use the API commands for event hooks

Here is 1 example but hopefully IW or other forum members may post a better reply

Many thanks

John

1

/

3

jimdunnRegistered User

Sep '11

Hi

I recently needed to add some actions to be performed by the OS when Shell users are activated or deactivated, and a plugin seemed to be the way to go.

In the end it was relatively simple, because I could just make a copy of the supplied “Event Hooks” plugin and edit same to create a new plugin.

I did, however, have to “guess” the Controller names and actions, based on the API docs. Thanks to consistent naming (bless you…) that, too, was easy, and my first “guess” of:

Ctrl_Nodeworx_Shell enable ... 
Ctrl_Nodeworx_Shell disable ...

worked perfectly.

Once I could trigger the event scripts to run, dumping the environment variables passed through to find what I needed for the script was trivial ($iw-users).

My only question was, is there a document I failed to find detailing this, and other aspects of creating plugins ?

Incidentally, my compliments on the simplicity and scope of this plugin approach - I think it will be extremely useful, and makes an already great CP even more configurable and versatile.

thanks.

  • created

Sep '11

  • [

last reply

](/t/plugin-documentation/12977/3)

Sep '11

  • 2

replies

11 DAYS LATER

IWorx-DanAdministrator

Sep '11

Hi Jim,

Unfortunately the plugin documentation doesn’t exist yet because plugins were originally added as a system for integrating 3rd party software (like softaculous) and for custom paid plugins and not for “public” use. This stance has since changed but as a result we still don’t have any documentation :(. If you have a specific question about something you can always shoot us a support ticket that a developer can take a look at to try and help you out. The example plugins that are there are a great resource and as you mentioned, the naming of controllers is consistent with how they are named in the API.

jimdunnRegistered User

Sep '11

Thanks Dan,

[QUOTE=IWorx-Dan;18578]Unfortunately the plugin documentation doesn’t exist yet because plugins were originally added as a system for integrating 3rd party software (like softaculous) and for custom paid plugins and not for “public” use. This stance has since changed but as a result we still don’t have any documentation :(.
[/quote]
No problem - just wanted to be sure I hadn’t missed something…

If you have a specific question about something you can always shoot us a support ticket that a developer can take a look at to try and help you out.

If there’s anything that stumps me I’ll take you up on that kind offer - there’s nothing I haven’t been able to work out so far.
(That’s more a tribute to the logical way the plugin system works than anything else…)

The example plugins that are there are a great resource and as you mentioned, the naming of controllers is consistent with how they are named in the API.

They are a great resource, and the consistent naming between API and plugin saved me a lot of “guessing” in the plugin I created.

Thanks again

Jim

Hello–

There is not really documentation on a standard list because we do not have pre-made eventhooks created. It has always really been used as a specific customer customization, not anything standardized.

Here is documentation on the event hook system, which you might have found, already (I’m currently in the process of a mass overhaul of all of our documentation on IW7, so some changes are being made): https://appendix.interworx.com/current/nodeworx/plugins/install-use-event-hooks-plugin.html

John already mentioned that the API documentation may also be helpful for you, but here is a link to that, as well: https://appendix.interworx.com/current/api/index.html

The CLI guide may also be helpful: https://appendix.interworx.com/current/getting_started/cli-overview.html

You can use the CLI to find the correct action items for scripts by adding the -v flag when accessing it. That will provide the output of the command you ran. So, for instance, for creating a SiteWorx account, you would use nodeworx -u -v to log in, and then select the prompt number for SiteWorx (all of the following outputs are truncated):

[[email protected] ~]# nodeworx -u -v
+--------------------------------------------------------------------+
|                    Additional input is required                    |
+--------------------------------------------------------------------+
(1) Login / Logout
(2) NodeWorx Home
(3) NodeWorx: User Accounts
(4) NodeWorx: Languages
(5) NodeWorx: API Key
(6) NodeWorx: Plugins
(7) NodeWorx: Authentication
(8) NodeWorx: Subscriptions
(9) SiteWorx: Accounts

Select the prompt for Add:

Controller [none] : 9
+--------------------------------------------------------------------+
|                          Choose an Action                          |
+--------------------------------------------------------------------+
(1) queryDomain * Query the system for a domain information.
(2) matchPackagesWithTemplates * Find existing package template names and match account packages to them.
(3) listAccounts * List Siteworx accounts summary.
(4) listDomainAccounts * List Siteworx accounts including master and secondary domain details.
(5) queryDomainAccountDetails * Query domain account details.
(6) search * Search siteworx accounts summary.
(7) toggleFavorite * Toggle a "favorite" SiteWorx account.
(8) siteworxLogin * Login to a given SiteWorx account.
(9) deleteAccountOnNode * Delete a SiteWorx Account on this Cluster Node.
(10) delete * Delete a SiteWorx Account.
(11) setConfig * Set SiteWorx Level Config Data.
(12) setDomainConfig * Set Domain Level Config Data.
(13) deleteConfig * Delete SiteWorx Level Config Data.
(14) deleteDomainConfig * Delete Domain Level Config Data.
(15) queryConfig * Query SiteWorx Level Config Data.
(16) queryDomainConfig * Query Domain Level Config Data.
(17) listConfig * List all SiteWorx Level Config Data.
(18) listDomainConfig * List all Domain Level Config Data.
(19) add * Add a SiteWorx account.

Provide all the various account info:

Action [none] : 19
+--------------------------------------------------------------------+
|                    SiteWorx Account Management                     |
+--------------------------------------------------------------------+
Reseller [Server Admin ([email protected])] : Server Admin ([email protected])
Master Domain : newdomain.com
IPv4 Address : 10.1.14.36
IPv6 Pool [No IPv6 Pool] :
IPv6 Address :
Database server [localhost] :
Unix User Name [] : newdoma
Status [pending] : pending

At the end it will output everything it did:

Save? : y


SiteWorx account added successfully
Package Successfully Added
Command executed: nodeworx -u -n -c Siteworx -a add --master_domain newdomain.com --master_domain_ipv4 10.1.14.36 --master_domain_ipv6  --uniqname newdoma --nickname  --email [email protected] --password [PASSWORD] --confirm_password [PASSWORD] --requires_password_change 0 --create_package 1 --new_package_name new --OPT_STORAGE 1 --OPT_BANDWIDTH 1 --OPT_EMAIL_ALIASES 1 --OPT_EMAIL_AUTORESPONDERS 1 --OPT_EMAIL_BOXES 1 --OPT_EMAIL_GROUPS 1 --OPT_FTP_ACCOUNTS 1 --OPT_MYSQL_DBS 1 --OPT_MYSQL_DB_USERS 1 --OPT_POINTER_DOMAINS 1 --OPT_SLAVE_DOMAINS 1 --OPT_SUBDOMAINS 1


[[email protected] ~]#

You can then use that information to create and modify automated scripts.

There is also Plugin documentation, as well: https://appendix.interworx.com/current/user_guide/interworx-plugin-developer-guide.html

Thanks,
-Jenna
Friendly Neighborhood InterWorx Support Manager

2 Likes

Thanks for your help, Jenna and John. Much appreciated.