vSphere

 View Only
  • 1.  Defining Event List for Remote Plugin

    Posted May 05, 2021 02:22 PM

    I am developing a vCenter remote plugin and would like to create some custom event types for my extension that could be displayed in the vSphere Client "Events" view. Is there a way to define a list of custom event IDs for a vCenter remote plugin at the time of plugin registration?

    Additional context:

    In the MOB interface for vCenter, each Extension within the ExtensionManger contains the following lists:

    • eventList
    • taskList
    • faultList
    • privilegeList
    • resourceList

    According to the readme for the registration script in the vSphere Client SDK, there are options for populating all of the above lists except for eventList: (reference: html-client-sdk\samples\remote-plugin-sample\registration\readme.txt):

    The taskList.json contains task IDs and can be passed to the vCenter plugin registration tool with the --taskList argument
    The faultList.json contains fault IDs and can be passed to the vCenter plugin registration tool with the --faultList argument
    The privilegeList.json contains privilege IDs and can be passed to the vCenter plugin registration tool with the --privilegeList argument
    The resourceList.json contains localization information and can be passed to the vCenter plugin registration tool with the --resourceList argument

    So I was hoping for something where I could include an eventList.json file using an --eventList argument in the vCenter plugin registration tool, but that does not seem to be an option. Is there a recommended way for defining a set of custom events for a remote plugin?

    I appreciate any guidance you can provide.

    Thanks,
    Michael



  • 2.  RE: Defining Event List for Remote Plugin
    Best Answer

    Broadcom Employee
    Posted May 18, 2021 07:53 AM

     
    Hi Michael,

    The SDK plugin registration tool is just demonstrating how to use the ExtensionManager API of the vCenter Server, not a full-blown tool for production use. It is needed for registering a plugin (hence the support from the Client SDK) but there is nothing plugin-specific so you can use any other tool or custom script to call the API.

    That said, we did expect that plugin writers would have different use cases not covered by the tool so it is provided both as a prebuilt version and as a Java project: html-client-sdk\tools\vCenter plugin registration\project

    You can add support for events following how it is handled for tasks, e.g. start from duplicating PluginExtensionRegistryService.updateTaskList. Ultimately, the tool sets up an example of how to work with Extensions with localization, error handling, etc. so you can easily code your specific use case or just copy parts of the implementation in your own installer.

    If you need further assistance please let us know.

    Cheers,

    Vladi



  • 3.  RE: Defining Event List for Remote Plugin

    Posted May 18, 2021 02:49 PM

    Thanks , appreciate the information! Glad to hear it is possible to do what we were hoping. I will use the example you mentioned as a reference for implementing this in our plugin.

    Kind Regards,
    Michael