Actions Extension Points

Actions are invoked in the vSphere Client from menus or toolbars. The actions extension points allow you to add actions to global or contextual menus, and to prioritize the placement of actions within menus and toolbars.

vise.actions.sets

Defines a set of actions, each of which is represented by the class ActionSpec.

Requires a data object of type ActionSpec with available properties:

  • uid - action ID.
  • label - user-visible action label.
  • actionUrl - URL of the action target.
  • dialogTitle - target dialog title.
  • dialogSize - target dialog width and height.
  • className - accepts the following classes:
    • com.vmware.vsphere.client.HtmlPluginModalAction - opens a modal dialog by using the JavaScript API method modal.open().
    • com.vmware.vsphere.client.HtmlPluginHeadlessAction - initiates a function call with no associated UI view.
    • com.vmware.vsphere.client.htmlbridge.HtmlActionDelegate - opens a modal dialog or initiates a headless function using the deprecated htmlbridge JavaScript API.

Accessibility: {object} → {menu} → {plugin sub-menu}

Example:

<extension id="com.vmware.samples.htmlsample.vmActionSet">
  <extendedPoint>vise.actions.sets</extendedPoint>
  <object>
    <actions>
      <com.vmware.actionsfw.ActionSpec>
        <uid>com.vmware.samples.htmlsample.vm.action</uid>
        <label>#{action1.label}</label>
        <delegate>
          <className>com.vmware.vsphere.client.HtmlPluginModalAction</className>
            <object><root>
              <actionUrl>/ui/html-sample/index.html?view=vm-action-modal</actionUrl>
              <dialogTitle>#{actionModelTitle}</dialogTitle>
              <dialogSize>500,250</dialogSize>
            </root></object>
        </delegate>
      </com.vmware.actionsfw.ActionSpec>
    </actions>
  </object>
  <metadata>
    <objectType>VirtualMachine</objectType>
  </metadata>
</extension>
vmware.prioritization.listActions deprecated

Defines and prioritizes global list actions (not related to a particular object).

Requires a data object of type ActionPriorityGroup with available properties:

  • prioritizedIds - list of action IDs to declare as global.

    Note: The vSphere HTML Client does not support action prioritization.

  • regionId - ID of the extension that contains the global actions.

Accessibility: {object list} → {action button bar} and {list menu}

Example:

<extension id="com.vmware.sample.chassis.listAction">
   <extendedPoint>vmware.prioritization.listActions</extendedPoint>
   <object>
      <prioritizedIds>
         <String>com.vmware.samples.chassisa.createChassis</String>
      </prioritizedIds>
      <regionId>com.vmware.samples.chassisa.list</regionId>
   </object>
</extension>
vsphere.core.menus.solutionMenus

Defines a custom sub-menu including actions, separators, and nested menus.

Requires a data object of type ActionMenuItemSpec with available properties:

  • uid - menu item ID.
  • type - type of menu item. Supported values are "menu", "action" and "separator".
  • label - (optional) user-visible label of the menu item.

    If omitted and the type is "action", the label defined in the action declaration will be used.

  • icon - (optional) 18x18 icon resource ID.

    If omitted and the type is "action", the icon defined in the action declaration will be used.

  • children - (optional) array of child menu items (ActionMenuItemSpec) if the type is "menu".

Accessibility: {object} → {menu}

Example:

<extension id="com.vmware.samples.vspherewssdk.vmMenu">
   <extendedPoint>vsphere.core.menus.solutionMenus</extendedPoint>
   <object>
      <label>WSSDK menu</label>
      <children>
         <Array>
            <com.vmware.actionsfw.ActionMenuItemSpec>
               <type>action</type>
               <uid>com.vmware.samples.vspherewssdk.myVmAction1</uid>
            </com.vmware.actionsfw.ActionMenuItemSpec>
            <com.vmware.actionsfw.ActionMenuItemSpec>
               <type>separator</type>
            </com.vmware.actionsfw.ActionMenuItemSpec>
            <com.vmware.actionsfw.ActionMenuItemSpec>
               <type>action</type>
               <uid>com.vmware.samples.vspherewssdk.myVmAction2</uid>
            </com.vmware.actionsfw.ActionMenuItemSpec>
         </Array>
      </children>
   </object>
   <metadata>
      <objectType>VirtualMachine</objectType>
   </metadata>
</extension>