You can access the Web platform APIs through the WEB_PLATFORM variable that is defined in the web-platform.js generated for each plug-in.
Following is a list of the JavaScript APIs provided with the vSphere Client development kit.
Use this function to invoke a headless action from within a user interface action dialog. Pass to the function the following parameters:
The target objectIds are added automatically to the url parameter. For more information about how to create headless actions, see Creating Actions Extensions. |
|||||||
Close a dialog that was opened through a user interface action such as when a form is submitted. |
|||||||
Get the ID of the action that is invoked to open a user interface action or wizard. You can use the returned action ID in the url parameter of the callActionsController(url, jsonData) function. |
|||||||
Retrieve a comma-separated list of object IDs selected for an action. This function returns null for a global action. Use this function only within a user interface action dialog. |
|||||||
Get the context object ID within an object view or a modal dialog. You can use this object ID to retrieve the vSphere object data from the vCenter Server system. |
|||||||
Retrieve the localized value of a string that is defined in the plug-in resource bundle. Pass to the function the following parameters:
|
|||||||
Retrieve information that is provided within a global view by using the vCenter Server selector. The retrieved properties are serviceGuid, sessionId, and serviceUrl. For more information about how to enable the vCenter Server selector option, see Adding a vCenter Server Selector. |
|||||||
Retrieve information about the current user session. The function returns the following properties:
You can use also the getUserSession() method of the UserSessionService Java service to retrieve details about the user session. |
|||||||
Invoke this function to refresh your HTML views when the user clicks on the global Refresh button. Pass as argument the function that refreshes your HTML view. |
|||||||
openModalDialog(title, url, width, height, objectId, scrollPolicy, showCloseButton) |
Invoke this function to open a modal dialog from within an HTML view, such as a wizard. The modal dialog blocks the rest of the user interface and is not limited to the HTML view. Because the dialog is modal, the content of the HTML view disappears temporarily until the dialog is closed. Pass to the function the following parameters: |
||||||
Trigger an event that results in the update of the object model when something in the vSphere inventory changes. The function accepts the following parameters: |
|||||||
Invoke this function to open a global view or an object view. The function accepts the following parameters:
|
|||||||
Change the title of the dialog at runtime. This function overrides the value of the <dialogTitle> property defined in the plugin.xml manifest file. |
Following is a list of the additional utility APIs that are defined in the plug-in namespace variable inside the web-platform.js file.